posthog-node 5.61.2 → 5.62.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/client.d.ts +5 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -1
- package/dist/client.mjs +2 -1
- package/dist/emails/emails.d.ts +2 -1
- package/dist/emails/emails.d.ts.map +1 -1
- package/dist/emails/emails.js +130 -18
- package/dist/emails/emails.mjs +130 -18
- package/dist/emails/types.d.ts +57 -14
- package/dist/emails/types.d.ts.map +1 -1
- package/dist/exports.d.ts +1 -1
- package/dist/exports.d.ts.map +1 -1
- package/dist/extensions/feature-flags/feature-flags.d.ts +1 -1
- package/dist/extensions/feature-flags/feature-flags.d.ts.map +1 -1
- package/dist/extensions/feature-flags/feature-flags.js +2 -1
- package/dist/extensions/feature-flags/feature-flags.mjs +2 -1
- package/dist/types.d.ts +4 -2
- 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 +4 -3
- package/src/client.ts +6 -3
- package/src/emails/emails.ts +157 -25
- package/src/emails/types.ts +54 -14
- package/src/exports.ts +5 -0
- package/src/extensions/feature-flags/feature-flags.ts +8 -2
- package/src/types.ts +4 -2
- package/src/version.ts +1 -1
|
@@ -345,7 +345,9 @@ class FeatureFlagsPoller {
|
|
|
345
345
|
} else if (e instanceof Error) {
|
|
346
346
|
this.onError?.(new Error(`Error computing flag locally: ${flag.key}: ${e}`))
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
if (evaluationRuntimesMatch(normalizeEvaluationRuntime(flag.evaluation_runtime), 'server')) {
|
|
349
|
+
fallbackToFlags = true
|
|
350
|
+
}
|
|
349
351
|
}
|
|
350
352
|
})
|
|
351
353
|
)
|
|
@@ -925,7 +927,7 @@ class FeatureFlagsPoller {
|
|
|
925
927
|
}
|
|
926
928
|
|
|
927
929
|
/**
|
|
928
|
-
* Warn about flags whose definition local evaluation cannot resolve.
|
|
930
|
+
* Warn about server-applicable flags whose definition local evaluation cannot resolve.
|
|
929
931
|
* Called after loading flag definitions when local evaluation is enabled. Each flag is
|
|
930
932
|
* warned about once until its definition changes.
|
|
931
933
|
*/
|
|
@@ -937,6 +939,10 @@ class FeatureFlagsPoller {
|
|
|
937
939
|
const warnedFlags = new Map<string, string>()
|
|
938
940
|
const definitions = this.currentDefinitions()
|
|
939
941
|
for (const flag of flags) {
|
|
942
|
+
// Client-only definitions are retained for server-side bootstrapping.
|
|
943
|
+
if (!evaluationRuntimesMatch(normalizeEvaluationRuntime(flag.evaluation_runtime), 'server')) {
|
|
944
|
+
continue
|
|
945
|
+
}
|
|
940
946
|
const reason = getDefinitionUnresolvedReason(flag, definitions)
|
|
941
947
|
if (!reason) {
|
|
942
948
|
continue
|
package/src/types.ts
CHANGED
|
@@ -237,7 +237,7 @@ export type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'flushInte
|
|
|
237
237
|
* Local evaluation can also use definitions from `flagDefinitionCacheProvider` without
|
|
238
238
|
* this credential. Remote config payload decryption via `getRemoteConfigPayload`
|
|
239
239
|
* still requires it. `emails.send` needs a Project Secret API Key with the
|
|
240
|
-
* `
|
|
240
|
+
* `transactional_email:write` scope; set `enableLocalEvaluation: false` when the key is only for email.
|
|
241
241
|
* Prefer this over the deprecated
|
|
242
242
|
* `personalApiKey` option; when both are set, `secretKey` takes precedence.
|
|
243
243
|
*
|
|
@@ -273,6 +273,8 @@ export type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'flushInte
|
|
|
273
273
|
* @default 2
|
|
274
274
|
*/
|
|
275
275
|
emailRequestMaxRetries?: number
|
|
276
|
+
/** The provider your email moved from, such as `'resend'`. Sent with every `posthog.emails` request. */
|
|
277
|
+
migratedFrom?: string
|
|
276
278
|
/**
|
|
277
279
|
* Redact prompts, outputs and error details from every event that the PostHog AI
|
|
278
280
|
* integrations (`@posthog/ai`) capture with this client. Per-call privacy settings
|
|
@@ -950,7 +952,7 @@ export interface IPostHog {
|
|
|
950
952
|
|
|
951
953
|
/**
|
|
952
954
|
* @description The `posthog.emails` API: sends transactional email from PostHog email templates.
|
|
953
|
-
* Needs `secretKey`, a project secret API key with the `
|
|
955
|
+
* Needs `secretKey`, a project secret API key with the `transactional_email:write` scope.
|
|
954
956
|
*/
|
|
955
957
|
readonly emails: Emails
|
|
956
958
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "5.
|
|
1
|
+
export const version = "5.62.0"
|