posthog-js 1.310.2 → 1.312.0

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.
@@ -2838,7 +2838,11 @@ declare class PageViewManager {
2838
2838
  pathname: string | undefined;
2839
2839
  };
2840
2840
  _instance: PostHog;
2841
+ private _unsubscribeSessionId?;
2841
2842
  constructor(instance: PostHog);
2843
+ private _setupSessionRotationHandler;
2844
+ private _onSessionIdChange;
2845
+ destroy(): void;
2842
2846
  doPageView(timestamp: Date, pageViewId?: string): PageViewEventProperties;
2843
2847
  doPageLeave(timestamp: Date): PageViewEventProperties;
2844
2848
  doEvent(): PageViewEventProperties;
@@ -4059,6 +4063,45 @@ declare class PostHog {
4059
4063
  * @public
4060
4064
  */
4061
4065
  reloadFeatureFlags(): void;
4066
+ /**
4067
+ * Manually update feature flag values without making a network request.
4068
+ *
4069
+ * This is useful when you have feature flag values from an external source
4070
+ * (e.g., server-side evaluation, edge middleware) and want to inject them
4071
+ * into the client SDK.
4072
+ *
4073
+ * {@label Feature flags}
4074
+ *
4075
+ * @example
4076
+ * ```js
4077
+ * // Replace all flags with server-evaluated values
4078
+ * posthog.updateFlags({
4079
+ * 'my-flag': true,
4080
+ * 'my-experiment': 'variant-a'
4081
+ * })
4082
+ *
4083
+ * // Merge with existing flags (update only specified flags)
4084
+ * posthog.updateFlags(
4085
+ * { 'my-flag': true },
4086
+ * undefined,
4087
+ * { merge: true }
4088
+ * )
4089
+ *
4090
+ * // With payloads
4091
+ * posthog.updateFlags(
4092
+ * { 'my-flag': true },
4093
+ * { 'my-flag': { some: 'data' } }
4094
+ * )
4095
+ * ```
4096
+ *
4097
+ * @param flags - An object mapping flag keys to their values (boolean or string variant)
4098
+ * @param payloads - Optional object mapping flag keys to their JSON payloads
4099
+ * @param options - Optional settings. Use `{ merge: true }` to merge with existing flags instead of replacing.
4100
+ * @public
4101
+ */
4102
+ updateFlags(flags: Record<string, boolean | string>, payloads?: Record<string, JsonType>, options?: {
4103
+ merge?: boolean;
4104
+ }): void;
4062
4105
  /**
4063
4106
  * Opt the user in or out of an early access feature. [Learn more in the docs](/docs/feature-flags/early-access-feature-management#option-2-custom-implementation)
4064
4107
  *