posthog-js 1.310.2 → 1.311.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.
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +39 -0
- package/dist/module.full.d.ts +39 -0
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +39 -0
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +39 -0
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/src/posthog-core.d.ts +39 -0
- package/dist/surveys-preview.d.ts +39 -0
- package/lib/package.json +1 -1
- package/lib/src/posthog-core.d.ts +39 -0
- package/lib/src/posthog-core.js +75 -3
- package/lib/src/posthog-core.js.map +1 -1
- package/package.json +1 -1
|
@@ -4059,6 +4059,45 @@ declare class PostHog {
|
|
|
4059
4059
|
* @public
|
|
4060
4060
|
*/
|
|
4061
4061
|
reloadFeatureFlags(): void;
|
|
4062
|
+
/**
|
|
4063
|
+
* Manually update feature flag values without making a network request.
|
|
4064
|
+
*
|
|
4065
|
+
* This is useful when you have feature flag values from an external source
|
|
4066
|
+
* (e.g., server-side evaluation, edge middleware) and want to inject them
|
|
4067
|
+
* into the client SDK.
|
|
4068
|
+
*
|
|
4069
|
+
* {@label Feature flags}
|
|
4070
|
+
*
|
|
4071
|
+
* @example
|
|
4072
|
+
* ```js
|
|
4073
|
+
* // Replace all flags with server-evaluated values
|
|
4074
|
+
* posthog.updateFlags({
|
|
4075
|
+
* 'my-flag': true,
|
|
4076
|
+
* 'my-experiment': 'variant-a'
|
|
4077
|
+
* })
|
|
4078
|
+
*
|
|
4079
|
+
* // Merge with existing flags (update only specified flags)
|
|
4080
|
+
* posthog.updateFlags(
|
|
4081
|
+
* { 'my-flag': true },
|
|
4082
|
+
* undefined,
|
|
4083
|
+
* { merge: true }
|
|
4084
|
+
* )
|
|
4085
|
+
*
|
|
4086
|
+
* // With payloads
|
|
4087
|
+
* posthog.updateFlags(
|
|
4088
|
+
* { 'my-flag': true },
|
|
4089
|
+
* { 'my-flag': { some: 'data' } }
|
|
4090
|
+
* )
|
|
4091
|
+
* ```
|
|
4092
|
+
*
|
|
4093
|
+
* @param flags - An object mapping flag keys to their values (boolean or string variant)
|
|
4094
|
+
* @param payloads - Optional object mapping flag keys to their JSON payloads
|
|
4095
|
+
* @param options - Optional settings. Use `{ merge: true }` to merge with existing flags instead of replacing.
|
|
4096
|
+
* @public
|
|
4097
|
+
*/
|
|
4098
|
+
updateFlags(flags: Record<string, boolean | string>, payloads?: Record<string, JsonType>, options?: {
|
|
4099
|
+
merge?: boolean;
|
|
4100
|
+
}): void;
|
|
4062
4101
|
/**
|
|
4063
4102
|
* 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
4103
|
*
|