posthog-node 5.60.1 → 5.61.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 +34 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +30 -2
- package/dist/client.mjs +30 -2
- package/dist/emails/emails.d.ts +45 -0
- package/dist/emails/emails.d.ts.map +1 -0
- package/dist/emails/emails.js +360 -0
- package/dist/emails/emails.mjs +316 -0
- package/dist/emails/errors.d.ts +37 -0
- package/dist/emails/errors.d.ts.map +1 -0
- package/dist/emails/errors.js +79 -0
- package/dist/emails/errors.mjs +41 -0
- package/dist/emails/types.d.ts +112 -0
- package/dist/emails/types.d.ts.map +1 -0
- package/dist/emails/types.js +18 -0
- package/dist/emails/types.mjs +1 -0
- package/dist/exports.d.ts +3 -0
- package/dist/exports.d.ts.map +1 -1
- package/dist/exports.js +19 -9
- package/dist/exports.mjs +1 -0
- package/dist/types.d.ts +33 -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 +2 -2
- package/src/client.ts +72 -1
- package/src/emails/emails.ts +459 -0
- package/src/emails/errors.ts +90 -0
- package/src/emails/types.ts +108 -0
- package/src/exports.ts +12 -0
- package/src/types.ts +34 -2
- package/src/version.ts +1 -1
package/src/types.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
} from '@posthog/core'
|
|
16
16
|
import { ContextData, ContextOptions } from './extensions/context/types'
|
|
17
17
|
|
|
18
|
+
import type { Emails } from './emails/types'
|
|
18
19
|
import type { FeatureFlagEvaluations } from './feature-flag-evaluations'
|
|
19
20
|
import type { FlagDefinitionCacheInput, FlagDefinitionCacheProvider } from './extensions/feature-flags/cache'
|
|
20
21
|
|
|
@@ -229,12 +230,15 @@ export type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'flushInte
|
|
|
229
230
|
*/
|
|
230
231
|
traces?: TracesConfig
|
|
231
232
|
/**
|
|
232
|
-
* Credential for fetching local feature flag definitions
|
|
233
|
+
* Credential for fetching local feature flag definitions, decrypting remote config and
|
|
234
|
+
* sending email.
|
|
233
235
|
*
|
|
234
236
|
* Accepts either a Personal API Key (`phx_...`) or a Project Secret API Key (`phs_...`).
|
|
235
237
|
* Local evaluation can also use definitions from `flagDefinitionCacheProvider` without
|
|
236
238
|
* this credential. Remote config payload decryption via `getRemoteConfigPayload`
|
|
237
|
-
* still requires it.
|
|
239
|
+
* still requires it. `emails.send` needs a Project Secret API Key with the
|
|
240
|
+
* `hog_flow:write` scope; set `enableLocalEvaluation: false` when the key is only for email.
|
|
241
|
+
* Prefer this over the deprecated
|
|
238
242
|
* `personalApiKey` option; when both are set, `secretKey` takes precedence.
|
|
239
243
|
*
|
|
240
244
|
* @example
|
|
@@ -247,6 +251,28 @@ export type PostHogOptions = Omit<PostHogCoreOptions, 'before_send' | 'flushInte
|
|
|
247
251
|
* @deprecated Use `secretKey` instead.
|
|
248
252
|
*/
|
|
249
253
|
personalApiKey?: string
|
|
254
|
+
/**
|
|
255
|
+
* Your PostHog app host, such as `https://posthog.example.com`. `emails.send` sends there.
|
|
256
|
+
*
|
|
257
|
+
* Needed only when `host` is not PostHog Cloud, for example a reverse proxy, which must not
|
|
258
|
+
* receive the secret key. On PostHog Cloud, the client derives `https://us.posthog.com` or
|
|
259
|
+
* `https://eu.posthog.com` from `host`.
|
|
260
|
+
*/
|
|
261
|
+
appHost?: string
|
|
262
|
+
/**
|
|
263
|
+
* Timeout in milliseconds for each `emails.send` request.
|
|
264
|
+
*
|
|
265
|
+
* @default 15000
|
|
266
|
+
*/
|
|
267
|
+
emailRequestTimeoutMs?: number
|
|
268
|
+
/**
|
|
269
|
+
* Number of retries for an `emails.send` after a network error, a rate limit, or an
|
|
270
|
+
* unavailable service. Every retry sends the same idempotency key. Set to 0 when a job
|
|
271
|
+
* runner already retries the send.
|
|
272
|
+
*
|
|
273
|
+
* @default 2
|
|
274
|
+
*/
|
|
275
|
+
emailRequestMaxRetries?: number
|
|
250
276
|
/**
|
|
251
277
|
* Redact prompts, outputs and error details from every event that the PostHog AI
|
|
252
278
|
* integrations (`@posthog/ai`) capture with this client. Per-call privacy settings
|
|
@@ -922,6 +948,12 @@ export interface IPostHog {
|
|
|
922
948
|
*/
|
|
923
949
|
readonly metrics: Metrics
|
|
924
950
|
|
|
951
|
+
/**
|
|
952
|
+
* @description The `posthog.emails` API: sends transactional email from PostHog email templates.
|
|
953
|
+
* Needs `secretKey`, a project secret API key with the `hog_flow:write` scope.
|
|
954
|
+
*/
|
|
955
|
+
readonly emails: Emails
|
|
956
|
+
|
|
925
957
|
/**
|
|
926
958
|
* @description Starts a span without making it active, for work that can't wrap a callback.
|
|
927
959
|
* Prefer `withSpan`. Always returns a handle — an inert one when tracing is off — so calling
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "5.
|
|
1
|
+
export const version = "5.61.0"
|