posthog-node 5.39.4 → 5.41.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/LICENSE +2 -2
- package/dist/capture-v1/config.d.ts +11 -0
- package/dist/capture-v1/config.d.ts.map +1 -0
- package/dist/capture-v1/config.js +42 -0
- package/dist/capture-v1/config.mjs +8 -0
- package/dist/capture-v1/errors.d.ts +32 -0
- package/dist/capture-v1/errors.d.ts.map +1 -0
- package/dist/capture-v1/errors.js +49 -0
- package/dist/capture-v1/errors.mjs +15 -0
- package/dist/capture-v1/routing.d.ts +21 -0
- package/dist/capture-v1/routing.d.ts.map +1 -0
- package/dist/capture-v1/routing.js +47 -0
- package/dist/capture-v1/routing.mjs +7 -0
- package/dist/capture-v1/sender.d.ts +70 -0
- package/dist/capture-v1/sender.d.ts.map +1 -0
- package/dist/capture-v1/sender.js +222 -0
- package/dist/capture-v1/sender.mjs +188 -0
- package/dist/capture-v1/transform.d.ts +34 -0
- package/dist/capture-v1/transform.d.ts.map +1 -0
- package/dist/capture-v1/transform.js +142 -0
- package/dist/capture-v1/transform.mjs +99 -0
- package/dist/capture-v1/types.d.ts +50 -0
- package/dist/capture-v1/types.d.ts.map +1 -0
- package/dist/capture-v1/types.js +18 -0
- package/dist/capture-v1/types.mjs +0 -0
- package/dist/client.d.ts +24 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +43 -1
- package/dist/client.mjs +44 -2
- package/dist/extensions/feature-flags/feature-flags.js +2 -2
- package/dist/extensions/feature-flags/feature-flags.mjs +2 -2
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +3 -3
- package/src/capture-v1/config.ts +18 -0
- package/src/capture-v1/errors.ts +52 -0
- package/src/capture-v1/routing.ts +28 -0
- package/src/capture-v1/sender.ts +298 -0
- package/src/capture-v1/transform.ts +159 -0
- package/src/capture-v1/types.ts +55 -0
- package/src/client.ts +80 -3
- package/src/extensions/feature-flags/feature-flags.ts +2 -2
- package/src/types.ts +19 -2
- package/src/version.ts +1 -1
package/src/types.ts
CHANGED
|
@@ -145,6 +145,23 @@ export type BeforeSendFn = (event: EventMessage | null) => EventMessage | null
|
|
|
145
145
|
|
|
146
146
|
export type PostHogOptions = Omit<PostHogCoreOptions, 'before_send'> & {
|
|
147
147
|
persistence?: 'memory'
|
|
148
|
+
/**
|
|
149
|
+
* Credential that enables local feature flag evaluation and remote config.
|
|
150
|
+
*
|
|
151
|
+
* Accepts either a Personal API Key (`phx_...`) or a Project Secret API Key (`phs_...`).
|
|
152
|
+
* When provided, the client can evaluate feature flags locally and decrypt remote
|
|
153
|
+
* config payloads via `getRemoteConfigPayload`. Prefer this over the deprecated
|
|
154
|
+
* `personalApiKey` option; when both are set, `secretKey` takes precedence.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* const client = new PostHog('phc_...', { secretKey: 'phs_...' })
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
secretKey?: string
|
|
162
|
+
/**
|
|
163
|
+
* @deprecated Use `secretKey` instead.
|
|
164
|
+
*/
|
|
148
165
|
personalApiKey?: string
|
|
149
166
|
privacyMode?: boolean
|
|
150
167
|
enableExceptionAutocapture?: boolean
|
|
@@ -153,8 +170,8 @@ export type PostHogOptions = Omit<PostHogCoreOptions, 'before_send'> & {
|
|
|
153
170
|
// Maximum size of cache that deduplicates $feature_flag_called calls per user.
|
|
154
171
|
maxCacheSize?: number
|
|
155
172
|
fetch?: (url: string, options: PostHogFetchOptions) => Promise<PostHogFetchResponse>
|
|
156
|
-
// Whether to enable feature flag polling for local evaluation by default. Defaults to true when
|
|
157
|
-
// We recommend setting this to false if you are only using the
|
|
173
|
+
// Whether to enable feature flag polling for local evaluation by default. Defaults to true when secretKey is provided.
|
|
174
|
+
// We recommend setting this to false if you are only using the secretKey for evaluating remote config payloads via `getRemoteConfigPayload` and not using local evaluation.
|
|
158
175
|
enableLocalEvaluation?: boolean
|
|
159
176
|
/**
|
|
160
177
|
* Optional cache provider for feature flag definitions.
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.
|
|
1
|
+
export const version = '5.41.0'
|