diff --git a/playground/nextjs/pages/index.tsx b/playground/nextjs/pages/index.tsx index f2a72d5fb..77f0f3ff0 100644 --- a/playground/nextjs/pages/index.tsx +++ b/playground/nextjs/pages/index.tsx @@ -2,7 +2,7 @@ import { useActiveFeatureFlags, usePostHog } from 'posthog-js/react' import { useEffect, useState } from 'react' import { cookieConsentGiven, PERSON_PROCESSING_MODE } from '@/src/posthog' -import { setAllPersonProfilePropertiesAsPersonPropertiesForFlags } from 'posthog-js/lib/src/customizations/setAllPersonProfilePropertiesAsPersonPropertiesForFlags' +import { setAllPersonProfilePropertiesAsPersonPropertiesForFlags } from 'posthog-js/lib/src/customizations' import { STORED_PERSON_PROPERTIES_KEY } from '../../../src/constants' export default function Home() { diff --git a/src/customizations/index.ts b/src/customizations/index.ts new file mode 100644 index 000000000..7cb66f40b --- /dev/null +++ b/src/customizations/index.ts @@ -0,0 +1,2 @@ +export * from './setAllPersonProfilePropertiesAsPersonPropertiesForFlags' +export * from './before-send' diff --git a/src/entrypoints/customizations.full.ts b/src/entrypoints/customizations.full.ts new file mode 100644 index 000000000..eb17c13c0 --- /dev/null +++ b/src/entrypoints/customizations.full.ts @@ -0,0 +1,7 @@ +// this file is called customizations.full.ts because it includes all customizations +// this naming scheme allows us to create a lighter version in the future with only the most popular customizations +// without breaking backwards compatibility + +import * as customizations from '../customizations' +import { assignableWindow } from '../utils/globals' +assignableWindow.posthogCustomizations = customizations diff --git a/src/posthog-persistence.ts b/src/posthog-persistence.ts index 131c85ed6..0a5546c00 100644 --- a/src/posthog-persistence.ts +++ b/src/posthog-persistence.ts @@ -224,7 +224,7 @@ export class PostHogPersistence { const campaignParams = Info.campaignParams(this.config.custom_campaign_params) // only save campaign params if there were any if (!isEmptyObject(stripEmptyProperties(campaignParams))) { - this.register(Info.campaignParams(this.config.custom_campaign_params)) + this.register(campaignParams) } this.campaign_params_saved = true }