-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Labels
enhancementNew feature or requestNew feature or requestfeaturequestionFurther information is requestedFurther information is requested
Description
Is your feature request related to a problem?
Is common to disable Posthog for non-production environments.
Right now, it needs to be done like this in React:
function PostHogProviderInProd({ children }: { children: ReactNode }) {
if (!IS_PRODUCTION) {
return children;
}
return (
<PostHogProvider
apiKey=""
>
{children}
</PostHogProvider>
);
}Describe the solution you'd like
It will be a better DX to disable PostHog like this:
function MyComponent({ children }: { children: ReactNode }) {
return (
<PostHogProvider
apiKey=""
disable={!IS_PRODUCTION}
>
{children}
</PostHogProvider>
);
}A disable property should be in all posthog libraries since this is a common case.
Describe alternatives you've considered
Related sub-libraries
- All of them
- posthog-js (web)
- posthog-js-lite (web lite)
- posthog-node
- posthog-react-native
- @posthog/react
- @posthog/ai
- @posthog/convex
- @posthog/nextjs-config
- @posthog/nuxt
- @posthog/rollup-plugin
- @posthog/webpack-plugin
Additional context
Thank you for your feature request – we love each and every one!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestfeaturequestionFurther information is requestedFurther information is requested