diff --git a/packages/browser/src/browser/__tests__/analytics-pre-init.integration.test.ts b/packages/browser/src/browser/__tests__/analytics-pre-init.integration.test.ts index d045cac26..10384fca6 100644 --- a/packages/browser/src/browser/__tests__/analytics-pre-init.integration.test.ts +++ b/packages/browser/src/browser/__tests__/analytics-pre-init.integration.test.ts @@ -287,7 +287,9 @@ describe('Pre-initialization', () => { ;(window as any).segment = [onTrack, track, track2, identify] - await AnalyticsBrowser.standalone(writeKey, { bufferKey: 'segment' }) + await AnalyticsBrowser.standalone(writeKey, { + globalAnalyticsKey: 'segment', + }) await sleep(100) // the snippet does not return a promise (pre-initialization) ... it sometimes has a callback as the third argument. expect(trackSpy).toBeCalledWith('foo') diff --git a/packages/browser/src/browser/__tests__/integration.test.ts b/packages/browser/src/browser/__tests__/integration.test.ts index 5017c8b20..992091e08 100644 --- a/packages/browser/src/browser/__tests__/integration.test.ts +++ b/packages/browser/src/browser/__tests__/integration.test.ts @@ -257,7 +257,7 @@ describe('Initialization', () => { ], }, { - bufferKey: overrideKey, + globalAnalyticsKey: overrideKey, } ) expect.assertions(1) diff --git a/packages/browser/src/browser/index.ts b/packages/browser/src/browser/index.ts index e859e8866..4b096e516 100644 --- a/packages/browser/src/browser/index.ts +++ b/packages/browser/src/browser/index.ts @@ -291,7 +291,8 @@ async function loadAnalytics( options: InitOptions = {}, preInitBuffer: PreInitMethodCallBuffer ): Promise<[Analytics, Context]> { - if (options.bufferKey) setGlobalAnalyticsKey(options.bufferKey) + if (options.globalAnalyticsKey) + setGlobalAnalyticsKey(options.globalAnalyticsKey) // this is an ugly side-effect, but it's for the benefits of the plugins that get their cdn via getCDN() if (settings.cdnURL) setGlobalCDNUrl(settings.cdnURL) diff --git a/packages/browser/src/core/analytics/index.ts b/packages/browser/src/core/analytics/index.ts index 706433db1..d42ca5470 100644 --- a/packages/browser/src/core/analytics/index.ts +++ b/packages/browser/src/core/analytics/index.ts @@ -121,7 +121,7 @@ export interface InitOptions { * Key for the global window property storing the buffered calls * default: analytics */ - bufferKey?: string + globalAnalyticsKey?: string } /* analytics-classic stubs */