posthog-js 1.275.0 → 1.275.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.
Files changed (42) hide show
  1. package/dist/array.full.es5.js +1 -1
  2. package/dist/array.full.es5.js.map +1 -1
  3. package/dist/array.full.js +1 -1
  4. package/dist/array.full.js.map +1 -1
  5. package/dist/array.full.no-external.js +1 -1
  6. package/dist/array.full.no-external.js.map +1 -1
  7. package/dist/array.js +1 -1
  8. package/dist/array.js.map +1 -1
  9. package/dist/array.no-external.js +1 -1
  10. package/dist/array.no-external.js.map +1 -1
  11. package/dist/customizations.full.js +1 -1
  12. package/dist/lazy-recorder.js +1 -1
  13. package/dist/main.js +1 -1
  14. package/dist/main.js.map +1 -1
  15. package/dist/module.d.ts +11 -1
  16. package/dist/module.full.d.ts +11 -1
  17. package/dist/module.full.js +1 -1
  18. package/dist/module.full.js.map +1 -1
  19. package/dist/module.full.no-external.d.ts +11 -1
  20. package/dist/module.full.no-external.js +1 -1
  21. package/dist/module.full.no-external.js.map +1 -1
  22. package/dist/module.js +1 -1
  23. package/dist/module.js.map +1 -1
  24. package/dist/module.no-external.d.ts +11 -1
  25. package/dist/module.no-external.js +1 -1
  26. package/dist/module.no-external.js.map +1 -1
  27. package/dist/posthog-recorder.js +1 -1
  28. package/dist/src/posthog-persistence.d.ts +5 -1
  29. package/dist/src/sessionid.d.ts +6 -0
  30. package/dist/surveys-preview.d.ts +11 -1
  31. package/lib/package.json +1 -1
  32. package/lib/src/extensions/sentry-integration.js +0 -1
  33. package/lib/src/extensions/sentry-integration.js.map +1 -1
  34. package/lib/src/posthog-core.js +6 -4
  35. package/lib/src/posthog-core.js.map +1 -1
  36. package/lib/src/posthog-persistence.d.ts +5 -1
  37. package/lib/src/posthog-persistence.js +4 -0
  38. package/lib/src/posthog-persistence.js.map +1 -1
  39. package/lib/src/sessionid.d.ts +6 -0
  40. package/lib/src/sessionid.js +20 -4
  41. package/lib/src/sessionid.js.map +1 -1
  42. package/package.json +2 -2
@@ -1975,6 +1975,7 @@ declare class SessionIdManager {
1975
1975
  private _sessionIdChangedHandlers;
1976
1976
  private readonly _sessionTimeoutMs;
1977
1977
  private _enforceIdleTimeout;
1978
+ private _beforeUnloadListener;
1978
1979
  private _eventEmitter;
1979
1980
  on(event: 'forcedIdleReset', handler: () => void): () => void;
1980
1981
  constructor(instance: PostHog, sessionIdGenerator?: () => string, windowIdGenerator?: () => string);
@@ -1986,6 +1987,11 @@ declare class SessionIdManager {
1986
1987
  private _setSessionId;
1987
1988
  private _getSessionId;
1988
1989
  resetSessionId(): void;
1990
+ /**
1991
+ * Cleans up resources used by SessionIdManager.
1992
+ * Should be called when the SessionIdManager is no longer needed to prevent memory leaks.
1993
+ */
1994
+ destroy(): void;
1989
1995
  private _listenToReloadWindow;
1990
1996
  private _sessionHasBeenIdleTooLong;
1991
1997
  checkAndGetSessionAndWindowId(readOnly?: boolean, _timestamp?: number | null): {
@@ -2235,7 +2241,11 @@ declare class PostHogPersistence {
2235
2241
  * @param {boolean=} isDisabled should persistence be disabled (e.g. because of consent management)
2236
2242
  */
2237
2243
  constructor(config: PostHogConfig, isDisabled?: boolean);
2238
- isDisabled(): boolean;
2244
+ /**
2245
+ * Returns whether persistence is disabled. Only available in SDKs > 1.257.1. Do not use on extensions, otherwise
2246
+ * it'll break backwards compatibility for any version before 1.257.1.
2247
+ */
2248
+ isDisabled?(): boolean;
2239
2249
  private _buildStorage;
2240
2250
  properties(): Properties;
2241
2251
  load(): void;