posthog-js-lite 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/lib/index.cjs.js +11 -13
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.esm.js +11 -13
- package/lib/index.esm.js.map +1 -1
- package/lib/posthog-core/src/types.d.ts +2 -2
- package/package.json +1 -1
- package/src/storage.ts +1 -1
- package/test/posthog-web.spec.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare type PostHogCoreOptions = {
|
|
2
|
-
/** PostHog API host, usually 'https://
|
|
2
|
+
/** PostHog API host, usually 'https://us.i.posthog.com' or 'https://eu.i.posthog.com' */
|
|
3
3
|
host?: string;
|
|
4
4
|
/** The number of events to queue before sending to PostHog (flushing) */
|
|
5
5
|
flushAt?: number;
|
|
@@ -36,7 +36,7 @@ export declare type PostHogCoreOptions = {
|
|
|
36
36
|
featureFlagsRequestTimeoutMs?: number;
|
|
37
37
|
/** For Session Analysis how long before we expire a session (defaults to 30 mins) */
|
|
38
38
|
sessionExpirationTimeSeconds?: number;
|
|
39
|
-
/** Whether to post events to PostHog in JSON or compressed format */
|
|
39
|
+
/** Whether to post events to PostHog in JSON or compressed format. Defaults to 'form' */
|
|
40
40
|
captureMode?: 'json' | 'form';
|
|
41
41
|
disableGeoip?: boolean;
|
|
42
42
|
};
|
package/package.json
CHANGED
package/src/storage.ts
CHANGED
|
@@ -145,7 +145,7 @@ const createMemoryStorage = (): PostHogStorage => {
|
|
|
145
145
|
|
|
146
146
|
export const getStorage = (type: PostHogOptions['persistence'], window: Window | undefined): PostHogStorage => {
|
|
147
147
|
if (window) {
|
|
148
|
-
if (!
|
|
148
|
+
if (!localStore) {
|
|
149
149
|
const _localStore = createStorageLike(window.localStorage)
|
|
150
150
|
localStore = checkStoreIsSupported(_localStore) ? _localStore : undefined
|
|
151
151
|
}
|
package/test/posthog-web.spec.ts
CHANGED
|
@@ -61,7 +61,7 @@ describe('PostHogWeb', () => {
|
|
|
61
61
|
|
|
62
62
|
await waitForPromises()
|
|
63
63
|
|
|
64
|
-
expect(fetch).toHaveBeenCalledWith('https://
|
|
64
|
+
expect(fetch).toHaveBeenCalledWith('https://us.i.posthog.com/decide/?v=3', {
|
|
65
65
|
body: JSON.stringify({
|
|
66
66
|
token: 'TEST_API_KEY',
|
|
67
67
|
distinct_id: posthog.getDistinctId(),
|