-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore: Prep work for adding Mixpanel session recording #36895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,10 @@ export interface INJECTED_CONFIGS { | |
| fusioncharts: { | ||
| licenseKey: string; | ||
| }; | ||
| enableMixpanel: boolean; | ||
| mixpanel: { | ||
| enabled: boolean; | ||
| apiKey: string; | ||
| }; | ||
| cloudHosting: boolean; | ||
| algolia: { | ||
| apiId: string; | ||
|
|
@@ -77,9 +80,12 @@ export const getConfigsFromEnvVars = (): INJECTED_CONFIGS => { | |
| fusioncharts: { | ||
| licenseKey: process.env.REACT_APP_FUSIONCHARTS_LICENSE_KEY || "", | ||
| }, | ||
| enableMixpanel: process.env.REACT_APP_SEGMENT_KEY | ||
| ? process.env.REACT_APP_SEGMENT_KEY.length > 0 | ||
| : false, | ||
| mixpanel: { | ||
| enabled: process.env.REACT_APP_SEGMENT_KEY | ||
| ? process.env.REACT_APP_SEGMENT_KEY.length > 0 | ||
| : false, | ||
| apiKey: process.env.REACT_APP_MIXPANEL_KEY || "", | ||
| }, | ||
|
Comment on lines
+83
to
+88
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Attention, class! We have an interesting configuration setup here. While I appreciate the effort to include Mixpanel in our configuration, I have a concern about our implementation. Can anyone spot the potential issue? Let's break it down:
Do you see the mismatch? We're using Segment's key to enable Mixpanel. This could lead to confusion or unexpected behavior. Here's a homework assignment for you: How could we improve this to make it more logical and less prone to errors? Think about using a dedicated environment variable for enabling Mixpanel. Would you like to discuss a more appropriate implementation for enabling Mixpanel? |
||
| algolia: { | ||
| apiId: process.env.REACT_APP_ALGOLIA_API_ID || "", | ||
| apiKey: process.env.REACT_APP_ALGOLIA_API_KEY || "", | ||
|
|
@@ -161,6 +167,10 @@ export const getAppsmithConfigs = (): AppsmithUIConfigs => { | |
| ENV_CONFIG.segment.apiKey, | ||
| APPSMITH_FEATURE_CONFIGS?.segment.apiKey, | ||
| ); | ||
| const mixpanel = getConfig( | ||
| ENV_CONFIG.mixpanel.apiKey, | ||
| APPSMITH_FEATURE_CONFIGS?.mixpanel.apiKey, | ||
| ); | ||
|
Comment on lines
+170
to
+173
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Class, let's examine how we're configuring Mixpanel in our getAppsmithConfigs function. I see some room for improvement here. Let's analyze it together:
Remember, Mixpanel and Segment are different analytics tools. By tying Mixpanel's enablement to Segment, we might be creating a dependency that doesn't necessarily exist. Also, notice that we're not using the For your next assignment, I want you to think about how we can make this configuration more independent and aligned with our earlier setup. How can we ensure that Mixpanel's configuration stands on its own? Shall we discuss a more appropriate implementation for configuring Mixpanel in this function? Also applies to: 291-294 |
||
| const newRelicAccountId = getConfig( | ||
| ENV_CONFIG.newRelic.accountId, | ||
| APPSMITH_FEATURE_CONFIGS?.newRelic.accountId, | ||
|
|
@@ -278,10 +288,10 @@ export const getAppsmithConfigs = (): AppsmithUIConfigs => { | |
| enabled: googleRecaptchaSiteKey.enabled, | ||
| apiKey: googleRecaptchaSiteKey.value, | ||
| }, | ||
| enableMixpanel: | ||
| ENV_CONFIG.enableMixpanel || | ||
| APPSMITH_FEATURE_CONFIGS?.enableMixpanel || | ||
| false, | ||
| mixpanel: { | ||
| enabled: segment.enabled, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is intentionally using segment enabled because that is how it was working before |
||
| apiKey: mixpanel.value, | ||
| }, | ||
| cloudHosting: | ||
| ENV_CONFIG.cloudHosting || | ||
| APPSMITH_FEATURE_CONFIGS?.cloudHosting || | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.