Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): add env info to tracks (#6313)

Brooooooklynffbfdb65a21f
diff --git a/packages/frontend/core/src/router.tsx b/packages/frontend/core/src/router.tsx
index 053963a604..17642447ad 100644
--- a/packages/frontend/core/src/router.tsx
+++ b/packages/frontend/core/src/router.tsx
@@ -14,6 +14,10 @@ function RootRouter() {
useEffect(() => {
mixpanel.track_pageview({
page: location.pathname,
+ appVersion: runtimeConfig.appVersion,
+ environment: runtimeConfig.appBuildType,
+ editorVersion: runtimeConfig.editorVersion,
+ isSelfHosted: Boolean(runtimeConfig.isSelfHosted),
});
}, [location]);
return <Outlet />;
diff --git a/tools/cli/src/webpack/config.ts b/tools/cli/src/webpack/config.ts
index 159a7778ad..4f155a3522 100644
--- a/tools/cli/src/webpack/config.ts
+++ b/tools/cli/src/webpack/config.ts
@@ -349,6 +349,7 @@ export const createConfiguration: (
),
'process.env.SENTRY_DSN': JSON.stringify(process.env.SENTRY_DSN),
'process.env.BUILD_TYPE': JSON.stringify(process.env.BUILD_TYPE),
+ 'process.env.MIXPANEL_TOKEN': `"${process.env.MIXPANEL_TOKEN}"`,
runtimeConfig: JSON.stringify(runtimeConfig),
}),
new CopyPlugin({