From e066c3cea711061877a6f399ed149747ef31738a Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 24 Feb 2026 11:53:36 -0500 Subject: [PATCH 1/5] Include github core --- packages/node/api-extractor.jsonc | 10 +- .../posthog-node-references-5.19.0.json | 2442 ++++++++++++++++- .../posthog-node-references-latest.json | 2221 ++++++++++++++- packages/node/scripts/generate-docs.mjs | 6 +- scripts/docs/methods.js | 3 +- 5 files changed, 4396 insertions(+), 286 deletions(-) diff --git a/packages/node/api-extractor.jsonc b/packages/node/api-extractor.jsonc index d2eaa11607..0e071b0291 100644 --- a/packages/node/api-extractor.jsonc +++ b/packages/node/api-extractor.jsonc @@ -67,7 +67,7 @@ * * "bundledPackages": [ "@my-company/*" ], */ - "bundledPackages": [], + "bundledPackages": ["@posthog/core"], /** * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files @@ -111,6 +111,14 @@ * DEFAULT VALUE: "/tsconfig.json" */ "tsconfigFilePath": "/tsconfig.build.json", + /** + * Include DOM lib so bundled @posthog/core types (e.g. ErrorEvent) resolve when inlining. + */ + "overrideTsconfig": { + "compilerOptions": { + "lib": ["ES2023", "DOM"] + } + }, /** * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * The object must conform to the TypeScript tsconfig schema: diff --git a/packages/node/references/posthog-node-references-5.19.0.json b/packages/node/references/posthog-node-references-5.19.0.json index 5b7fd27c6e..6fac00dc5e 100644 --- a/packages/node/references/posthog-node-references-5.19.0.json +++ b/packages/node/references/posthog-node-references-5.19.0.json @@ -1082,263 +1082,2423 @@ "name": "T" }, "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "addPendingPromise", + "showDocs": true, + "title": "addPendingPromise", + "examples": [ + { + "id": "addpendingpromise", + "name": "Generated example for addPendingPromise", + "code": "// Generated example for addPendingPromise\nposthog.addPendingPromise();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "Promise", + "name": "promise" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "aliasStateless", + "showDocs": true, + "title": "aliasStateless", + "examples": [ + { + "id": "aliasstateless", + "name": "Generated example for aliasStateless", + "code": "// Generated example for aliasStateless\nposthog.aliasStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "alias" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "aliasStatelessImmediate", + "showDocs": true, + "title": "aliasStatelessImmediate", + "examples": [ + { + "id": "aliasstatelessimmediate", + "name": "Generated example for aliasStatelessImmediate", + "code": "// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "alias" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "captureStateless", + "showDocs": true, + "title": "captureStateless", + "examples": [ + { + "id": "capturestateless", + "name": "Generated example for captureStateless", + "code": "// Generated example for captureStateless\nposthog.captureStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "event" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "captureStatelessImmediate", + "showDocs": true, + "title": "captureStatelessImmediate", + "examples": [ + { + "id": "capturestatelessimmediate", + "name": "Generated example for captureStatelessImmediate", + "code": "// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "event" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** QUEUEING AND FLUSHING *", + "details": null, + "id": "enqueue", + "showDocs": true, + "title": "enqueue", + "examples": [ + { + "id": "enqueue", + "name": "Generated example for enqueue", + "code": "// Generated example for enqueue\nposthog.enqueue();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "type" + }, + { + "description": "", + "isOptional": false, + "type": "any", + "name": "_message" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "fetch", + "showDocs": true, + "title": "fetch", + "examples": [ + { + "id": "fetch", + "name": "Generated example for fetch", + "code": "// Generated example for fetch\nposthog.fetch();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "url" + }, + { + "description": "", + "isOptional": false, + "type": "PostHogFetchOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "Initialization", + "description": "Flushes the queue of pending events.\nThis function will return a promise that will resolve when the flush is complete, or reject if there was an error (for example if the server or network is down).\nIf there is already a flush in progress, this function will wait for that flush to complete.\nIt's recommended to do error handling in the callback of the promise.", + "details": null, + "id": "flush", + "showDocs": true, + "title": "flush", + "examples": [ + { + "id": "flush_with_error_handling", + "name": "flush with error handling", + "code": "\n\n// flush with error handling\nposthog.flush().then(() => {\n console.log('Flush complete')\n}).catch((err) => {\n console.error('Flush failed', err)\n})\n\n\n" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getCommonEventProperties", + "showDocs": true, + "title": "getCommonEventProperties", + "examples": [ + { + "id": "getcommoneventproperties", + "name": "Generated example for getCommonEventProperties", + "code": "// Generated example for getCommonEventProperties\nposthog.getCommonEventProperties();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "PostHogEventProperties", + "name": "PostHogEventProperties" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getCustomHeaders", + "showDocs": true, + "title": "getCustomHeaders", + "examples": [ + { + "id": "getcustomheaders", + "name": "Generated example for getCustomHeaders", + "code": "// Generated example for getCustomHeaders\nposthog.getCustomHeaders();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "{\n [key: string]: string;\n }", + "name": "{\n [key: string]: string;\n }" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagDetailsStateless", + "showDocs": true, + "title": "getFeatureFlagDetailsStateless", + "examples": [ + { + "id": "getfeatureflagdetailsstateless", + "name": "Generated example for getFeatureFlagDetailsStateless", + "code": "// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagDetailStateless", + "showDocs": true, + "title": "getFeatureFlagDetailStateless", + "examples": [ + { + "id": "getfeatureflagdetailstateless", + "name": "Generated example for getFeatureFlagDetailStateless", + "code": "// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "key" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + } + ], + "returnType": { + "id": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>", + "name": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagPayloadsStateless", + "showDocs": true, + "title": "getFeatureFlagPayloadsStateless", + "examples": [ + { + "id": "getfeatureflagpayloadsstateless", + "name": "Generated example for getFeatureFlagPayloadsStateless", + "code": "// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagPayloadStateless", + "showDocs": true, + "title": "getFeatureFlagPayloadStateless", + "examples": [ + { + "id": "getfeatureflagpayloadstateless", + "name": "Generated example for getFeatureFlagPayloadStateless", + "code": "// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "key" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagsAndPayloadsStateless", + "showDocs": true, + "title": "getFeatureFlagsAndPayloadsStateless", + "examples": [ + { + "id": "getfeatureflagsandpayloadsstateless", + "name": "Generated example for getFeatureFlagsAndPayloadsStateless", + "code": "// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", + "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagsStateless", + "showDocs": true, + "title": "getFeatureFlagsStateless", + "examples": [ + { + "id": "getfeatureflagsstateless", + "name": "Generated example for getFeatureFlagsStateless", + "code": "// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", + "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagStateless", + "showDocs": true, + "title": "getFeatureFlagStateless", + "examples": [ + { + "id": "getfeatureflagstateless", + "name": "Generated example for getFeatureFlagStateless", + "code": "// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "key" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + } + ], + "returnType": { + "id": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>", + "name": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** FEATURE FLAGS *", + "details": null, + "id": "getFlags", + "showDocs": true, + "title": "getFlags", + "examples": [ + { + "id": "getflags", + "name": "Generated example for getFlags", + "code": "// Generated example for getFlags\nposthog.getFlags();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "extraPayload" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "fetchConfig" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getRemoteConfig", + "showDocs": true, + "title": "getRemoteConfig", + "examples": [ + { + "id": "getremoteconfig", + "name": "Generated example for getRemoteConfig", + "code": "// Generated example for getRemoteConfig\nposthog.getRemoteConfig();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** SURVEYS *", + "details": null, + "id": "getSurveysStateless", + "showDocs": true, + "title": "getSurveysStateless", + "examples": [ + { + "id": "getsurveysstateless", + "name": "Generated example for getSurveysStateless", + "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** GROUPS *", + "details": null, + "id": "groupIdentifyStateless", + "showDocs": true, + "title": "groupIdentifyStateless", + "examples": [ + { + "id": "groupidentifystateless", + "name": "Generated example for groupIdentifyStateless", + "code": "// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "groupType" + }, + { + "description": "", + "isOptional": false, + "type": "string | number", + "name": "groupKey" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + }, + { + "description": "", + "isOptional": true, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "eventProperties" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** TRACKING *", + "details": null, + "id": "identifyStateless", + "showDocs": true, + "title": "identifyStateless", + "examples": [ + { + "id": "identifystateless", + "name": "Generated example for identifyStateless", + "code": "// Generated example for identifyStateless\nposthog.identifyStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "identifyStatelessImmediate", + "showDocs": true, + "title": "identifyStatelessImmediate", + "examples": [ + { + "id": "identifystatelessimmediate", + "name": "Generated example for identifyStatelessImmediate", + "code": "// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "logMsgIfDebug", + "showDocs": true, + "title": "logMsgIfDebug", + "examples": [ + { + "id": "logmsgifdebug", + "name": "Generated example for logMsgIfDebug", + "code": "// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "() => void", + "name": "fn" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "on", + "showDocs": true, + "title": "on", + "examples": [ + { + "id": "on", + "name": "Generated example for on", + "code": "// Generated example for on\nposthog.on();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "event" + }, + { + "description": "", + "isOptional": false, + "type": "(...args: any[]) => void", + "name": "cb" + } + ], + "returnType": { + "id": "() => void", + "name": "() => void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "optIn", + "showDocs": true, + "title": "optIn", + "examples": [ + { + "id": "optin", + "name": "Generated example for optIn", + "code": "// Generated example for optIn\nposthog.optIn();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "optOut", + "showDocs": true, + "title": "optOut", + "examples": [ + { + "id": "optout", + "name": "Generated example for optOut", + "code": "// Generated example for optOut\nposthog.optOut();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "register", + "showDocs": true, + "title": "register", + "examples": [ + { + "id": "register", + "name": "Generated example for register", + "code": "// Generated example for register\nposthog.register();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "PostHogEventProperties", + "name": "properties" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "sendImmediate", + "showDocs": true, + "title": "sendImmediate", + "examples": [ + { + "id": "sendimmediate", + "name": "Generated example for sendImmediate", + "code": "// Generated example for sendImmediate\nposthog.sendImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "type" + }, + { + "description": "", + "isOptional": false, + "type": "any", + "name": "_message" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "Initialization", + "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", + "details": null, + "id": "shutdown", + "showDocs": true, + "title": "shutdown", + "examples": [ + { + "id": "shutdown_before_process_exit", + "name": "shutdown before process exit", + "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "Maximum time to wait for shutdown in milliseconds", + "isOptional": true, + "type": "number", + "name": "shutdownTimeoutMs" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "unregister", + "showDocs": true, + "title": "unregister", + "examples": [ + { + "id": "unregister", + "name": "Generated example for unregister", + "code": "// Generated example for unregister\nposthog.unregister();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "property" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "wrap", + "showDocs": true, + "title": "wrap", + "examples": [ + { + "id": "wrap", + "name": "Generated example for wrap", + "code": "// Generated example for wrap\nposthog.wrap();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "() => void", + "name": "fn" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + } + ] + } + ], + "types": [ + { + "id": "_SentryEvent", + "name": "_SentryEvent", + "properties": [], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryEventProcessor", + "name": "_SentryEventProcessor", + "properties": [], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryHub", + "name": "_SentryHub", + "properties": [], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryIntegration", + "name": "_SentryIntegration", + "properties": [ + { + "type": "string", + "name": "name" + } + ], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryIntegrationClass", + "name": "_SentryIntegrationClass", + "properties": [ + { + "type": "string", + "name": "name" + } + ], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "ActionStepStringMatching", + "name": "ActionStepStringMatching", + "properties": [ + { + "type": "\"contains\"", + "name": "Contains" + }, + { + "type": "\"exact\"", + "name": "Exact" + }, + { + "type": "\"regex\"", + "name": "Regex" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "ActionStepType", + "name": "ActionStepType", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n event?: string;\n selector?: string;\n text?: string;\n text_matching?: ActionStepStringMatching;\n href?: string;\n href_matching?: ActionStepStringMatching;\n url?: string;\n url_matching?: ActionStepStringMatching;\n}" + }, + { + "id": "BaseException", + "name": "BaseException", + "properties": [ + { + "type": "boolean", + "name": "synthetic" + }, + { + "type": "string", + "name": "type" + }, + { + "type": "string", + "name": "value" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "BasicSurveyQuestion", + "name": "BasicSurveyQuestion", + "properties": [], + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Open;\n}" + }, + { + "id": "BeforeSendFn", + "name": "BeforeSendFn", + "properties": [], + "path": "src/types.ts", + "example": "(event: EventMessage | null) => EventMessage | null" + }, + { + "id": "ChunkIdMapType", + "name": "ChunkIdMapType", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "Record" + }, + { + "id": "Coercer", + "name": "Coercer", + "properties": [], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "CoercingContext", + "name": "CoercingContext", + "properties": [ + { + "type": "(input: unknown) => ExceptionLike", + "name": "apply" + }, + { + "type": "(input: unknown) => ExceptionLike | undefined", + "name": "next" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "Compression", + "name": "Compression", + "properties": [ + { + "type": "\"base64\"", + "name": "Base64" + }, + { + "type": "\"gzip-js\"", + "name": "GZipJS" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "ContextData", + "name": "ContextData", + "properties": [ + { + "type": "string", + "name": "distinctId" + }, + { + "type": "Record", + "name": "properties" + }, + { + "type": "string", + "name": "sessionId" + } + ], + "path": "src/extensions/context/types.ts" + }, + { + "id": "ContextOptions", + "name": "ContextOptions", + "properties": [ + { + "description": "If true, replaces the current context entirely. If false, merges with the existing context (new values override existing ones). false", + "type": "boolean", + "name": "fresh" + } + ], + "path": "src/extensions/context/types.ts" + }, + { + "id": "EndBranching", + "name": "EndBranching", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.End;\n}" + }, + { + "id": "ErrorProperties", + "name": "ErrorProperties", + "properties": [ + { + "type": "SeverityLevel", + "name": "$exception_level" + }, + { + "type": "Exception[]", + "name": "$exception_list" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ErrorTrackingCoercer", + "name": "ErrorTrackingCoercer", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "Coercer" + }, + { + "id": "EvaluationReason", + "name": "EvaluationReason", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n code: string | undefined;\n condition_index: number | undefined;\n description: string | undefined;\n}" + }, + { + "id": "EventHint", + "name": "EventHint", + "properties": [ + { + "type": "Partial", + "name": "mechanism" + }, + { + "type": "Error | null", + "name": "syntheticException" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "EventMessage", + "name": "EventMessage", + "properties": [], + "path": "src/types.ts", + "example": "Omit & {\n distinctId?: string;\n event: string;\n groups?: Record;\n sendFeatureFlags?: boolean | SendFeatureFlagsOptions;\n timestamp?: Date;\n uuid?: string;\n}" + }, + { + "id": "Exception", + "name": "Exception", + "properties": [ + { + "type": "Mechanism", + "name": "mechanism" + }, + { + "type": "string", + "name": "module" + }, + { + "type": "{\n frames?: StackFrame[];\n type: 'raw';\n }", + "name": "stacktrace" + }, + { + "type": "number", + "name": "thread_id" + }, + { + "type": "string", + "name": "type" + }, + { + "type": "string", + "name": "value" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ExceptionLike", + "name": "ExceptionLike", + "properties": [ + { + "type": "ExceptionLike", + "name": "cause" + }, + { + "type": "SeverityLevel", + "name": "level" + }, + { + "type": "string", + "name": "stack" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ExceptionList", + "name": "ExceptionList", + "properties": [], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ExpressErrorMiddleware", + "name": "ExpressErrorMiddleware", + "properties": [], + "path": "src/extensions/express.ts", + "example": "(error: MiddlewareError, req: Request, res: Response, next: (error: MiddlewareError) => void) => void" + }, + { + "id": "ExpressMiddleware", + "name": "ExpressMiddleware", + "properties": [], + "path": "src/extensions/express.ts", + "example": "(req: Request, res: Response, next: () => void) => void" + }, + { + "id": "FeatureFlagCondition", + "name": "FeatureFlagCondition", + "properties": [], + "path": "src/types.ts", + "example": "{\n properties: FlagProperty[];\n rollout_percentage?: number;\n variant?: string;\n}" + }, + { + "id": "FeatureFlagDetail", + "name": "FeatureFlagDetail", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n reason: EvaluationReason | undefined;\n metadata: FeatureFlagMetadata | undefined;\n}" + }, + { + "id": "FeatureFlagErrorType", + "name": "FeatureFlagErrorType", + "properties": [], + "path": "src/types.ts", + "example": "(typeof FeatureFlagError)[keyof typeof FeatureFlagError] | string" + }, + { + "id": "FeatureFlagMetadata", + "name": "FeatureFlagMetadata", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n id: number | undefined;\n version: number | undefined;\n description: string | undefined;\n payload: string | undefined;\n}" + }, + { + "id": "FeatureFlagOverrideOptions", + "name": "FeatureFlagOverrideOptions", + "properties": [], + "path": "src/types.ts", + "example": "{\n flags?: false | string[] | Record;\n payloads?: false | Record;\n}" + }, + { + "id": "FeatureFlagValue", + "name": "FeatureFlagValue", + "properties": [], + "path": "../core/src/types.ts", + "example": "string | boolean" + }, + { + "id": "FlagDefinitionCacheData", + "name": "FlagDefinitionCacheData", + "properties": [ + { + "description": "Cohort property groups for local evaluation", + "type": "Record", + "name": "cohorts" + }, + { + "description": "Array of feature flag definitions", + "type": "PostHogFeatureFlag[]", + "name": "flags" + }, + { + "description": "Mapping of group type index to group name", + "type": "Record", + "name": "groupTypeMapping" } - ] - } - ], - "types": [ + ], + "path": "src/extensions/feature-flags/cache.ts" + }, { - "id": "_SentryEvent", - "name": "_SentryEvent", + "id": "FlagDefinitionCacheProvider", + "name": "FlagDefinitionCacheProvider", "properties": [], - "path": "src/extensions/sentry-integration.ts" + "path": "src/extensions/feature-flags/cache.ts" }, { - "id": "_SentryEventProcessor", - "name": "_SentryEventProcessor", + "id": "FlagProperty", + "name": "FlagProperty", "properties": [], - "path": "src/extensions/sentry-integration.ts" + "path": "src/types.ts", + "example": "{\n key: string;\n type?: string;\n value: FlagPropertyValue;\n operator?: string;\n negation?: boolean;\n dependency_chain?: string[];\n}" }, { - "id": "_SentryHub", - "name": "_SentryHub", + "id": "FlagPropertyValue", + "name": "FlagPropertyValue", "properties": [], - "path": "src/extensions/sentry-integration.ts" + "path": "src/types.ts", + "example": "string | number | (string | number)[] | boolean" }, { - "id": "_SentryIntegration", - "name": "_SentryIntegration", + "id": "GetModuleFn", + "name": "GetModuleFn", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "(filename: string | undefined) => string | undefined" + }, + { + "id": "GroupIdentifyMessage", + "name": "GroupIdentifyMessage", + "properties": [], + "path": "src/types.ts", + "example": "{\n groupType: string;\n groupKey: string;\n properties?: Record;\n distinctId?: string;\n disableGeoip?: boolean;\n}" + }, + { + "id": "IdentifyMessage", + "name": "IdentifyMessage", + "properties": [], + "path": "src/types.ts", + "example": "{\n distinctId: string;\n properties?: Record;\n disableGeoip?: boolean;\n}" + }, + { + "id": "IPostHog", + "name": "IPostHog", + "properties": [], + "path": "src/types.ts" + }, + { + "id": "IPostHogContext", + "name": "IPostHogContext", + "properties": [], + "path": "src/extensions/context/types.ts" + }, + { + "id": "JsonType", + "name": "JsonType", + "properties": [], + "path": "../core/src/types.ts", + "example": "string | number | boolean | null | {\n [key: string]: JsonType;\n} | Array | JsonType[]" + }, + { + "id": "LinkSurveyQuestion", + "name": "LinkSurveyQuestion", + "properties": [], + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Link;\n link?: string;\n}" + }, + { + "id": "Logger", + "name": "Logger", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n info: (...args: any[]) => void;\n warn: (...args: any[]) => void;\n error: (...args: any[]) => void;\n critical: (...args: any[]) => void;\n createLogger: (prefix: string) => Logger;\n}" + }, + { + "id": "Mechanism", + "name": "Mechanism", "properties": [ + { + "type": "boolean", + "name": "handled" + }, { "type": "string", - "name": "name" + "name": "source" + }, + { + "type": "boolean", + "name": "synthetic" + }, + { + "type": "'generic' | 'onunhandledrejection' | 'onuncaughtexception' | 'onconsole' | 'middleware'", + "name": "type" } ], - "path": "src/extensions/sentry-integration.ts" + "path": "../core/src/error-tracking/types.ts" }, { - "id": "_SentryIntegrationClass", - "name": "_SentryIntegrationClass", + "id": "MiddlewareError", + "name": "MiddlewareError", "properties": [ { - "type": "string", - "name": "name" + "type": "{\n statusCode?: number | string;\n }", + "name": "output" + }, + { + "type": "number | string", + "name": "status_code" + }, + { + "type": "number | string", + "name": "status" + }, + { + "type": "number | string", + "name": "statusCode" } ], - "path": "src/extensions/sentry-integration.ts" + "path": "src/extensions/express.ts" }, { - "id": "BeforeSendFn", - "name": "BeforeSendFn", + "id": "MultipleSurveyQuestion", + "name": "MultipleSurveyQuestion", + "properties": [], + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n choices: string[];\n hasOpenChoice?: boolean;\n shuffleOptions?: boolean;\n}" + }, + { + "id": "NextQuestionBranching", + "name": "NextQuestionBranching", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.NextQuestion;\n}" + }, + { + "id": "ObjectLike", + "name": "ObjectLike", + "properties": [], + "path": "../core/src/error-tracking/coercers/object-coercer.ts", + "example": "Record" + }, + { + "id": "OverrideFeatureFlagsOptions", + "name": "OverrideFeatureFlagsOptions", "properties": [], "path": "src/types.ts", - "example": "(event: EventMessage | null) => EventMessage | null" + "example": "false | string[] | Record | FeatureFlagOverrideOptions" }, { - "id": "ContextData", - "name": "ContextData", + "id": "ParsedException", + "name": "ParsedException", + "properties": [ + { + "type": "ParsedException", + "name": "cause" + }, + { + "type": "StackFrame[]", + "name": "stack" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ParsingContext", + "name": "ParsingContext", + "properties": [ + { + "type": "ChunkIdMapType", + "name": "chunkIdMap" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "PartialWithRequired", + "name": "PartialWithRequired", + "properties": [], + "path": "../core/src/types.ts", + "example": "keyof T> = {\n [P in K]: T[P];\n} & {\n [P in Exclude]?: T[P];\n}" + }, + { + "id": "Platform", + "name": "Platform", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "\"node:javascript\" | \"web:javascript\" | \"hermes\"" + }, + { + "id": "PolymorphicEvent", + "name": "PolymorphicEvent", "properties": [ + { + "type": "unknown", + "name": "currentTarget" + }, + { + "type": "unknown", + "name": "target" + }, { "type": "string", - "name": "distinctId" + "name": "type" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "PostHogCaptureOptions", + "name": "PostHogCaptureOptions", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n uuid?: string;\n timestamp?: Date;\n disableGeoip?: boolean;\n}" + }, + { + "id": "PostHogCoreOptions", + "name": "PostHogCoreOptions", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n host?: string;\n flushAt?: number;\n flushInterval?: number;\n maxBatchSize?: number;\n maxQueueSize?: number;\n disabled?: boolean;\n defaultOptIn?: boolean;\n sendFeatureFlagEvent?: boolean;\n preloadFeatureFlags?: boolean;\n disableRemoteConfig?: boolean;\n disableSurveys?: boolean;\n bootstrap?: {\n distinctId?: string;\n isIdentifiedId?: boolean;\n featureFlags?: Record;\n featureFlagPayloads?: Record;\n };\n fetchRetryCount?: number;\n fetchRetryDelay?: number;\n requestTimeout?: number;\n featureFlagsRequestTimeoutMs?: number;\n remoteConfigRequestTimeoutMs?: number;\n sessionExpirationTimeSeconds?: number;\n disableCompression?: boolean;\n disableGeoip?: boolean;\n historicalMigration?: boolean;\n evaluationEnvironments?: readonly string[];\n}" + }, + { + "id": "PostHogEventProperties", + "name": "PostHogEventProperties", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n [key: string]: JsonType;\n}" + }, + { + "id": "PostHogFeatureFlag", + "name": "PostHogFeatureFlag", + "properties": [], + "path": "src/types.ts", + "example": "{\n id: number;\n name: string;\n key: string;\n filters?: {\n aggregation_group_type_index?: number;\n groups?: FeatureFlagCondition[];\n multivariate?: {\n variants: {\n key: string;\n rollout_percentage: number;\n }[];\n };\n payloads?: Record;\n };\n deleted: boolean;\n active: boolean;\n rollout_percentage: null | number;\n ensure_experience_continuity: boolean;\n experiment_set: number[];\n}" + }, + { + "id": "PostHogFeatureFlagDetails", + "name": "PostHogFeatureFlagDetails", + "properties": [], + "path": "../core/src/types.ts", + "example": "\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\"" + }, + { + "id": "PostHogFetchOptions", + "name": "PostHogFetchOptions", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n method: 'GET' | 'POST' | 'PUT' | 'PATCH';\n mode?: 'no-cors';\n credentials?: 'omit';\n headers: {\n [key: string]: string;\n };\n body?: string | Blob;\n signal?: AbortSignal;\n}" + }, + { + "id": "PostHogFetchResponse", + "name": "PostHogFetchResponse", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n status: number;\n text: () => Promise;\n json: () => Promise;\n headers?: {\n get(name: string): string | null;\n };\n}" + }, + { + "id": "PostHogFlagsAndPayloadsResponse", + "name": "PostHogFlagsAndPayloadsResponse", + "properties": [], + "path": "../core/src/types.ts", + "example": "\"featureFlags\" | \"featureFlagPayloads\"" + }, + { + "id": "PostHogFlagsResponse", + "name": "PostHogFlagsResponse", + "properties": [], + "path": "../core/src/types.ts", + "example": "Omit & {\n featureFlags: {\n [key: string]: FeatureFlagValue;\n };\n featureFlagPayloads: {\n [key: string]: JsonType;\n };\n flags: {\n [key: string]: FeatureFlagDetail;\n };\n errorsWhileComputingFlags: boolean;\n sessionRecording?: boolean | {\n [key: string]: JsonType;\n };\n quotaLimited?: string[];\n requestId?: string;\n evaluatedAt?: number;\n}" + }, + { + "id": "PostHogOptions", + "name": "PostHogOptions", + "properties": [], + "path": "src/types.ts", + "example": "PostHogCoreOptions & {\n persistence?: 'memory';\n personalApiKey?: string;\n privacyMode?: boolean;\n enableExceptionAutocapture?: boolean;\n featureFlagsPollingInterval?: number;\n maxCacheSize?: number;\n fetch?: (url: string, options: PostHogFetchOptions) => Promise;\n enableLocalEvaluation?: boolean;\n flagDefinitionCacheProvider?: FlagDefinitionCacheProvider;\n before_send?: BeforeSendFn | BeforeSendFn[];\n evaluationEnvironments?: readonly string[];\n custom_blocked_useragents?: string[];\n __preview_capture_bot_pageviews?: boolean;\n}" + }, + { + "id": "PostHogPersistedProperty", + "name": "PostHogPersistedProperty", + "properties": [ + { + "type": "\"anonymous_id\"", + "name": "AnonymousId" + }, + { + "type": "\"bootstrap_feature_flag_details\"", + "name": "BootstrapFeatureFlagDetails" + }, + { + "type": "\"bootstrap_feature_flag_payloads\"", + "name": "BootstrapFeatureFlagPayloads" + }, + { + "type": "\"bootstrap_feature_flags\"", + "name": "BootstrapFeatureFlags" + }, + { + "type": "\"distinct_id\"", + "name": "DistinctId" + }, + { + "type": "\"feature_flag_details\"", + "name": "FeatureFlagDetails" + }, + { + "type": "\"feature_flag_payloads\"", + "name": "FeatureFlagPayloads" + }, + { + "type": "\"feature_flags\"", + "name": "FeatureFlags" + }, + { + "type": "\"flags_endpoint_was_hit\"", + "name": "FlagsEndpointWasHit" + }, + { + "type": "\"group_properties\"", + "name": "GroupProperties" + }, + { + "type": "\"installed_app_build\"", + "name": "InstalledAppBuild" + }, + { + "type": "\"installed_app_version\"", + "name": "InstalledAppVersion" + }, + { + "type": "\"opted_out\"", + "name": "OptedOut" + }, + { + "type": "\"override_feature_flags\"", + "name": "OverrideFeatureFlags" + }, + { + "type": "\"person_properties\"", + "name": "PersonProperties" + }, + { + "type": "\"props\"", + "name": "Props" + }, + { + "type": "\"queue\"", + "name": "Queue" + }, + { + "type": "\"remote_config\"", + "name": "RemoteConfig" + }, + { + "type": "\"session_id\"", + "name": "SessionId" + }, + { + "type": "\"session_timestamp\"", + "name": "SessionLastTimestamp" + }, + { + "type": "\"session_replay\"", + "name": "SessionReplay" + }, + { + "type": "\"session_start_timestamp\"", + "name": "SessionStartTimestamp" + }, + { + "type": "\"survey_last_seen_date\"", + "name": "SurveyLastSeenDate" }, { - "type": "Record", - "name": "properties" + "type": "\"surveys\"", + "name": "Surveys" }, { - "type": "string", - "name": "sessionId" + "type": "\"surveys_seen\"", + "name": "SurveysSeen" } ], - "path": "src/extensions/context/types.ts" + "path": "../core/src/types.ts" }, { - "id": "ContextOptions", - "name": "ContextOptions", - "properties": [ - { - "description": "If true, replaces the current context entirely. If false, merges with the existing context (new values override existing ones). false", - "type": "boolean", - "name": "fresh" - } - ], - "path": "src/extensions/context/types.ts" + "id": "PostHogRemoteConfig", + "name": "PostHogRemoteConfig", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n sessionRecording?: boolean | {\n [key: string]: JsonType;\n };\n supportedCompression?: Compression[];\n surveys?: boolean | Survey[];\n hasFeatureFlags?: boolean;\n}" }, { - "id": "EventMessage", - "name": "EventMessage", + "id": "PrimitiveType", + "name": "PrimitiveType", + "properties": [], + "path": "../core/src/error-tracking/coercers/primitive-coercer.ts", + "example": "null | undefined | boolean | number | string | symbol | bigint" + }, + { + "id": "PropertyGroup", + "name": "PropertyGroup", "properties": [], "path": "src/types.ts", - "example": "Omit & {\n distinctId?: string;\n event: string;\n groups?: Record;\n sendFeatureFlags?: boolean | SendFeatureFlagsOptions;\n timestamp?: Date;\n uuid?: string;\n}" + "example": "{\n type: 'AND' | 'OR';\n values: PropertyGroup[] | FlagProperty[];\n}" }, { - "id": "ExpressErrorMiddleware", - "name": "ExpressErrorMiddleware", + "id": "RatingSurveyQuestion", + "name": "RatingSurveyQuestion", "properties": [], - "path": "src/extensions/express.ts", - "example": "(error: MiddlewareError, req: Request, res: Response, next: (error: MiddlewareError) => void) => void" + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Rating;\n display: SurveyRatingDisplay;\n scale: 3 | 5 | 7 | 10;\n lowerBoundLabel: string;\n upperBoundLabel: string;\n}" }, { - "id": "ExpressMiddleware", - "name": "ExpressMiddleware", + "id": "ResponseBasedBranching", + "name": "ResponseBasedBranching", "properties": [], - "path": "src/extensions/express.ts", - "example": "(req: Request, res: Response, next: () => void) => void" + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.ResponseBased;\n responseValues: Record;\n}" }, { - "id": "FeatureFlagCondition", - "name": "FeatureFlagCondition", + "id": "RetriableOptions", + "name": "RetriableOptions", + "properties": [ + { + "type": "(err: unknown) => boolean", + "name": "retryCheck" + }, + { + "type": "number", + "name": "retryCount" + }, + { + "type": "number", + "name": "retryDelay" + } + ], + "path": "../core/src/utils/index.ts" + }, + { + "id": "SendFeatureFlagsOptions", + "name": "SendFeatureFlagsOptions", "properties": [], "path": "src/types.ts", - "example": "{\n properties: FlagProperty[];\n rollout_percentage?: number;\n variant?: string;\n}" + "example": "{\n onlyEvaluateLocally?: boolean;\n personProperties?: Record;\n groupProperties?: Record>;\n flagKeys?: string[];\n}" }, { - "id": "FeatureFlagErrorType", - "name": "FeatureFlagErrorType", + "id": "SentryIntegrationOptions", + "name": "SentryIntegrationOptions", "properties": [], - "path": "src/types.ts", - "example": "(typeof FeatureFlagError)[keyof typeof FeatureFlagError] | string" + "path": "src/extensions/sentry-integration.ts", + "example": "{\n organization?: string;\n projectId?: number;\n prefix?: string;\n severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n sendExceptionsToPostHog?: boolean;\n}" }, { - "id": "FeatureFlagOverrideOptions", - "name": "FeatureFlagOverrideOptions", + "id": "SeverityLevel", + "name": "SeverityLevel", "properties": [], - "path": "src/types.ts", - "example": "{\n flags?: false | string[] | Record;\n payloads?: false | Record;\n}" + "path": "../core/src/error-tracking/types.ts", + "example": "(typeof severityLevels)[number]" }, { - "id": "FlagDefinitionCacheData", - "name": "FlagDefinitionCacheData", + "id": "SpecificQuestionBranching", + "name": "SpecificQuestionBranching", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.SpecificQuestion;\n index: number;\n}" + }, + { + "id": "StackFrame", + "name": "StackFrame", "properties": [ { - "description": "Cohort property groups for local evaluation", - "type": "Record", - "name": "cohorts" + "type": "string", + "name": "abs_path" }, { - "description": "Array of feature flag definitions", - "type": "PostHogFeatureFlag[]", - "name": "flags" + "type": "string", + "name": "addr_mode" }, { - "description": "Mapping of group type index to group name", - "type": "Record", - "name": "groupTypeMapping" + "type": "string", + "name": "chunk_id" + }, + { + "type": "number", + "name": "colno" + }, + { + "type": "string", + "name": "context_line" + }, + { + "type": "string", + "name": "filename" + }, + { + "type": "string", + "name": "function" + }, + { + "type": "boolean", + "name": "in_app" + }, + { + "type": "string", + "name": "instruction_addr" + }, + { + "type": "number", + "name": "lineno" + }, + { + "type": "string", + "name": "module" + }, + { + "type": "Platform", + "name": "platform" + }, + { + "type": "string[]", + "name": "post_context" + }, + { + "type": "string[]", + "name": "pre_context" + }, + { + "type": "{\n [key: string]: JsonType;\n }", + "name": "vars" } ], - "path": "src/extensions/feature-flags/cache.ts" + "path": "../core/src/error-tracking/types.ts" }, { - "id": "FlagDefinitionCacheProvider", - "name": "FlagDefinitionCacheProvider", + "id": "StackFrameModifierFn", + "name": "StackFrameModifierFn", "properties": [], - "path": "src/extensions/feature-flags/cache.ts" + "path": "../core/src/error-tracking/types.ts", + "example": "(frames: StackFrame[]) => Promise" }, { - "id": "FlagProperty", - "name": "FlagProperty", + "id": "StackLineParser", + "name": "StackLineParser", "properties": [], - "path": "src/types.ts", - "example": "{\n key: string;\n type?: string;\n value: FlagPropertyValue;\n operator?: string;\n negation?: boolean;\n dependency_chain?: string[];\n}" + "path": "../core/src/error-tracking/types.ts", + "example": "(line: string, platform: Platform) => StackFrame | undefined" }, { - "id": "FlagPropertyValue", - "name": "FlagPropertyValue", + "id": "StackParser", + "name": "StackParser", "properties": [], - "path": "src/types.ts", - "example": "string | number | (string | number)[] | boolean" + "path": "../core/src/error-tracking/types.ts", + "example": "(stack: string, skipFirstLines?: number) => StackFrame[]" }, { - "id": "GroupIdentifyMessage", - "name": "GroupIdentifyMessage", + "id": "Survey", + "name": "Survey", "properties": [], - "path": "src/types.ts", - "example": "{\n groupType: string;\n groupKey: string;\n properties?: Record;\n distinctId?: string;\n disableGeoip?: boolean;\n}" + "path": "../core/src/types.ts", + "example": "{\n id: string;\n name: string;\n description?: string;\n type: SurveyType;\n feature_flag_keys?: {\n key: string;\n value?: string;\n }[];\n linked_flag_key?: string;\n targeting_flag_key?: string;\n internal_targeting_flag_key?: string;\n questions: SurveyQuestion[];\n appearance?: SurveyAppearance;\n conditions?: {\n url?: string;\n selector?: string;\n seenSurveyWaitPeriodInDays?: number;\n urlMatchType?: SurveyMatchType;\n events?: {\n repeatedActivation?: boolean;\n values?: {\n name: string;\n }[];\n };\n actions?: {\n values: SurveyActionType[];\n };\n deviceTypes?: string[];\n deviceTypesMatchType?: SurveyMatchType;\n linkedFlagVariant?: string;\n };\n start_date?: string;\n end_date?: string;\n current_iteration?: number;\n current_iteration_start_date?: string;\n}" }, { - "id": "IdentifyMessage", - "name": "IdentifyMessage", + "id": "SurveyActionType", + "name": "SurveyActionType", "properties": [], - "path": "src/types.ts", - "example": "{\n distinctId: string;\n properties?: Record;\n disableGeoip?: boolean;\n}" + "path": "../core/src/types.ts", + "example": "{\n id: number;\n name?: string;\n steps?: ActionStepType[];\n}" }, { - "id": "IPostHog", - "name": "IPostHog", + "id": "SurveyAppearance", + "name": "SurveyAppearance", "properties": [], - "path": "src/types.ts" + "path": "../core/src/types.ts", + "example": "{\n backgroundColor?: string;\n textColor?: string;\n submitButtonColor?: string;\n submitButtonText?: string;\n submitButtonTextColor?: string;\n ratingButtonColor?: string;\n ratingButtonActiveColor?: string;\n inputBackground?: string;\n inputTextColor?: string;\n autoDisappear?: boolean;\n displayThankYouMessage?: boolean;\n thankYouMessageHeader?: string;\n thankYouMessageDescription?: string;\n thankYouMessageDescriptionContentType?: SurveyQuestionDescriptionContentType;\n thankYouMessageCloseButtonText?: string;\n borderColor?: string;\n position?: SurveyPosition;\n placeholder?: string;\n shuffleQuestions?: boolean;\n surveyPopupDelaySeconds?: number;\n widgetType?: SurveyWidgetType;\n widgetSelector?: string;\n widgetLabel?: string;\n widgetColor?: string;\n}" }, { - "id": "IPostHogContext", - "name": "IPostHogContext", - "properties": [], - "path": "src/extensions/context/types.ts" + "id": "SurveyMatchType", + "name": "SurveyMatchType", + "properties": [ + { + "type": "\"exact\"", + "name": "Exact" + }, + { + "type": "\"icontains\"", + "name": "Icontains" + }, + { + "type": "\"is_not\"", + "name": "IsNot" + }, + { + "type": "\"not_icontains\"", + "name": "NotIcontains" + }, + { + "type": "\"not_regex\"", + "name": "NotRegex" + }, + { + "type": "\"regex\"", + "name": "Regex" + } + ], + "path": "../core/src/types.ts" }, { - "id": "MiddlewareError", - "name": "MiddlewareError", + "id": "SurveyPosition", + "name": "SurveyPosition", "properties": [ { - "type": "{\n statusCode?: number | string;\n }", - "name": "output" + "type": "\"center\"", + "name": "Center" }, { - "type": "number | string", - "name": "status_code" + "type": "\"left\"", + "name": "Left" }, { - "type": "number | string", - "name": "status" + "type": "\"middle_center\"", + "name": "MiddleCenter" }, { - "type": "number | string", - "name": "statusCode" + "type": "\"middle_left\"", + "name": "MiddleLeft" + }, + { + "type": "\"middle_right\"", + "name": "MiddleRight" + }, + { + "type": "\"right\"", + "name": "Right" + }, + { + "type": "\"top_center\"", + "name": "TopCenter" + }, + { + "type": "\"top_left\"", + "name": "TopLeft" + }, + { + "type": "\"top_right\"", + "name": "TopRight" } ], - "path": "src/extensions/express.ts" + "path": "../core/src/types.ts" }, { - "id": "OverrideFeatureFlagsOptions", - "name": "OverrideFeatureFlagsOptions", + "id": "SurveyQuestion", + "name": "SurveyQuestion", "properties": [], - "path": "src/types.ts", - "example": "false | string[] | Record | FeatureFlagOverrideOptions" + "path": "../core/src/types.ts", + "example": "BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion" }, { - "id": "PostHogFeatureFlag", - "name": "PostHogFeatureFlag", + "id": "SurveyQuestionBase", + "name": "SurveyQuestionBase", "properties": [], - "path": "src/types.ts", - "example": "{\n id: number;\n name: string;\n key: string;\n filters?: {\n aggregation_group_type_index?: number;\n groups?: FeatureFlagCondition[];\n multivariate?: {\n variants: {\n key: string;\n rollout_percentage: number;\n }[];\n };\n payloads?: Record;\n };\n deleted: boolean;\n active: boolean;\n rollout_percentage: null | number;\n ensure_experience_continuity: boolean;\n experiment_set: number[];\n}" + "path": "../core/src/types.ts", + "example": "{\n question: string;\n id: string;\n description?: string;\n descriptionContentType?: SurveyQuestionDescriptionContentType;\n optional?: boolean;\n buttonText?: string;\n originalQuestionIndex: number;\n branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n}" }, { - "id": "PostHogOptions", - "name": "PostHogOptions", - "properties": [], - "path": "src/types.ts", - "example": "PostHogCoreOptions & {\n persistence?: 'memory';\n personalApiKey?: string;\n privacyMode?: boolean;\n enableExceptionAutocapture?: boolean;\n featureFlagsPollingInterval?: number;\n maxCacheSize?: number;\n fetch?: (url: string, options: PostHogFetchOptions) => Promise;\n enableLocalEvaluation?: boolean;\n flagDefinitionCacheProvider?: FlagDefinitionCacheProvider;\n before_send?: BeforeSendFn | BeforeSendFn[];\n evaluationEnvironments?: readonly string[];\n custom_blocked_useragents?: string[];\n __preview_capture_bot_pageviews?: boolean;\n}" + "id": "SurveyQuestionBranchingType", + "name": "SurveyQuestionBranchingType", + "properties": [ + { + "type": "\"end\"", + "name": "End" + }, + { + "type": "\"next_question\"", + "name": "NextQuestion" + }, + { + "type": "\"response_based\"", + "name": "ResponseBased" + }, + { + "type": "\"specific_question\"", + "name": "SpecificQuestion" + } + ], + "path": "../core/src/types.ts" }, { - "id": "PropertyGroup", - "name": "PropertyGroup", - "properties": [], - "path": "src/types.ts", - "example": "{\n type: 'AND' | 'OR';\n values: PropertyGroup[] | FlagProperty[];\n}" + "id": "SurveyQuestionDescriptionContentType", + "name": "SurveyQuestionDescriptionContentType", + "properties": [ + { + "type": "\"html\"", + "name": "Html" + }, + { + "type": "\"text\"", + "name": "Text" + } + ], + "path": "../core/src/types.ts" }, { - "id": "SendFeatureFlagsOptions", - "name": "SendFeatureFlagsOptions", - "properties": [], - "path": "src/types.ts", - "example": "{\n onlyEvaluateLocally?: boolean;\n personProperties?: Record;\n groupProperties?: Record>;\n flagKeys?: string[];\n}" + "id": "SurveyQuestionType", + "name": "SurveyQuestionType", + "properties": [ + { + "type": "\"link\"", + "name": "Link" + }, + { + "type": "\"multiple_choice\"", + "name": "MultipleChoice" + }, + { + "type": "\"open\"", + "name": "Open" + }, + { + "type": "\"rating\"", + "name": "Rating" + }, + { + "type": "\"single_choice\"", + "name": "SingleChoice" + } + ], + "path": "../core/src/types.ts" }, { - "id": "SentryIntegrationOptions", - "name": "SentryIntegrationOptions", + "id": "SurveyRatingDisplay", + "name": "SurveyRatingDisplay", + "properties": [ + { + "type": "\"emoji\"", + "name": "Emoji" + }, + { + "type": "\"number\"", + "name": "Number" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "SurveyResponse", + "name": "SurveyResponse", "properties": [], - "path": "src/extensions/sentry-integration.ts", - "example": "{\n organization?: string;\n projectId?: number;\n prefix?: string;\n severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n sendExceptionsToPostHog?: boolean;\n}" + "path": "../core/src/types.ts", + "example": "{\n surveys: Survey[];\n}" + }, + { + "id": "SurveyType", + "name": "SurveyType", + "properties": [ + { + "type": "\"api\"", + "name": "API" + }, + { + "type": "\"external_survey\"", + "name": "ExternalSurvey" + }, + { + "type": "\"popover\"", + "name": "Popover" + }, + { + "type": "\"widget\"", + "name": "Widget" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "SurveyWidgetType", + "name": "SurveyWidgetType", + "properties": [ + { + "type": "\"button\"", + "name": "Button" + }, + { + "type": "\"selector\"", + "name": "Selector" + }, + { + "type": "\"tab\"", + "name": "Tab" + } + ], + "path": "../core/src/types.ts" } ], "categories": [ diff --git a/packages/node/references/posthog-node-references-latest.json b/packages/node/references/posthog-node-references-latest.json index 491cd312a2..dbe3561fbf 100644 --- a/packages/node/references/posthog-node-references-latest.json +++ b/packages/node/references/posthog-node-references-latest.json @@ -1134,270 +1134,2211 @@ "name": "T" }, "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "addPendingPromise", + "showDocs": true, + "title": "addPendingPromise", + "examples": [ + { + "id": "addpendingpromise", + "name": "Generated example for addPendingPromise", + "code": "// Generated example for addPendingPromise\nposthog.addPendingPromise();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "Promise", + "name": "promise" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "aliasStateless", + "showDocs": true, + "title": "aliasStateless", + "examples": [ + { + "id": "aliasstateless", + "name": "Generated example for aliasStateless", + "code": "// Generated example for aliasStateless\nposthog.aliasStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "alias" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "aliasStatelessImmediate", + "showDocs": true, + "title": "aliasStatelessImmediate", + "examples": [ + { + "id": "aliasstatelessimmediate", + "name": "Generated example for aliasStatelessImmediate", + "code": "// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "alias" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "captureStateless", + "showDocs": true, + "title": "captureStateless", + "examples": [ + { + "id": "capturestateless", + "name": "Generated example for captureStateless", + "code": "// Generated example for captureStateless\nposthog.captureStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "event" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "captureStatelessImmediate", + "showDocs": true, + "title": "captureStatelessImmediate", + "examples": [ + { + "id": "capturestatelessimmediate", + "name": "Generated example for captureStatelessImmediate", + "code": "// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "event" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** QUEUEING AND FLUSHING *", + "details": null, + "id": "enqueue", + "showDocs": true, + "title": "enqueue", + "examples": [ + { + "id": "enqueue", + "name": "Generated example for enqueue", + "code": "// Generated example for enqueue\nposthog.enqueue();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "type" + }, + { + "description": "", + "isOptional": false, + "type": "any", + "name": "_message" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "fetch", + "showDocs": true, + "title": "fetch", + "examples": [ + { + "id": "fetch", + "name": "Generated example for fetch", + "code": "// Generated example for fetch\nposthog.fetch();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "url" + }, + { + "description": "", + "isOptional": false, + "type": "PostHogFetchOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "Initialization", + "description": "Flushes the queue of pending events.\nThis function will return a promise that will resolve when the flush is complete, or reject if there was an error (for example if the server or network is down).\nIf there is already a flush in progress, this function will wait for that flush to complete.\nIt's recommended to do error handling in the callback of the promise.", + "details": null, + "id": "flush", + "showDocs": true, + "title": "flush", + "examples": [ + { + "id": "flush_with_error_handling", + "name": "flush with error handling", + "code": "\n\n// flush with error handling\nposthog.flush().then(() => {\n console.log('Flush complete')\n}).catch((err) => {\n console.error('Flush failed', err)\n})\n\n\n" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getCommonEventProperties", + "showDocs": true, + "title": "getCommonEventProperties", + "examples": [ + { + "id": "getcommoneventproperties", + "name": "Generated example for getCommonEventProperties", + "code": "// Generated example for getCommonEventProperties\nposthog.getCommonEventProperties();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "PostHogEventProperties", + "name": "PostHogEventProperties" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getCustomHeaders", + "showDocs": true, + "title": "getCustomHeaders", + "examples": [ + { + "id": "getcustomheaders", + "name": "Generated example for getCustomHeaders", + "code": "// Generated example for getCustomHeaders\nposthog.getCustomHeaders();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "{\n [key: string]: string;\n }", + "name": "{\n [key: string]: string;\n }" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagDetailsStateless", + "showDocs": true, + "title": "getFeatureFlagDetailsStateless", + "examples": [ + { + "id": "getfeatureflagdetailsstateless", + "name": "Generated example for getFeatureFlagDetailsStateless", + "code": "// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagDetailStateless", + "showDocs": true, + "title": "getFeatureFlagDetailStateless", + "examples": [ + { + "id": "getfeatureflagdetailstateless", + "name": "Generated example for getFeatureFlagDetailStateless", + "code": "// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "key" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + } + ], + "returnType": { + "id": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>", + "name": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagPayloadsStateless", + "showDocs": true, + "title": "getFeatureFlagPayloadsStateless", + "examples": [ + { + "id": "getfeatureflagpayloadsstateless", + "name": "Generated example for getFeatureFlagPayloadsStateless", + "code": "// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagPayloadStateless", + "showDocs": true, + "title": "getFeatureFlagPayloadStateless", + "examples": [ + { + "id": "getfeatureflagpayloadstateless", + "name": "Generated example for getFeatureFlagPayloadStateless", + "code": "// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "key" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagsAndPayloadsStateless", + "showDocs": true, + "title": "getFeatureFlagsAndPayloadsStateless", + "examples": [ + { + "id": "getfeatureflagsandpayloadsstateless", + "name": "Generated example for getFeatureFlagsAndPayloadsStateless", + "code": "// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", + "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagsStateless", + "showDocs": true, + "title": "getFeatureFlagsStateless", + "examples": [ + { + "id": "getfeatureflagsstateless", + "name": "Generated example for getFeatureFlagsStateless", + "code": "// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", + "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagStateless", + "showDocs": true, + "title": "getFeatureFlagStateless", + "examples": [ + { + "id": "getfeatureflagstateless", + "name": "Generated example for getFeatureFlagStateless", + "code": "// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "key" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + } + ], + "returnType": { + "id": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>", + "name": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** FEATURE FLAGS *", + "details": null, + "id": "getFlags", + "showDocs": true, + "title": "getFlags", + "examples": [ + { + "id": "getflags", + "name": "Generated example for getFlags", + "code": "// Generated example for getFlags\nposthog.getFlags();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "extraPayload" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "fetchConfig" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getRemoteConfig", + "showDocs": true, + "title": "getRemoteConfig", + "examples": [ + { + "id": "getremoteconfig", + "name": "Generated example for getRemoteConfig", + "code": "// Generated example for getRemoteConfig\nposthog.getRemoteConfig();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** SURVEYS *", + "details": null, + "id": "getSurveysStateless", + "showDocs": true, + "title": "getSurveysStateless", + "examples": [ + { + "id": "getsurveysstateless", + "name": "Generated example for getSurveysStateless", + "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** GROUPS *", + "details": null, + "id": "groupIdentifyStateless", + "showDocs": true, + "title": "groupIdentifyStateless", + "examples": [ + { + "id": "groupidentifystateless", + "name": "Generated example for groupIdentifyStateless", + "code": "// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "groupType" + }, + { + "description": "", + "isOptional": false, + "type": "string | number", + "name": "groupKey" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + }, + { + "description": "", + "isOptional": true, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "eventProperties" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** TRACKING *", + "details": null, + "id": "identifyStateless", + "showDocs": true, + "title": "identifyStateless", + "examples": [ + { + "id": "identifystateless", + "name": "Generated example for identifyStateless", + "code": "// Generated example for identifyStateless\nposthog.identifyStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "identifyStatelessImmediate", + "showDocs": true, + "title": "identifyStatelessImmediate", + "examples": [ + { + "id": "identifystatelessimmediate", + "name": "Generated example for identifyStatelessImmediate", + "code": "// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "logMsgIfDebug", + "showDocs": true, + "title": "logMsgIfDebug", + "examples": [ + { + "id": "logmsgifdebug", + "name": "Generated example for logMsgIfDebug", + "code": "// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "() => void", + "name": "fn" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "on", + "showDocs": true, + "title": "on", + "examples": [ + { + "id": "on", + "name": "Generated example for on", + "code": "// Generated example for on\nposthog.on();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "event" + }, + { + "description": "", + "isOptional": false, + "type": "(...args: any[]) => void", + "name": "cb" + } + ], + "returnType": { + "id": "() => void", + "name": "() => void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "optIn", + "showDocs": true, + "title": "optIn", + "examples": [ + { + "id": "optin", + "name": "Generated example for optIn", + "code": "// Generated example for optIn\nposthog.optIn();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "optOut", + "showDocs": true, + "title": "optOut", + "examples": [ + { + "id": "optout", + "name": "Generated example for optOut", + "code": "// Generated example for optOut\nposthog.optOut();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "register", + "showDocs": true, + "title": "register", + "examples": [ + { + "id": "register", + "name": "Generated example for register", + "code": "// Generated example for register\nposthog.register();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "PostHogEventProperties", + "name": "properties" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "sendImmediate", + "showDocs": true, + "title": "sendImmediate", + "examples": [ + { + "id": "sendimmediate", + "name": "Generated example for sendImmediate", + "code": "// Generated example for sendImmediate\nposthog.sendImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "type" + }, + { + "description": "", + "isOptional": false, + "type": "any", + "name": "_message" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "Initialization", + "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", + "details": null, + "id": "shutdown", + "showDocs": true, + "title": "shutdown", + "examples": [ + { + "id": "shutdown_before_process_exit", + "name": "shutdown before process exit", + "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "Maximum time to wait for shutdown in milliseconds", + "isOptional": true, + "type": "number", + "name": "shutdownTimeoutMs" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "unregister", + "showDocs": true, + "title": "unregister", + "examples": [ + { + "id": "unregister", + "name": "Generated example for unregister", + "code": "// Generated example for unregister\nposthog.unregister();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "property" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "wrap", + "showDocs": true, + "title": "wrap", + "examples": [ + { + "id": "wrap", + "name": "Generated example for wrap", + "code": "// Generated example for wrap\nposthog.wrap();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "() => void", + "name": "fn" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + } + ] + } + ], + "types": [ + { + "id": "_SentryEvent", + "name": "_SentryEvent", + "properties": [], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryEventProcessor", + "name": "_SentryEventProcessor", + "properties": [], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryHub", + "name": "_SentryHub", + "properties": [], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryIntegration", + "name": "_SentryIntegration", + "properties": [ + { + "type": "string", + "name": "name" + } + ], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryIntegrationClass", + "name": "_SentryIntegrationClass", + "properties": [ + { + "type": "string", + "name": "name" + } + ], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "ActionStepStringMatching", + "name": "ActionStepStringMatching", + "properties": [ + { + "type": "\"contains\"", + "name": "Contains" + }, + { + "type": "\"exact\"", + "name": "Exact" + }, + { + "type": "\"regex\"", + "name": "Regex" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "ActionStepType", + "name": "ActionStepType", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n event?: string;\n selector?: string;\n text?: string;\n text_matching?: ActionStepStringMatching;\n href?: string;\n href_matching?: ActionStepStringMatching;\n url?: string;\n url_matching?: ActionStepStringMatching;\n}" + }, + { + "id": "BaseException", + "name": "BaseException", + "properties": [ + { + "type": "boolean", + "name": "synthetic" + }, + { + "type": "string", + "name": "type" + }, + { + "type": "string", + "name": "value" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "BasicSurveyQuestion", + "name": "BasicSurveyQuestion", + "properties": [], + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Open;\n}" + }, + { + "id": "BeforeSendFn", + "name": "BeforeSendFn", + "properties": [], + "path": "src/types.ts", + "example": "(event: EventMessage | null) => EventMessage | null" + }, + { + "id": "ChunkIdMapType", + "name": "ChunkIdMapType", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "Record" + }, + { + "id": "Coercer", + "name": "Coercer", + "properties": [], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "CoercingContext", + "name": "CoercingContext", + "properties": [ + { + "type": "(input: unknown) => ExceptionLike", + "name": "apply" + }, + { + "type": "(input: unknown) => ExceptionLike | undefined", + "name": "next" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "Compression", + "name": "Compression", + "properties": [ + { + "type": "\"base64\"", + "name": "Base64" + }, + { + "type": "\"gzip-js\"", + "name": "GZipJS" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "ContextData", + "name": "ContextData", + "properties": [ + { + "type": "string", + "name": "distinctId" + }, + { + "type": "Record", + "name": "properties" + }, + { + "type": "string", + "name": "sessionId" + } + ], + "path": "src/extensions/context/types.ts" + }, + { + "id": "ContextOptions", + "name": "ContextOptions", + "properties": [ + { + "description": "If true, replaces the current context entirely. If false, merges with the existing context (new values override existing ones). false", + "type": "boolean", + "name": "fresh" } - ] - } - ], - "types": [ + ], + "path": "src/extensions/context/types.ts" + }, { - "id": "_SentryEvent", - "name": "_SentryEvent", + "id": "EndBranching", + "name": "EndBranching", "properties": [], - "path": "src/extensions/sentry-integration.ts" + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.End;\n}" }, { - "id": "_SentryEventProcessor", - "name": "_SentryEventProcessor", + "id": "ErrorProperties", + "name": "ErrorProperties", + "properties": [ + { + "type": "SeverityLevel", + "name": "$exception_level" + }, + { + "type": "Exception[]", + "name": "$exception_list" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ErrorTrackingCoercer", + "name": "ErrorTrackingCoercer", "properties": [], - "path": "src/extensions/sentry-integration.ts" + "path": "../core/src/error-tracking/types.ts", + "example": "Coercer" }, { - "id": "_SentryHub", - "name": "_SentryHub", + "id": "EvaluationReason", + "name": "EvaluationReason", "properties": [], - "path": "src/extensions/sentry-integration.ts" + "path": "../core/src/types.ts", + "example": "{\n code: string | undefined;\n condition_index: number | undefined;\n description: string | undefined;\n}" }, { - "id": "_SentryIntegration", - "name": "_SentryIntegration", + "id": "EventHint", + "name": "EventHint", "properties": [ { - "type": "string", - "name": "name" + "type": "Partial", + "name": "mechanism" + }, + { + "type": "Error | null", + "name": "syntheticException" } ], - "path": "src/extensions/sentry-integration.ts" + "path": "../core/src/error-tracking/types.ts" }, { - "id": "_SentryIntegrationClass", - "name": "_SentryIntegrationClass", + "id": "EventMessage", + "name": "EventMessage", + "properties": [], + "path": "src/types.ts", + "example": "Omit & {\n distinctId?: string;\n event: string;\n groups?: Record;\n sendFeatureFlags?: boolean | SendFeatureFlagsOptions;\n timestamp?: Date;\n uuid?: string;\n _originatedFromCaptureException?: boolean;\n}" + }, + { + "id": "ExpressErrorMiddleware", + "name": "ExpressErrorMiddleware", + "properties": [], + "path": "src/extensions/express.ts", + "example": "(error: MiddlewareError, req: Request, res: Response, next: (error: MiddlewareError) => void) => void" + }, + { + "id": "ExpressMiddleware", + "name": "ExpressMiddleware", + "properties": [], + "path": "src/extensions/express.ts", + "example": "(req: Request, res: Response, next: () => void) => void" + }, + { + "id": "FeatureFlagBucketingIdentifier", + "name": "FeatureFlagBucketingIdentifier", + "properties": [], + "path": "src/types.ts", + "example": "\"distinct_id\" | \"device_id\"" + }, + { + "id": "FeatureFlagDetail", + "name": "FeatureFlagDetail", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n reason: EvaluationReason | undefined;\n metadata: FeatureFlagMetadata | undefined;\n}" + }, + { + "id": "FeatureFlagBucketingIdentifier", + "name": "FeatureFlagBucketingIdentifier", + "properties": [], + "path": "src/types.ts", + "example": "\"distinct_id\" | \"device_id\"" + }, + { + "id": "FeatureFlagCondition", + "name": "FeatureFlagCondition", + "properties": [], + "path": "src/types.ts", + "example": "{\n properties: FlagProperty[];\n rollout_percentage?: number;\n variant?: string;\n}" + }, + { + "id": "FeatureFlagOverrideOptions", + "name": "FeatureFlagOverrideOptions", + "properties": [], + "path": "src/types.ts", + "example": "{\n flags?: false | string[] | Record;\n payloads?: false | Record;\n}" + }, + { + "id": "FeatureFlagResult", + "name": "FeatureFlagResult", + "properties": [], + "path": "src/types.ts", + "example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n payload: JsonType | undefined;\n}" + }, + { + "id": "FlagDefinitionCacheData", + "name": "FlagDefinitionCacheData", "properties": [ { - "type": "string", - "name": "name" + "description": "Cohort property groups for local evaluation", + "type": "Record", + "name": "cohorts" + }, + { + "description": "Array of feature flag definitions", + "type": "PostHogFeatureFlag[]", + "name": "flags" + }, + { + "description": "Mapping of group type index to group name", + "type": "Record", + "name": "groupTypeMapping" } ], - "path": "src/extensions/sentry-integration.ts" + "path": "src/extensions/feature-flags/cache.ts" }, { - "id": "BeforeSendFn", - "name": "BeforeSendFn", + "id": "FlagDefinitionCacheProvider", + "name": "FlagDefinitionCacheProvider", + "properties": [], + "path": "src/extensions/feature-flags/cache.ts" + }, + { + "id": "FlagProperty", + "name": "FlagProperty", "properties": [], "path": "src/types.ts", - "example": "(event: EventMessage | null) => EventMessage | null" + "example": "{\n key: string;\n type?: string;\n value: FlagPropertyValue;\n operator?: string;\n negation?: boolean;\n dependency_chain?: string[];\n}" }, { - "id": "ContextData", - "name": "ContextData", + "id": "FlagPropertyValue", + "name": "FlagPropertyValue", + "properties": [], + "path": "src/types.ts", + "example": "string | number | (string | number)[] | boolean" + }, + { + "id": "GetModuleFn", + "name": "GetModuleFn", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "(filename: string | undefined) => string | undefined" + }, + { + "id": "GroupIdentifyMessage", + "name": "GroupIdentifyMessage", + "properties": [], + "path": "src/types.ts", + "example": "{\n groupType: string;\n groupKey: string;\n properties?: Record;\n distinctId?: string;\n disableGeoip?: boolean;\n}" + }, + { + "id": "IdentifyMessage", + "name": "IdentifyMessage", + "properties": [], + "path": "src/types.ts", + "example": "{\n distinctId: string;\n properties?: Record;\n disableGeoip?: boolean;\n}" + }, + { + "id": "IPostHog", + "name": "IPostHog", + "properties": [], + "path": "src/types.ts" + }, + { + "id": "IPostHogContext", + "name": "IPostHogContext", + "properties": [], + "path": "src/extensions/context/types.ts" + }, + { + "id": "JsonType", + "name": "JsonType", + "properties": [], + "path": "../core/src/types.ts", + "example": "string | number | boolean | null | {\n [key: string]: JsonType;\n} | Array | JsonType[]" + }, + { + "id": "LinkSurveyQuestion", + "name": "LinkSurveyQuestion", + "properties": [], + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Link;\n link?: string;\n}" + }, + { + "id": "Logger", + "name": "Logger", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n info: (...args: any[]) => void;\n warn: (...args: any[]) => void;\n error: (...args: any[]) => void;\n critical: (...args: any[]) => void;\n createLogger: (prefix: string) => Logger;\n}" + }, + { + "id": "Mechanism", + "name": "Mechanism", "properties": [ + { + "type": "boolean", + "name": "handled" + }, { "type": "string", - "name": "distinctId" + "name": "source" }, { - "type": "Record", - "name": "properties" + "type": "boolean", + "name": "synthetic" }, { - "type": "string", - "name": "sessionId" + "type": "'generic' | 'onunhandledrejection' | 'onuncaughtexception' | 'onconsole' | 'middleware'", + "name": "type" } ], - "path": "src/extensions/context/types.ts" + "path": "../core/src/error-tracking/types.ts" }, { - "id": "ContextOptions", - "name": "ContextOptions", + "id": "MiddlewareError", + "name": "MiddlewareError", "properties": [ { - "description": "If true, replaces the current context entirely. If false, merges with the existing context (new values override existing ones). false", - "type": "boolean", - "name": "fresh" + "type": "{\n statusCode?: number | string;\n }", + "name": "output" + }, + { + "type": "number | string", + "name": "status_code" + }, + { + "type": "number | string", + "name": "status" + }, + { + "type": "number | string", + "name": "statusCode" } ], - "path": "src/extensions/context/types.ts" + "path": "src/extensions/express.ts" + }, + { + "id": "MultipleSurveyQuestion", + "name": "MultipleSurveyQuestion", + "properties": [], + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n choices: string[];\n hasOpenChoice?: boolean;\n shuffleOptions?: boolean;\n}" + }, + { + "id": "NextQuestionBranching", + "name": "NextQuestionBranching", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.NextQuestion;\n}" + }, + { + "id": "ObjectLike", + "name": "ObjectLike", + "properties": [], + "path": "../core/src/error-tracking/coercers/object-coercer.ts", + "example": "Record" + }, + { + "id": "OverrideFeatureFlagsOptions", + "name": "OverrideFeatureFlagsOptions", + "properties": [], + "path": "src/types.ts", + "example": "false | string[] | Record | FeatureFlagOverrideOptions" + }, + { + "id": "ParsedException", + "name": "ParsedException", + "properties": [ + { + "type": "ParsedException", + "name": "cause" + }, + { + "type": "StackFrame[]", + "name": "stack" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ParsingContext", + "name": "ParsingContext", + "properties": [ + { + "type": "ChunkIdMapType", + "name": "chunkIdMap" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "PartialWithRequired", + "name": "PartialWithRequired", + "properties": [], + "path": "../core/src/types.ts", + "example": "keyof T> = {\n [P in K]: T[P];\n} & {\n [P in Exclude]?: T[P];\n}" + }, + { + "id": "Platform", + "name": "Platform", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "\"node:javascript\" | \"web:javascript\" | \"hermes\"" + }, + { + "id": "PolymorphicEvent", + "name": "PolymorphicEvent", + "properties": [ + { + "type": "unknown", + "name": "currentTarget" + }, + { + "type": "unknown", + "name": "target" + }, + { + "type": "string", + "name": "type" + } + ], + "path": "../core/src/error-tracking/types.ts" }, { - "id": "EventMessage", - "name": "EventMessage", + "id": "PostHogCaptureOptions", + "name": "PostHogCaptureOptions", "properties": [], - "path": "src/types.ts", - "example": "Omit & {\n distinctId?: string;\n event: string;\n groups?: Record;\n sendFeatureFlags?: boolean | SendFeatureFlagsOptions;\n timestamp?: Date;\n uuid?: string;\n _originatedFromCaptureException?: boolean;\n}" + "path": "../core/src/types.ts", + "example": "{\n uuid?: string;\n timestamp?: Date;\n disableGeoip?: boolean;\n}" }, { - "id": "ExpressErrorMiddleware", - "name": "ExpressErrorMiddleware", + "id": "PostHogCoreOptions", + "name": "PostHogCoreOptions", "properties": [], - "path": "src/extensions/express.ts", - "example": "(error: MiddlewareError, req: Request, res: Response, next: (error: MiddlewareError) => void) => void" + "path": "../core/src/types.ts", + "example": "{\n host?: string;\n flushAt?: number;\n flushInterval?: number;\n maxBatchSize?: number;\n maxQueueSize?: number;\n disabled?: boolean;\n defaultOptIn?: boolean;\n sendFeatureFlagEvent?: boolean;\n preloadFeatureFlags?: boolean;\n disableRemoteConfig?: boolean;\n disableSurveys?: boolean;\n bootstrap?: {\n distinctId?: string;\n isIdentifiedId?: boolean;\n featureFlags?: Record;\n featureFlagPayloads?: Record;\n };\n fetchRetryCount?: number;\n fetchRetryDelay?: number;\n requestTimeout?: number;\n featureFlagsRequestTimeoutMs?: number;\n remoteConfigRequestTimeoutMs?: number;\n sessionExpirationTimeSeconds?: number;\n disableCompression?: boolean;\n disableGeoip?: boolean;\n historicalMigration?: boolean;\n evaluationEnvironments?: readonly string[];\n}" }, { - "id": "ExpressMiddleware", - "name": "ExpressMiddleware", + "id": "PostHogEventProperties", + "name": "PostHogEventProperties", "properties": [], - "path": "src/extensions/express.ts", - "example": "(req: Request, res: Response, next: () => void) => void" + "path": "../core/src/types.ts", + "example": "{\n [key: string]: JsonType;\n}" }, { - "id": "FeatureFlagBucketingIdentifier", - "name": "FeatureFlagBucketingIdentifier", + "id": "PostHogFeatureFlag", + "name": "PostHogFeatureFlag", "properties": [], "path": "src/types.ts", - "example": "\"distinct_id\" | \"device_id\"" + "example": "{\n id: number;\n name: string;\n key: string;\n bucketing_identifier?: FeatureFlagBucketingIdentifier;\n filters?: {\n aggregation_group_type_index?: number;\n groups?: FeatureFlagCondition[];\n multivariate?: {\n variants: {\n key: string;\n rollout_percentage: number;\n }[];\n };\n payloads?: Record;\n };\n deleted: boolean;\n active: boolean;\n rollout_percentage: null | number;\n ensure_experience_continuity: boolean;\n experiment_set: number[];\n}" }, { - "id": "FeatureFlagCondition", - "name": "FeatureFlagCondition", + "id": "PostHogOptions", + "name": "PostHogOptions", "properties": [], "path": "src/types.ts", - "example": "{\n properties: FlagProperty[];\n rollout_percentage?: number;\n variant?: string;\n}" + "example": "Omit & {\n persistence?: 'memory';\n personalApiKey?: string;\n privacyMode?: boolean;\n enableExceptionAutocapture?: boolean;\n featureFlagsPollingInterval?: number;\n maxCacheSize?: number;\n fetch?: (url: string, options: PostHogFetchOptions) => Promise;\n enableLocalEvaluation?: boolean;\n flagDefinitionCacheProvider?: FlagDefinitionCacheProvider;\n before_send?: BeforeSendFn | BeforeSendFn[];\n evaluationContexts?: readonly string[];\n evaluationEnvironments?: readonly string[];\n custom_blocked_useragents?: string[];\n __preview_capture_bot_pageviews?: boolean;\n strictLocalEvaluation?: boolean;\n}" }, { - "id": "FeatureFlagOverrideOptions", - "name": "FeatureFlagOverrideOptions", + "id": "PropertyGroup", + "name": "PropertyGroup", "properties": [], "path": "src/types.ts", - "example": "{\n flags?: false | string[] | Record;\n payloads?: false | Record;\n}" + "example": "{\n type: 'AND' | 'OR';\n values: PropertyGroup[] | FlagProperty[];\n}" }, { - "id": "FeatureFlagResult", - "name": "FeatureFlagResult", + "id": "RatingSurveyQuestion", + "name": "RatingSurveyQuestion", "properties": [], - "path": "src/types.ts", - "example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n payload: JsonType | undefined;\n}" + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Rating;\n display: SurveyRatingDisplay;\n scale: 3 | 5 | 7 | 10;\n lowerBoundLabel: string;\n upperBoundLabel: string;\n}" }, { - "id": "FlagDefinitionCacheData", - "name": "FlagDefinitionCacheData", + "id": "ResponseBasedBranching", + "name": "ResponseBasedBranching", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.ResponseBased;\n responseValues: Record;\n}" + }, + { + "id": "RetriableOptions", + "name": "RetriableOptions", "properties": [ { - "description": "Cohort property groups for local evaluation", - "type": "Record", - "name": "cohorts" + "type": "(err: unknown) => boolean", + "name": "retryCheck" }, { - "description": "Array of feature flag definitions", - "type": "PostHogFeatureFlag[]", - "name": "flags" + "type": "number", + "name": "retryCount" }, { - "description": "Mapping of group type index to group name", - "type": "Record", - "name": "groupTypeMapping" + "type": "number", + "name": "retryDelay" } ], - "path": "src/extensions/feature-flags/cache.ts" + "path": "../core/src/utils/index.ts" }, { - "id": "FlagDefinitionCacheProvider", - "name": "FlagDefinitionCacheProvider", + "id": "SendFeatureFlagsOptions", + "name": "SendFeatureFlagsOptions", "properties": [], - "path": "src/extensions/feature-flags/cache.ts" + "path": "src/types.ts", + "example": "{\n onlyEvaluateLocally?: boolean;\n personProperties?: Record;\n groupProperties?: Record>;\n flagKeys?: string[];\n}" }, { - "id": "FlagProperty", - "name": "FlagProperty", + "id": "SentryIntegrationOptions", + "name": "SentryIntegrationOptions", "properties": [], - "path": "src/types.ts", - "example": "{\n key: string;\n type?: string;\n value: FlagPropertyValue;\n operator?: string;\n negation?: boolean;\n dependency_chain?: string[];\n}" + "path": "src/extensions/sentry-integration.ts", + "example": "{\n organization?: string;\n projectId?: number;\n prefix?: string;\n severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n sendExceptionsToPostHog?: boolean;\n}" }, { - "id": "FlagPropertyValue", - "name": "FlagPropertyValue", + "id": "SeverityLevel", + "name": "SeverityLevel", "properties": [], - "path": "src/types.ts", - "example": "string | number | (string | number)[] | boolean" + "path": "../core/src/error-tracking/types.ts", + "example": "(typeof severityLevels)[number]" }, { - "id": "GroupIdentifyMessage", - "name": "GroupIdentifyMessage", + "id": "SpecificQuestionBranching", + "name": "SpecificQuestionBranching", "properties": [], - "path": "src/types.ts", - "example": "{\n groupType: string;\n groupKey: string;\n properties?: Record;\n distinctId?: string;\n disableGeoip?: boolean;\n}" + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.SpecificQuestion;\n index: number;\n}" }, { - "id": "IdentifyMessage", - "name": "IdentifyMessage", + "id": "StackFrame", + "name": "StackFrame", + "properties": [ + { + "type": "string", + "name": "abs_path" + }, + { + "type": "string", + "name": "addr_mode" + }, + { + "type": "string", + "name": "chunk_id" + }, + { + "type": "number", + "name": "colno" + }, + { + "type": "string", + "name": "context_line" + }, + { + "type": "string", + "name": "filename" + }, + { + "type": "string", + "name": "function" + }, + { + "type": "boolean", + "name": "in_app" + }, + { + "type": "string", + "name": "instruction_addr" + }, + { + "type": "number", + "name": "lineno" + }, + { + "type": "string", + "name": "module" + }, + { + "type": "Platform", + "name": "platform" + }, + { + "type": "string[]", + "name": "post_context" + }, + { + "type": "string[]", + "name": "pre_context" + }, + { + "type": "{\n [key: string]: JsonType;\n }", + "name": "vars" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "StackFrameModifierFn", + "name": "StackFrameModifierFn", "properties": [], - "path": "src/types.ts", - "example": "{\n distinctId: string;\n properties?: Record;\n disableGeoip?: boolean;\n}" + "path": "../core/src/error-tracking/types.ts", + "example": "(frames: StackFrame[]) => Promise" }, { - "id": "IPostHog", - "name": "IPostHog", + "id": "StackLineParser", + "name": "StackLineParser", "properties": [], - "path": "src/types.ts" + "path": "../core/src/error-tracking/types.ts", + "example": "(line: string, platform: Platform) => StackFrame | undefined" }, { - "id": "IPostHogContext", - "name": "IPostHogContext", + "id": "StackParser", + "name": "StackParser", "properties": [], - "path": "src/extensions/context/types.ts" + "path": "../core/src/error-tracking/types.ts", + "example": "(stack: string, skipFirstLines?: number) => StackFrame[]" }, { - "id": "MiddlewareError", - "name": "MiddlewareError", + "id": "Survey", + "name": "Survey", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n id: string;\n name: string;\n description?: string;\n type: SurveyType;\n feature_flag_keys?: {\n key: string;\n value?: string;\n }[];\n linked_flag_key?: string;\n targeting_flag_key?: string;\n internal_targeting_flag_key?: string;\n questions: SurveyQuestion[];\n appearance?: SurveyAppearance;\n conditions?: {\n url?: string;\n selector?: string;\n seenSurveyWaitPeriodInDays?: number;\n urlMatchType?: SurveyMatchType;\n events?: {\n repeatedActivation?: boolean;\n values?: {\n name: string;\n }[];\n };\n actions?: {\n values: SurveyActionType[];\n };\n deviceTypes?: string[];\n deviceTypesMatchType?: SurveyMatchType;\n linkedFlagVariant?: string;\n };\n start_date?: string;\n end_date?: string;\n current_iteration?: number;\n current_iteration_start_date?: string;\n}" + }, + { + "id": "SurveyActionType", + "name": "SurveyActionType", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n id: number;\n name?: string;\n steps?: ActionStepType[];\n}" + }, + { + "id": "SurveyAppearance", + "name": "SurveyAppearance", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n backgroundColor?: string;\n textColor?: string;\n submitButtonColor?: string;\n submitButtonText?: string;\n submitButtonTextColor?: string;\n ratingButtonColor?: string;\n ratingButtonActiveColor?: string;\n inputBackground?: string;\n inputTextColor?: string;\n autoDisappear?: boolean;\n displayThankYouMessage?: boolean;\n thankYouMessageHeader?: string;\n thankYouMessageDescription?: string;\n thankYouMessageDescriptionContentType?: SurveyQuestionDescriptionContentType;\n thankYouMessageCloseButtonText?: string;\n borderColor?: string;\n position?: SurveyPosition;\n placeholder?: string;\n shuffleQuestions?: boolean;\n surveyPopupDelaySeconds?: number;\n widgetType?: SurveyWidgetType;\n widgetSelector?: string;\n widgetLabel?: string;\n widgetColor?: string;\n}" + }, + { + "id": "SurveyMatchType", + "name": "SurveyMatchType", "properties": [ { - "type": "{\n statusCode?: number | string;\n }", - "name": "output" + "type": "\"exact\"", + "name": "Exact" }, { - "type": "number | string", - "name": "status_code" + "type": "\"icontains\"", + "name": "Icontains" }, { - "type": "number | string", - "name": "status" + "type": "\"is_not\"", + "name": "IsNot" }, { - "type": "number | string", - "name": "statusCode" + "type": "\"not_icontains\"", + "name": "NotIcontains" + }, + { + "type": "\"not_regex\"", + "name": "NotRegex" + }, + { + "type": "\"regex\"", + "name": "Regex" } ], - "path": "src/extensions/express.ts" + "path": "../core/src/types.ts" }, { - "id": "OverrideFeatureFlagsOptions", - "name": "OverrideFeatureFlagsOptions", - "properties": [], - "path": "src/types.ts", - "example": "false | string[] | Record | FeatureFlagOverrideOptions" + "id": "SurveyPosition", + "name": "SurveyPosition", + "properties": [ + { + "type": "\"center\"", + "name": "Center" + }, + { + "type": "\"left\"", + "name": "Left" + }, + { + "type": "\"middle_center\"", + "name": "MiddleCenter" + }, + { + "type": "\"middle_left\"", + "name": "MiddleLeft" + }, + { + "type": "\"middle_right\"", + "name": "MiddleRight" + }, + { + "type": "\"right\"", + "name": "Right" + }, + { + "type": "\"top_center\"", + "name": "TopCenter" + }, + { + "type": "\"top_left\"", + "name": "TopLeft" + }, + { + "type": "\"top_right\"", + "name": "TopRight" + } + ], + "path": "../core/src/types.ts" }, { - "id": "PostHogFeatureFlag", - "name": "PostHogFeatureFlag", + "id": "SurveyQuestion", + "name": "SurveyQuestion", "properties": [], - "path": "src/types.ts", - "example": "{\n id: number;\n name: string;\n key: string;\n bucketing_identifier?: FeatureFlagBucketingIdentifier;\n filters?: {\n aggregation_group_type_index?: number;\n groups?: FeatureFlagCondition[];\n multivariate?: {\n variants: {\n key: string;\n rollout_percentage: number;\n }[];\n };\n payloads?: Record;\n };\n deleted: boolean;\n active: boolean;\n rollout_percentage: null | number;\n ensure_experience_continuity: boolean;\n experiment_set: number[];\n}" + "path": "../core/src/types.ts", + "example": "BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion" }, { - "id": "PostHogOptions", - "name": "PostHogOptions", + "id": "SurveyQuestionBase", + "name": "SurveyQuestionBase", "properties": [], - "path": "src/types.ts", - "example": "Omit & {\n persistence?: 'memory';\n personalApiKey?: string;\n privacyMode?: boolean;\n enableExceptionAutocapture?: boolean;\n featureFlagsPollingInterval?: number;\n maxCacheSize?: number;\n fetch?: (url: string, options: PostHogFetchOptions) => Promise;\n enableLocalEvaluation?: boolean;\n flagDefinitionCacheProvider?: FlagDefinitionCacheProvider;\n before_send?: BeforeSendFn | BeforeSendFn[];\n evaluationContexts?: readonly string[];\n evaluationEnvironments?: readonly string[];\n custom_blocked_useragents?: string[];\n __preview_capture_bot_pageviews?: boolean;\n strictLocalEvaluation?: boolean;\n}" + "path": "../core/src/types.ts", + "example": "{\n question: string;\n id: string;\n description?: string;\n descriptionContentType?: SurveyQuestionDescriptionContentType;\n optional?: boolean;\n buttonText?: string;\n originalQuestionIndex: number;\n branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n}" }, { - "id": "PropertyGroup", - "name": "PropertyGroup", - "properties": [], - "path": "src/types.ts", - "example": "{\n type: 'AND' | 'OR';\n values: PropertyGroup[] | FlagProperty[];\n}" + "id": "SurveyQuestionBranchingType", + "name": "SurveyQuestionBranchingType", + "properties": [ + { + "type": "\"end\"", + "name": "End" + }, + { + "type": "\"next_question\"", + "name": "NextQuestion" + }, + { + "type": "\"response_based\"", + "name": "ResponseBased" + }, + { + "type": "\"specific_question\"", + "name": "SpecificQuestion" + } + ], + "path": "../core/src/types.ts" }, { - "id": "SendFeatureFlagsOptions", - "name": "SendFeatureFlagsOptions", - "properties": [], - "path": "src/types.ts", - "example": "{\n onlyEvaluateLocally?: boolean;\n personProperties?: Record;\n groupProperties?: Record>;\n flagKeys?: string[];\n}" + "id": "SurveyQuestionDescriptionContentType", + "name": "SurveyQuestionDescriptionContentType", + "properties": [ + { + "type": "\"html\"", + "name": "Html" + }, + { + "type": "\"text\"", + "name": "Text" + } + ], + "path": "../core/src/types.ts" }, { - "id": "SentryIntegrationOptions", - "name": "SentryIntegrationOptions", + "id": "SurveyQuestionType", + "name": "SurveyQuestionType", + "properties": [ + { + "type": "\"link\"", + "name": "Link" + }, + { + "type": "\"multiple_choice\"", + "name": "MultipleChoice" + }, + { + "type": "\"open\"", + "name": "Open" + }, + { + "type": "\"rating\"", + "name": "Rating" + }, + { + "type": "\"single_choice\"", + "name": "SingleChoice" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "SurveyRatingDisplay", + "name": "SurveyRatingDisplay", + "properties": [ + { + "type": "\"emoji\"", + "name": "Emoji" + }, + { + "type": "\"number\"", + "name": "Number" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "SurveyResponse", + "name": "SurveyResponse", "properties": [], - "path": "src/extensions/sentry-integration.ts", - "example": "{\n organization?: string;\n projectId?: number;\n prefix?: string;\n severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n sendExceptionsToPostHog?: boolean;\n}" + "path": "../core/src/types.ts", + "example": "{\n surveys: Survey[];\n}" + }, + { + "id": "SurveyType", + "name": "SurveyType", + "properties": [ + { + "type": "\"api\"", + "name": "API" + }, + { + "type": "\"external_survey\"", + "name": "ExternalSurvey" + }, + { + "type": "\"popover\"", + "name": "Popover" + }, + { + "type": "\"widget\"", + "name": "Widget" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "SurveyWidgetType", + "name": "SurveyWidgetType", + "properties": [ + { + "type": "\"button\"", + "name": "Button" + }, + { + "type": "\"selector\"", + "name": "Selector" + }, + { + "type": "\"tab\"", + "name": "Tab" + } + ], + "path": "../core/src/types.ts" } ], "categories": [ diff --git a/packages/node/scripts/generate-docs.mjs b/packages/node/scripts/generate-docs.mjs index 6392bcbb17..780cda225e 100644 --- a/packages/node/scripts/generate-docs.mjs +++ b/packages/node/scripts/generate-docs.mjs @@ -37,9 +37,9 @@ const NODE_TYPE_EXAMPLES = { const __dirname = import.meta.dirname const config = { - packageDir: path.resolve(__dirname, '..'), // packages/node - apiJsonPath: path.resolve(__dirname, '../docs/posthog-node.api.json'), - outputPath: path.resolve(__dirname, `../references/posthog-node-references-${version}.json`), + packageDir: path.resolve(import.meta.dirname, '..'), // packages/node + apiJsonPath: path.resolve(import.meta.dirname, '../docs/posthog-node.api.json'), + outputPath: path.resolve(import.meta.dirname, `../references/posthog-node-references-${version}.json`), version: version, id: NODE_SPEC_INFO.id, hogRef: HOG_REF, diff --git a/scripts/docs/methods.js b/scripts/docs/methods.js index 885ff80252..6697a8e573 100644 --- a/scripts/docs/methods.js +++ b/scripts/docs/methods.js @@ -31,11 +31,12 @@ const isMethodDeprecated = hasDeprecatedBlock; /** * Collect all public methods from a class and its inheritance chain * @param {any} posthogClass - Starting class + * @param {string} rootClass - Root class name for constructor display * @returns {any[]} - Array of unique public methods */ const collectMethodsWithInheritance = (posthogClass, rootClass) => { if (!posthogClass) return []; - + const allMethods = new Map(); const apiPackage = posthogClass.getAssociatedPackage(); const inheritanceChain = getInheritanceChain(posthogClass, apiPackage); From fbbca4289c8ba5933c27c02da44e9b5e8a23ebc7 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 24 Feb 2026 12:08:52 -0500 Subject: [PATCH 2/5] Fix missing methods --- .../posthog-node-references-5.25.0.json | 2688 ++++++++++++++++- .../posthog-node-references-latest.json | 467 ++- 2 files changed, 2979 insertions(+), 176 deletions(-) diff --git a/packages/node/references/posthog-node-references-5.25.0.json b/packages/node/references/posthog-node-references-5.25.0.json index 491cd312a2..2d1bf04a3e 100644 --- a/packages/node/references/posthog-node-references-5.25.0.json +++ b/packages/node/references/posthog-node-references-5.25.0.json @@ -1134,270 +1134,2642 @@ "name": "T" }, "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "addPendingPromise", + "showDocs": true, + "title": "addPendingPromise", + "examples": [ + { + "id": "addpendingpromise", + "name": "Generated example for addPendingPromise", + "code": "// Generated example for addPendingPromise\nposthog.addPendingPromise();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "Promise", + "name": "promise" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "aliasStateless", + "showDocs": true, + "title": "aliasStateless", + "examples": [ + { + "id": "aliasstateless", + "name": "Generated example for aliasStateless", + "code": "// Generated example for aliasStateless\nposthog.aliasStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "alias" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "aliasStatelessImmediate", + "showDocs": true, + "title": "aliasStatelessImmediate", + "examples": [ + { + "id": "aliasstatelessimmediate", + "name": "Generated example for aliasStatelessImmediate", + "code": "// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "alias" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "captureStateless", + "showDocs": true, + "title": "captureStateless", + "examples": [ + { + "id": "capturestateless", + "name": "Generated example for captureStateless", + "code": "// Generated example for captureStateless\nposthog.captureStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "event" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "captureStatelessImmediate", + "showDocs": true, + "title": "captureStatelessImmediate", + "examples": [ + { + "id": "capturestatelessimmediate", + "name": "Generated example for captureStatelessImmediate", + "code": "// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "event" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "enqueue", + "showDocs": true, + "title": "enqueue", + "examples": [ + { + "id": "enqueue", + "name": "Generated example for enqueue", + "code": "// Generated example for enqueue\nposthog.enqueue();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "type" + }, + { + "description": "", + "isOptional": false, + "type": "any", + "name": "_message" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "fetch", + "showDocs": true, + "title": "fetch", + "examples": [ + { + "id": "fetch", + "name": "Generated example for fetch", + "code": "// Generated example for fetch\nposthog.fetch();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "url" + }, + { + "description": "", + "isOptional": false, + "type": "PostHogFetchOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "Initialization", + "description": "Flushes the queue of pending events.\nThis function will return a promise that will resolve when the flush is complete, or reject if there was an error (for example if the server or network is down).\nIf there is already a flush in progress, this function will wait for that flush to complete.\nIt's recommended to do error handling in the callback of the promise.", + "details": null, + "id": "flush", + "showDocs": true, + "title": "flush", + "examples": [ + { + "id": "flush_with_error_handling", + "name": "flush with error handling", + "code": "\n\n// flush with error handling\nposthog.flush().then(() => {\n console.log('Flush complete')\n}).catch((err) => {\n console.error('Flush failed', err)\n})\n\n\n" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "Hook that allows subclasses to wait for storage operations to complete. This is called after queue changes are persisted during flush to ensure data is safely written to storage before considering events as sent.\nOverride this in implementations with async storage (e.g., React Native) to prevent duplicate events on app crash/restart scenarios.", + "details": null, + "id": "flushStorage", + "showDocs": true, + "title": "flushStorage", + "examples": [ + { + "id": "flushstorage", + "name": "Generated example for flushStorage", + "code": "// Generated example for flushStorage\nposthog.flushStorage();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getCommonEventProperties", + "showDocs": true, + "title": "getCommonEventProperties", + "examples": [ + { + "id": "getcommoneventproperties", + "name": "Generated example for getCommonEventProperties", + "code": "// Generated example for getCommonEventProperties\nposthog.getCommonEventProperties();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "PostHogEventProperties", + "name": "PostHogEventProperties" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getCustomHeaders", + "showDocs": true, + "title": "getCustomHeaders", + "examples": [ + { + "id": "getcustomheaders", + "name": "Generated example for getCustomHeaders", + "code": "// Generated example for getCustomHeaders\nposthog.getCustomHeaders();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "{\n [key: string]: string;\n }", + "name": "{\n [key: string]: string;\n }" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagDetailsStateless", + "showDocs": true, + "title": "getFeatureFlagDetailsStateless", + "examples": [ + { + "id": "getfeatureflagdetailsstateless", + "name": "Generated example for getFeatureFlagDetailsStateless", + "code": "// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagDetailStateless", + "showDocs": true, + "title": "getFeatureFlagDetailStateless", + "examples": [ + { + "id": "getfeatureflagdetailstateless", + "name": "Generated example for getFeatureFlagDetailStateless", + "code": "// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "key" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + } + ], + "returnType": { + "id": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>", + "name": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagPayloadsStateless", + "showDocs": true, + "title": "getFeatureFlagPayloadsStateless", + "examples": [ + { + "id": "getfeatureflagpayloadsstateless", + "name": "Generated example for getFeatureFlagPayloadsStateless", + "code": "// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagPayloadStateless", + "showDocs": true, + "title": "getFeatureFlagPayloadStateless", + "examples": [ + { + "id": "getfeatureflagpayloadstateless", + "name": "Generated example for getFeatureFlagPayloadStateless", + "code": "// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "key" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagsAndPayloadsStateless", + "showDocs": true, + "title": "getFeatureFlagsAndPayloadsStateless", + "examples": [ + { + "id": "getfeatureflagsandpayloadsstateless", + "name": "Generated example for getFeatureFlagsAndPayloadsStateless", + "code": "// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", + "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagsStateless", + "showDocs": true, + "title": "getFeatureFlagsStateless", + "examples": [ + { + "id": "getfeatureflagsstateless", + "name": "Generated example for getFeatureFlagsStateless", + "code": "// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + }, + { + "description": "", + "isOptional": true, + "type": "string[]", + "name": "flagKeysToEvaluate" + } + ], + "returnType": { + "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", + "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getFeatureFlagStateless", + "showDocs": true, + "title": "getFeatureFlagStateless", + "examples": [ + { + "id": "getfeatureflagstateless", + "name": "Generated example for getFeatureFlagStateless", + "code": "// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "key" + }, + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "disableGeoip" + } + ], + "returnType": { + "id": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>", + "name": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** FEATURE FLAGS *", + "details": null, + "id": "getFlags", + "showDocs": true, + "title": "getFlags", + "examples": [ + { + "id": "getflags", + "name": "Generated example for getFlags", + "code": "// Generated example for getFlags\nposthog.getFlags();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "groups" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "personProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record>", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "Record", + "name": "extraPayload" + }, + { + "description": "", + "isOptional": true, + "type": "boolean", + "name": "fetchConfig" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "getRemoteConfig", + "showDocs": true, + "title": "getRemoteConfig", + "examples": [ + { + "id": "getremoteconfig", + "name": "Generated example for getRemoteConfig", + "code": "// Generated example for getRemoteConfig\nposthog.getRemoteConfig();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** SURVEYS *", + "details": null, + "id": "getSurveysStateless", + "showDocs": true, + "title": "getSurveysStateless", + "examples": [ + { + "id": "getsurveysstateless", + "name": "Generated example for getSurveysStateless", + "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** GROUPS *", + "details": null, + "id": "groupIdentifyStateless", + "showDocs": true, + "title": "groupIdentifyStateless", + "examples": [ + { + "id": "groupidentifystateless", + "name": "Generated example for groupIdentifyStateless", + "code": "// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "groupType" + }, + { + "description": "", + "isOptional": false, + "type": "string | number", + "name": "groupKey" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "groupProperties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + }, + { + "description": "", + "isOptional": true, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "eventProperties" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "* ** TRACKING *", + "details": null, + "id": "identifyStateless", + "showDocs": true, + "title": "identifyStateless", + "examples": [ + { + "id": "identifystateless", + "name": "Generated example for identifyStateless", + "code": "// Generated example for identifyStateless\nposthog.identifyStateless();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "identifyStatelessImmediate", + "showDocs": true, + "title": "identifyStatelessImmediate", + "examples": [ + { + "id": "identifystatelessimmediate", + "name": "Generated example for identifyStatelessImmediate", + "code": "// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "distinctId" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogEventProperties", + "name": "properties" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "logMsgIfDebug", + "showDocs": true, + "title": "logMsgIfDebug", + "examples": [ + { + "id": "logmsgifdebug", + "name": "Generated example for logMsgIfDebug", + "code": "// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "() => void", + "name": "fn" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "on", + "showDocs": true, + "title": "on", + "examples": [ + { + "id": "on", + "name": "Generated example for on", + "code": "// Generated example for on\nposthog.on();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "event" + }, + { + "description": "", + "isOptional": false, + "type": "(...args: any[]) => void", + "name": "cb" + } + ], + "returnType": { + "id": "() => void", + "name": "() => void" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "optIn", + "showDocs": true, + "title": "optIn", + "examples": [ + { + "id": "optin", + "name": "Generated example for optIn", + "code": "// Generated example for optIn\nposthog.optIn();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "optOut", + "showDocs": true, + "title": "optOut", + "examples": [ + { + "id": "optout", + "name": "Generated example for optOut", + "code": "// Generated example for optOut\nposthog.optOut();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "prepareMessage", + "showDocs": true, + "title": "prepareMessage", + "examples": [ + { + "id": "preparemessage", + "name": "Generated example for prepareMessage", + "code": "// Generated example for prepareMessage\nposthog.prepareMessage();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "type" + }, + { + "description": "", + "isOptional": false, + "type": "any", + "name": "_message" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "PostHogEventProperties", + "name": "PostHogEventProperties" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "Hook that allows subclasses to transform or filter a message before it's queued. Return null to drop the message.", + "details": null, + "id": "processBeforeEnqueue", + "showDocs": true, + "title": "processBeforeEnqueue", + "examples": [ + { + "id": "processbeforeenqueue", + "name": "Generated example for processBeforeEnqueue", + "code": "// Generated example for processBeforeEnqueue\nposthog.processBeforeEnqueue();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "The prepared message", + "isOptional": false, + "type": "PostHogEventProperties", + "name": "message" + } + ], + "returnType": { + "id": "PostHogEventProperties | null", + "name": "PostHogEventProperties | null" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "register", + "showDocs": true, + "title": "register", + "examples": [ + { + "id": "register", + "name": "Generated example for register", + "code": "// Generated example for register\nposthog.register();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "PostHogEventProperties", + "name": "properties" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "sendImmediate", + "showDocs": true, + "title": "sendImmediate", + "examples": [ + { + "id": "sendimmediate", + "name": "Generated example for sendImmediate", + "code": "// Generated example for sendImmediate\nposthog.sendImmediate();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "type" + }, + { + "description": "", + "isOptional": false, + "type": "any", + "name": "_message" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "Initialization", + "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", + "details": null, + "id": "shutdown", + "showDocs": true, + "title": "shutdown", + "examples": [ + { + "id": "shutdown_before_process_exit", + "name": "shutdown before process exit", + "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "Maximum time to wait for shutdown in milliseconds", + "isOptional": true, + "type": "number", + "name": "shutdownTimeoutMs" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "unregister", + "showDocs": true, + "title": "unregister", + "examples": [ + { + "id": "unregister", + "name": "Generated example for unregister", + "code": "// Generated example for unregister\nposthog.unregister();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "property" + } + ], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "details": null, + "id": "wrap", + "showDocs": true, + "title": "wrap", + "examples": [ + { + "id": "wrap", + "name": "Generated example for wrap", + "code": "// Generated example for wrap\nposthog.wrap();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "() => void", + "name": "fn" + } + ], + "returnType": { + "id": "void", + "name": "void" + }, + "path": "src/entrypoints/index.node.ts" + } + ] + } + ], + "types": [ + { + "id": "_SentryEvent", + "name": "_SentryEvent", + "properties": [], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryEventProcessor", + "name": "_SentryEventProcessor", + "properties": [], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryHub", + "name": "_SentryHub", + "properties": [], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryIntegration", + "name": "_SentryIntegration", + "properties": [ + { + "type": "string", + "name": "name" + } + ], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryIntegrationClass", + "name": "_SentryIntegrationClass", + "properties": [ + { + "type": "string", + "name": "name" + } + ], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "ActionStepStringMatching", + "name": "ActionStepStringMatching", + "properties": [ + { + "type": "\"contains\"", + "name": "Contains" + }, + { + "type": "\"exact\"", + "name": "Exact" + }, + { + "type": "\"regex\"", + "name": "Regex" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "ActionStepType", + "name": "ActionStepType", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n event?: string;\n selector?: string;\n text?: string;\n text_matching?: ActionStepStringMatching;\n href?: string;\n href_matching?: ActionStepStringMatching;\n url?: string;\n url_matching?: ActionStepStringMatching;\n}" + }, + { + "id": "BaseException", + "name": "BaseException", + "properties": [ + { + "type": "boolean", + "name": "synthetic" + }, + { + "type": "string", + "name": "type" + }, + { + "type": "string", + "name": "value" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "BasicSurveyQuestion", + "name": "BasicSurveyQuestion", + "properties": [], + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Open;\n}" + }, + { + "id": "BeforeSendFn_2", + "name": "BeforeSendFn_2", + "properties": [], + "path": "../core/src/types.ts", + "example": "(event: CaptureEvent | null) => CaptureEvent | null" + }, + { + "id": "BeforeSendFn", + "name": "BeforeSendFn", + "properties": [], + "path": "src/types.ts", + "example": "(event: EventMessage | null) => EventMessage | null" + }, + { + "id": "CaptureEvent", + "name": "CaptureEvent", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n uuid?: string;\n event: string;\n properties?: PostHogEventProperties;\n $set?: PostHogEventProperties;\n $set_once?: PostHogEventProperties;\n timestamp?: Date;\n}" + }, + { + "id": "ChunkIdMapType", + "name": "ChunkIdMapType", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "Record" + }, + { + "id": "Coercer", + "name": "Coercer", + "properties": [], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "CoercingContext", + "name": "CoercingContext", + "properties": [ + { + "type": "(input: unknown) => ExceptionLike", + "name": "apply" + }, + { + "type": "(input: unknown) => ExceptionLike | undefined", + "name": "next" } - ] - } - ], - "types": [ + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "Compression", + "name": "Compression", + "properties": [ + { + "type": "\"base64\"", + "name": "Base64" + }, + { + "type": "\"gzip-js\"", + "name": "GZipJS" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "ContextData", + "name": "ContextData", + "properties": [ + { + "type": "string", + "name": "distinctId" + }, + { + "type": "Record", + "name": "properties" + }, + { + "type": "string", + "name": "sessionId" + } + ], + "path": "src/extensions/context/types.ts" + }, + { + "id": "ContextOptions", + "name": "ContextOptions", + "properties": [ + { + "description": "If true, replaces the current context entirely. If false, merges with the existing context (new values override existing ones). false", + "type": "boolean", + "name": "fresh" + } + ], + "path": "src/extensions/context/types.ts" + }, + { + "id": "EndBranching", + "name": "EndBranching", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.End;\n}" + }, + { + "id": "ErrorProperties", + "name": "ErrorProperties", + "properties": [ + { + "type": "SeverityLevel", + "name": "$exception_level" + }, + { + "type": "Exception[]", + "name": "$exception_list" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ErrorTrackingCoercer", + "name": "ErrorTrackingCoercer", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "Coercer" + }, + { + "id": "EvaluationReason", + "name": "EvaluationReason", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n code: string | undefined;\n condition_index: number | undefined;\n description: string | undefined;\n}" + }, + { + "id": "EventHint", + "name": "EventHint", + "properties": [ + { + "type": "Partial", + "name": "mechanism" + }, + { + "type": "number", + "name": "skipFirstLines" + }, + { + "type": "Error | null", + "name": "syntheticException" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "EventMessage", + "name": "EventMessage", + "properties": [], + "path": "src/types.ts", + "example": "Omit & {\n distinctId?: string;\n event: string;\n groups?: Record;\n sendFeatureFlags?: boolean | SendFeatureFlagsOptions;\n timestamp?: Date;\n uuid?: string;\n _originatedFromCaptureException?: boolean;\n}" + }, + { + "id": "Exception", + "name": "Exception", + "properties": [ + { + "type": "Mechanism", + "name": "mechanism" + }, + { + "type": "string", + "name": "module" + }, + { + "type": "{\n frames?: StackFrame[];\n type: 'raw';\n }", + "name": "stacktrace" + }, + { + "type": "number", + "name": "thread_id" + }, + { + "type": "string", + "name": "type" + }, + { + "type": "string", + "name": "value" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ExceptionLike", + "name": "ExceptionLike", + "properties": [ + { + "type": "ExceptionLike", + "name": "cause" + }, + { + "type": "SeverityLevel", + "name": "level" + }, + { + "type": "string", + "name": "stack" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ExceptionList", + "name": "ExceptionList", + "properties": [], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ExpressErrorMiddleware", + "name": "ExpressErrorMiddleware", + "properties": [], + "path": "src/extensions/express.ts", + "example": "(error: MiddlewareError, req: Request, res: Response, next: (error: MiddlewareError) => void) => void" + }, + { + "id": "ExpressMiddleware", + "name": "ExpressMiddleware", + "properties": [], + "path": "src/extensions/express.ts", + "example": "(req: Request, res: Response, next: () => void) => void" + }, + { + "id": "FeatureFlagBucketingIdentifier", + "name": "FeatureFlagBucketingIdentifier", + "properties": [], + "path": "src/types.ts", + "example": "\"distinct_id\" | \"device_id\"" + }, + { + "id": "FeatureFlagCondition", + "name": "FeatureFlagCondition", + "properties": [], + "path": "src/types.ts", + "example": "{\n properties: FlagProperty[];\n rollout_percentage?: number;\n variant?: string;\n}" + }, + { + "id": "FeatureFlagDetail", + "name": "FeatureFlagDetail", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n reason: EvaluationReason | undefined;\n metadata: FeatureFlagMetadata | undefined;\n failed?: boolean;\n}" + }, + { + "id": "FeatureFlagErrorType", + "name": "FeatureFlagErrorType", + "properties": [], + "path": "../core/src/types.ts", + "example": "\"apiError\"" + }, + { + "id": "FeatureFlagMetadata", + "name": "FeatureFlagMetadata", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n id: number | undefined;\n version: number | undefined;\n description: string | undefined;\n payload: string | undefined;\n}" + }, + { + "id": "FeatureFlagOverrideOptions", + "name": "FeatureFlagOverrideOptions", + "properties": [], + "path": "src/types.ts", + "example": "{\n flags?: false | string[] | Record;\n payloads?: false | Record;\n}" + }, + { + "id": "FeatureFlagRequestError", + "name": "FeatureFlagRequestError", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n type: 'timeout' | 'connection_error' | 'api_error' | 'unknown_error';\n statusCode?: number;\n}" + }, + { + "id": "FeatureFlagResult", + "name": "FeatureFlagResult", + "properties": [], + "path": "src/types.ts", + "example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n payload: JsonType | undefined;\n}" + }, + { + "id": "FeatureFlagValue", + "name": "FeatureFlagValue", + "properties": [], + "path": "../core/src/types.ts", + "example": "string | boolean" + }, + { + "id": "FlagDefinitionCacheData", + "name": "FlagDefinitionCacheData", + "properties": [ + { + "description": "Cohort property groups for local evaluation", + "type": "Record", + "name": "cohorts" + }, + { + "description": "Array of feature flag definitions", + "type": "PostHogFeatureFlag[]", + "name": "flags" + }, + { + "description": "Mapping of group type index to group name", + "type": "Record", + "name": "groupTypeMapping" + } + ], + "path": "src/extensions/feature-flags/cache.ts" + }, + { + "id": "FlagDefinitionCacheProvider", + "name": "FlagDefinitionCacheProvider", + "properties": [], + "path": "src/extensions/feature-flags/cache.ts" + }, + { + "id": "FlagProperty", + "name": "FlagProperty", + "properties": [], + "path": "src/types.ts", + "example": "{\n key: string;\n type?: string;\n value: FlagPropertyValue;\n operator?: string;\n negation?: boolean;\n dependency_chain?: string[];\n}" + }, + { + "id": "FlagPropertyValue", + "name": "FlagPropertyValue", + "properties": [], + "path": "src/types.ts", + "example": "string | number | (string | number)[] | boolean" + }, + { + "id": "GetFlagsResult", + "name": "GetFlagsResult", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n success: true;\n response: PostHogFeatureFlagsResponse;\n} | {\n success: false;\n error: FeatureFlagRequestError;\n}" + }, + { + "id": "GetModuleFn", + "name": "GetModuleFn", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "(filename: string | undefined) => string | undefined" + }, + { + "id": "GroupIdentifyMessage", + "name": "GroupIdentifyMessage", + "properties": [], + "path": "src/types.ts", + "example": "{\n groupType: string;\n groupKey: string;\n properties?: Record;\n distinctId?: string;\n disableGeoip?: boolean;\n}" + }, + { + "id": "IdentifyMessage", + "name": "IdentifyMessage", + "properties": [], + "path": "src/types.ts", + "example": "{\n distinctId: string;\n properties?: Record;\n disableGeoip?: boolean;\n}" + }, { - "id": "_SentryEvent", - "name": "_SentryEvent", + "id": "IPostHog", + "name": "IPostHog", "properties": [], - "path": "src/extensions/sentry-integration.ts" + "path": "src/types.ts" }, { - "id": "_SentryEventProcessor", - "name": "_SentryEventProcessor", + "id": "IPostHogContext", + "name": "IPostHogContext", "properties": [], - "path": "src/extensions/sentry-integration.ts" + "path": "src/extensions/context/types.ts" }, { - "id": "_SentryHub", - "name": "_SentryHub", + "id": "JsonType", + "name": "JsonType", "properties": [], - "path": "src/extensions/sentry-integration.ts" + "path": "../core/src/types.ts", + "example": "string | number | boolean | null | {\n [key: string]: JsonType;\n} | Array | JsonType[]" }, { - "id": "_SentryIntegration", - "name": "_SentryIntegration", + "id": "LinkSurveyQuestion", + "name": "LinkSurveyQuestion", + "properties": [], + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Link;\n link?: string;\n}" + }, + { + "id": "Logger", + "name": "Logger", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n info: (...args: any[]) => void;\n warn: (...args: any[]) => void;\n error: (...args: any[]) => void;\n critical: (...args: any[]) => void;\n createLogger: (prefix: string) => Logger;\n}" + }, + { + "id": "Mechanism", + "name": "Mechanism", "properties": [ + { + "type": "boolean", + "name": "handled" + }, { "type": "string", - "name": "name" + "name": "source" + }, + { + "type": "boolean", + "name": "synthetic" + }, + { + "type": "'generic' | 'onunhandledrejection' | 'onuncaughtexception' | 'onconsole' | 'middleware'", + "name": "type" } ], - "path": "src/extensions/sentry-integration.ts" + "path": "../core/src/error-tracking/types.ts" }, { - "id": "_SentryIntegrationClass", - "name": "_SentryIntegrationClass", + "id": "MiddlewareError", + "name": "MiddlewareError", + "properties": [ + { + "type": "{\n statusCode?: number | string;\n }", + "name": "output" + }, + { + "type": "number | string", + "name": "status_code" + }, + { + "type": "number | string", + "name": "status" + }, + { + "type": "number | string", + "name": "statusCode" + } + ], + "path": "src/extensions/express.ts" + }, + { + "id": "MultipleSurveyQuestion", + "name": "MultipleSurveyQuestion", + "properties": [], + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n choices: string[];\n hasOpenChoice?: boolean;\n shuffleOptions?: boolean;\n skipSubmitButton?: boolean;\n}" + }, + { + "id": "NextQuestionBranching", + "name": "NextQuestionBranching", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.NextQuestion;\n}" + }, + { + "id": "ObjectLike", + "name": "ObjectLike", + "properties": [], + "path": "../core/src/error-tracking/coercers/object-coercer.ts", + "example": "Record" + }, + { + "id": "OverrideFeatureFlagsOptions", + "name": "OverrideFeatureFlagsOptions", + "properties": [], + "path": "src/types.ts", + "example": "false | string[] | Record | FeatureFlagOverrideOptions" + }, + { + "id": "ParsedException", + "name": "ParsedException", + "properties": [ + { + "type": "ParsedException", + "name": "cause" + }, + { + "type": "StackFrame[]", + "name": "stack" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ParsingContext", + "name": "ParsingContext", + "properties": [ + { + "type": "ChunkIdMapType", + "name": "chunkIdMap" + }, + { + "type": "number", + "name": "skipFirstLines" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "PartialWithRequired", + "name": "PartialWithRequired", + "properties": [], + "path": "../core/src/types.ts", + "example": "keyof T> = {\n [P in K]: T[P];\n} & {\n [P in Exclude]?: T[P];\n}" + }, + { + "id": "Platform", + "name": "Platform", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "\"node:javascript\" | \"web:javascript\" | \"hermes\"" + }, + { + "id": "PolymorphicEvent", + "name": "PolymorphicEvent", "properties": [ + { + "type": "unknown", + "name": "currentTarget" + }, + { + "type": "unknown", + "name": "target" + }, { "type": "string", - "name": "name" + "name": "type" } ], - "path": "src/extensions/sentry-integration.ts" + "path": "../core/src/error-tracking/types.ts" }, { - "id": "BeforeSendFn", - "name": "BeforeSendFn", + "id": "PostHogCaptureOptions", + "name": "PostHogCaptureOptions", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n uuid?: string;\n timestamp?: Date;\n disableGeoip?: boolean;\n _originatedFromCaptureException?: boolean;\n}" + }, + { + "id": "PostHogCoreOptions", + "name": "PostHogCoreOptions", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n host?: string;\n flushAt?: number;\n flushInterval?: number;\n maxBatchSize?: number;\n maxQueueSize?: number;\n disabled?: boolean;\n defaultOptIn?: boolean;\n sendFeatureFlagEvent?: boolean;\n preloadFeatureFlags?: boolean;\n disableRemoteConfig?: boolean;\n disableSurveys?: boolean;\n bootstrap?: {\n distinctId?: string;\n isIdentifiedId?: boolean;\n featureFlags?: Record;\n featureFlagPayloads?: Record;\n };\n fetchRetryCount?: number;\n fetchRetryDelay?: number;\n requestTimeout?: number;\n featureFlagsRequestTimeoutMs?: number;\n remoteConfigRequestTimeoutMs?: number;\n sessionExpirationTimeSeconds?: number;\n disableCompression?: boolean;\n disableGeoip?: boolean;\n historicalMigration?: boolean;\n evaluationContexts?: readonly string[];\n evaluationEnvironments?: readonly string[];\n personProfiles?: 'always' | 'identified_only' | 'never';\n before_send?: BeforeSendFn | BeforeSendFn[];\n}" + }, + { + "id": "PostHogEventProperties", + "name": "PostHogEventProperties", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n [key: string]: JsonType;\n}" + }, + { + "id": "PostHogFeatureFlag", + "name": "PostHogFeatureFlag", "properties": [], "path": "src/types.ts", - "example": "(event: EventMessage | null) => EventMessage | null" + "example": "{\n id: number;\n name: string;\n key: string;\n bucketing_identifier?: FeatureFlagBucketingIdentifier;\n filters?: {\n aggregation_group_type_index?: number;\n groups?: FeatureFlagCondition[];\n multivariate?: {\n variants: {\n key: string;\n rollout_percentage: number;\n }[];\n };\n payloads?: Record;\n };\n deleted: boolean;\n active: boolean;\n rollout_percentage: null | number;\n ensure_experience_continuity: boolean;\n experiment_set: number[];\n}" + }, + { + "id": "PostHogFeatureFlagDetails", + "name": "PostHogFeatureFlagDetails", + "properties": [], + "path": "../core/src/types.ts", + "example": "\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\"" + }, + { + "id": "PostHogFeatureFlagsResponse", + "name": "PostHogFeatureFlagsResponse", + "properties": [], + "path": "../core/src/types.ts", + "example": "\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\"" + }, + { + "id": "PostHogFetchOptions", + "name": "PostHogFetchOptions", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n method: 'GET' | 'POST' | 'PUT' | 'PATCH';\n mode?: 'no-cors';\n credentials?: 'omit';\n headers: {\n [key: string]: string;\n };\n body?: string | Blob;\n signal?: AbortSignal;\n}" + }, + { + "id": "PostHogFetchResponse", + "name": "PostHogFetchResponse", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n status: number;\n text: () => Promise;\n json: () => Promise;\n headers?: {\n get(name: string): string | null;\n };\n}" + }, + { + "id": "PostHogFlagsAndPayloadsResponse", + "name": "PostHogFlagsAndPayloadsResponse", + "properties": [], + "path": "../core/src/types.ts", + "example": "\"featureFlags\" | \"featureFlagPayloads\"" + }, + { + "id": "PostHogFlagsResponse", + "name": "PostHogFlagsResponse", + "properties": [], + "path": "../core/src/types.ts", + "example": "Omit & {\n featureFlags: {\n [key: string]: FeatureFlagValue;\n };\n featureFlagPayloads: {\n [key: string]: JsonType;\n };\n flags: {\n [key: string]: FeatureFlagDetail;\n };\n errorsWhileComputingFlags: boolean;\n sessionRecording?: boolean | {\n [key: string]: JsonType;\n };\n quotaLimited?: string[];\n requestId?: string;\n evaluatedAt?: number;\n}" + }, + { + "id": "PostHogOptions", + "name": "PostHogOptions", + "properties": [], + "path": "src/types.ts", + "example": "Omit & {\n persistence?: 'memory';\n personalApiKey?: string;\n privacyMode?: boolean;\n enableExceptionAutocapture?: boolean;\n featureFlagsPollingInterval?: number;\n maxCacheSize?: number;\n fetch?: (url: string, options: PostHogFetchOptions) => Promise;\n enableLocalEvaluation?: boolean;\n flagDefinitionCacheProvider?: FlagDefinitionCacheProvider;\n before_send?: BeforeSendFn | BeforeSendFn[];\n evaluationContexts?: readonly string[];\n evaluationEnvironments?: readonly string[];\n custom_blocked_useragents?: string[];\n __preview_capture_bot_pageviews?: boolean;\n strictLocalEvaluation?: boolean;\n}" + }, + { + "id": "PostHogPersistedProperty", + "name": "PostHogPersistedProperty", + "properties": [ + { + "type": "\"anonymous_id\"", + "name": "AnonymousId" + }, + { + "type": "\"bootstrap_feature_flag_details\"", + "name": "BootstrapFeatureFlagDetails" + }, + { + "type": "\"bootstrap_feature_flag_payloads\"", + "name": "BootstrapFeatureFlagPayloads" + }, + { + "type": "\"bootstrap_feature_flags\"", + "name": "BootstrapFeatureFlags" + }, + { + "type": "\"distinct_id\"", + "name": "DistinctId" + }, + { + "type": "\"enable_person_processing\"", + "name": "EnablePersonProcessing" + }, + { + "type": "\"feature_flag_details\"", + "name": "FeatureFlagDetails" + }, + { + "type": "\"feature_flag_payloads\"", + "name": "FeatureFlagPayloads" + }, + { + "type": "\"feature_flags\"", + "name": "FeatureFlags" + }, + { + "type": "\"flags_endpoint_was_hit\"", + "name": "FlagsEndpointWasHit" + }, + { + "type": "\"group_properties\"", + "name": "GroupProperties" + }, + { + "type": "\"installed_app_build\"", + "name": "InstalledAppBuild" + }, + { + "type": "\"installed_app_version\"", + "name": "InstalledAppVersion" + }, + { + "type": "\"opted_out\"", + "name": "OptedOut" + }, + { + "type": "\"override_feature_flags\"", + "name": "OverrideFeatureFlags" + }, + { + "type": "\"person_mode\"", + "name": "PersonMode" + }, + { + "type": "\"person_properties\"", + "name": "PersonProperties" + }, + { + "type": "\"props\"", + "name": "Props" + }, + { + "type": "\"queue\"", + "name": "Queue" + }, + { + "type": "\"remote_config\"", + "name": "RemoteConfig" + }, + { + "type": "\"session_id\"", + "name": "SessionId" + }, + { + "type": "\"session_timestamp\"", + "name": "SessionLastTimestamp" + }, + { + "type": "\"session_replay\"", + "name": "SessionReplay" + }, + { + "type": "\"session_start_timestamp\"", + "name": "SessionStartTimestamp" + }, + { + "type": "\"survey_last_seen_date\"", + "name": "SurveyLastSeenDate" + }, + { + "type": "\"surveys\"", + "name": "Surveys" + }, + { + "type": "\"surveys_seen\"", + "name": "SurveysSeen" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "PostHogRemoteConfig", + "name": "PostHogRemoteConfig", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n sessionRecording?: boolean | {\n [key: string]: JsonType;\n };\n supportedCompression?: Compression[];\n surveys?: boolean | Survey[];\n hasFeatureFlags?: boolean;\n errorTracking?: boolean | {\n [key: string]: JsonType;\n };\n capturePerformance?: boolean | {\n [key: string]: JsonType;\n };\n}" + }, + { + "id": "PreviouslyCapturedError", + "name": "PreviouslyCapturedError", + "properties": [ + { + "type": "boolean", + "name": "__posthog_previously_captured_error" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "PrimitiveType", + "name": "PrimitiveType", + "properties": [], + "path": "../core/src/error-tracking/coercers/primitive-coercer.ts", + "example": "null | undefined | boolean | number | string | symbol | bigint" + }, + { + "id": "PropertyGroup", + "name": "PropertyGroup", + "properties": [], + "path": "src/types.ts", + "example": "{\n type: 'AND' | 'OR';\n values: PropertyGroup[] | FlagProperty[];\n}" + }, + { + "id": "RatingSurveyQuestion", + "name": "RatingSurveyQuestion", + "properties": [], + "path": "../core/src/types.ts", + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Rating;\n display: SurveyRatingDisplay;\n scale: 2 | 3 | 5 | 7 | 10;\n lowerBoundLabel: string;\n upperBoundLabel: string;\n skipSubmitButton?: boolean;\n}" + }, + { + "id": "ResponseBasedBranching", + "name": "ResponseBasedBranching", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.ResponseBased;\n responseValues: Record;\n}" + }, + { + "id": "RetriableOptions", + "name": "RetriableOptions", + "properties": [ + { + "type": "(err: unknown) => boolean", + "name": "retryCheck" + }, + { + "type": "number", + "name": "retryCount" + }, + { + "type": "number", + "name": "retryDelay" + } + ], + "path": "../core/src/utils/index.ts" + }, + { + "id": "SendFeatureFlagsOptions", + "name": "SendFeatureFlagsOptions", + "properties": [], + "path": "src/types.ts", + "example": "{\n onlyEvaluateLocally?: boolean;\n personProperties?: Record;\n groupProperties?: Record>;\n flagKeys?: string[];\n}" + }, + { + "id": "SentryIntegrationOptions", + "name": "SentryIntegrationOptions", + "properties": [], + "path": "src/extensions/sentry-integration.ts", + "example": "{\n organization?: string;\n projectId?: number;\n prefix?: string;\n severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n sendExceptionsToPostHog?: boolean;\n}" + }, + { + "id": "SeverityLevel", + "name": "SeverityLevel", + "properties": [], + "path": "../core/src/error-tracking/types.ts", + "example": "(typeof severityLevels)[number]" + }, + { + "id": "SpecificQuestionBranching", + "name": "SpecificQuestionBranching", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n type: SurveyQuestionBranchingType.SpecificQuestion;\n index: number;\n}" }, { - "id": "ContextData", - "name": "ContextData", + "id": "StackFrame", + "name": "StackFrame", "properties": [ { "type": "string", - "name": "distinctId" + "name": "abs_path" }, { - "type": "Record", - "name": "properties" + "type": "string", + "name": "addr_mode" }, { "type": "string", - "name": "sessionId" - } - ], - "path": "src/extensions/context/types.ts" - }, - { - "id": "ContextOptions", - "name": "ContextOptions", - "properties": [ + "name": "chunk_id" + }, + { + "type": "number", + "name": "colno" + }, + { + "type": "string", + "name": "context_line" + }, + { + "type": "string", + "name": "filename" + }, + { + "type": "string", + "name": "function" + }, { - "description": "If true, replaces the current context entirely. If false, merges with the existing context (new values override existing ones). false", "type": "boolean", - "name": "fresh" + "name": "in_app" + }, + { + "type": "string", + "name": "instruction_addr" + }, + { + "type": "number", + "name": "lineno" + }, + { + "type": "string", + "name": "module" + }, + { + "type": "Platform", + "name": "platform" + }, + { + "type": "string[]", + "name": "post_context" + }, + { + "type": "string[]", + "name": "pre_context" + }, + { + "type": "{\n [key: string]: JsonType;\n }", + "name": "vars" } ], - "path": "src/extensions/context/types.ts" - }, - { - "id": "EventMessage", - "name": "EventMessage", - "properties": [], - "path": "src/types.ts", - "example": "Omit & {\n distinctId?: string;\n event: string;\n groups?: Record;\n sendFeatureFlags?: boolean | SendFeatureFlagsOptions;\n timestamp?: Date;\n uuid?: string;\n _originatedFromCaptureException?: boolean;\n}" + "path": "../core/src/error-tracking/types.ts" }, { - "id": "ExpressErrorMiddleware", - "name": "ExpressErrorMiddleware", + "id": "StackFrameModifierFn", + "name": "StackFrameModifierFn", "properties": [], - "path": "src/extensions/express.ts", - "example": "(error: MiddlewareError, req: Request, res: Response, next: (error: MiddlewareError) => void) => void" + "path": "../core/src/error-tracking/types.ts", + "example": "(frames: StackFrame[]) => Promise" }, { - "id": "ExpressMiddleware", - "name": "ExpressMiddleware", + "id": "StackLineParser", + "name": "StackLineParser", "properties": [], - "path": "src/extensions/express.ts", - "example": "(req: Request, res: Response, next: () => void) => void" + "path": "../core/src/error-tracking/types.ts", + "example": "(line: string, platform: Platform) => StackFrame | undefined" }, { - "id": "FeatureFlagBucketingIdentifier", - "name": "FeatureFlagBucketingIdentifier", + "id": "StackParser", + "name": "StackParser", "properties": [], - "path": "src/types.ts", - "example": "\"distinct_id\" | \"device_id\"" + "path": "../core/src/error-tracking/types.ts", + "example": "(stack: string, skipFirstLines?: number) => StackFrame[]" }, { - "id": "FeatureFlagCondition", - "name": "FeatureFlagCondition", + "id": "Survey", + "name": "Survey", "properties": [], - "path": "src/types.ts", - "example": "{\n properties: FlagProperty[];\n rollout_percentage?: number;\n variant?: string;\n}" + "path": "../core/src/types.ts", + "example": "{\n id: string;\n name: string;\n description?: string;\n type: SurveyType;\n feature_flag_keys?: {\n key: string;\n value?: string;\n }[];\n linked_flag_key?: string;\n targeting_flag_key?: string;\n internal_targeting_flag_key?: string;\n questions: SurveyQuestion[];\n appearance?: SurveyAppearance;\n conditions?: {\n url?: string;\n selector?: string;\n seenSurveyWaitPeriodInDays?: number;\n urlMatchType?: SurveyMatchType;\n events?: {\n repeatedActivation?: boolean;\n values?: {\n name: string;\n }[];\n };\n actions?: {\n values: SurveyActionType[];\n };\n deviceTypes?: string[];\n deviceTypesMatchType?: SurveyMatchType;\n linkedFlagVariant?: string;\n };\n start_date?: string;\n end_date?: string;\n current_iteration?: number;\n current_iteration_start_date?: string;\n schedule?: SurveySchedule;\n}" }, { - "id": "FeatureFlagOverrideOptions", - "name": "FeatureFlagOverrideOptions", + "id": "SurveyActionType", + "name": "SurveyActionType", "properties": [], - "path": "src/types.ts", - "example": "{\n flags?: false | string[] | Record;\n payloads?: false | Record;\n}" + "path": "../core/src/types.ts", + "example": "{\n id: number;\n name?: string;\n steps?: ActionStepType[];\n}" }, { - "id": "FeatureFlagResult", - "name": "FeatureFlagResult", + "id": "SurveyAppearance", + "name": "SurveyAppearance", "properties": [], - "path": "src/types.ts", - "example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n payload: JsonType | undefined;\n}" + "path": "../core/src/types.ts", + "example": "{\n backgroundColor?: string;\n textColor?: string;\n submitButtonColor?: string;\n submitButtonText?: string;\n submitButtonTextColor?: string;\n ratingButtonColor?: string;\n ratingButtonActiveColor?: string;\n inputBackground?: string;\n inputTextColor?: string;\n autoDisappear?: boolean;\n displayThankYouMessage?: boolean;\n thankYouMessageHeader?: string;\n thankYouMessageDescription?: string;\n thankYouMessageDescriptionContentType?: SurveyQuestionDescriptionContentType;\n thankYouMessageCloseButtonText?: string;\n borderColor?: string;\n position?: SurveyPosition;\n placeholder?: string;\n shuffleQuestions?: boolean;\n surveyPopupDelaySeconds?: number;\n widgetType?: SurveyWidgetType;\n widgetSelector?: string;\n widgetLabel?: string;\n widgetColor?: string;\n}" }, { - "id": "FlagDefinitionCacheData", - "name": "FlagDefinitionCacheData", + "id": "SurveyMatchType", + "name": "SurveyMatchType", "properties": [ { - "description": "Cohort property groups for local evaluation", - "type": "Record", - "name": "cohorts" + "type": "\"exact\"", + "name": "Exact" }, { - "description": "Array of feature flag definitions", - "type": "PostHogFeatureFlag[]", - "name": "flags" + "type": "\"icontains\"", + "name": "Icontains" }, { - "description": "Mapping of group type index to group name", - "type": "Record", - "name": "groupTypeMapping" + "type": "\"is_not\"", + "name": "IsNot" + }, + { + "type": "\"not_icontains\"", + "name": "NotIcontains" + }, + { + "type": "\"not_regex\"", + "name": "NotRegex" + }, + { + "type": "\"regex\"", + "name": "Regex" } ], - "path": "src/extensions/feature-flags/cache.ts" - }, - { - "id": "FlagDefinitionCacheProvider", - "name": "FlagDefinitionCacheProvider", - "properties": [], - "path": "src/extensions/feature-flags/cache.ts" - }, - { - "id": "FlagProperty", - "name": "FlagProperty", - "properties": [], - "path": "src/types.ts", - "example": "{\n key: string;\n type?: string;\n value: FlagPropertyValue;\n operator?: string;\n negation?: boolean;\n dependency_chain?: string[];\n}" + "path": "../core/src/types.ts" }, { - "id": "FlagPropertyValue", - "name": "FlagPropertyValue", - "properties": [], - "path": "src/types.ts", - "example": "string | number | (string | number)[] | boolean" + "id": "SurveyPosition", + "name": "SurveyPosition", + "properties": [ + { + "type": "\"center\"", + "name": "Center" + }, + { + "type": "\"left\"", + "name": "Left" + }, + { + "type": "\"middle_center\"", + "name": "MiddleCenter" + }, + { + "type": "\"middle_left\"", + "name": "MiddleLeft" + }, + { + "type": "\"middle_right\"", + "name": "MiddleRight" + }, + { + "type": "\"right\"", + "name": "Right" + }, + { + "type": "\"top_center\"", + "name": "TopCenter" + }, + { + "type": "\"top_left\"", + "name": "TopLeft" + }, + { + "type": "\"top_right\"", + "name": "TopRight" + } + ], + "path": "../core/src/types.ts" }, { - "id": "GroupIdentifyMessage", - "name": "GroupIdentifyMessage", + "id": "SurveyQuestion", + "name": "SurveyQuestion", "properties": [], - "path": "src/types.ts", - "example": "{\n groupType: string;\n groupKey: string;\n properties?: Record;\n distinctId?: string;\n disableGeoip?: boolean;\n}" + "path": "../core/src/types.ts", + "example": "BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion" }, { - "id": "IdentifyMessage", - "name": "IdentifyMessage", + "id": "SurveyQuestionBase", + "name": "SurveyQuestionBase", "properties": [], - "path": "src/types.ts", - "example": "{\n distinctId: string;\n properties?: Record;\n disableGeoip?: boolean;\n}" + "path": "../core/src/types.ts", + "example": "{\n question: string;\n id: string;\n description?: string;\n descriptionContentType?: SurveyQuestionDescriptionContentType;\n optional?: boolean;\n buttonText?: string;\n originalQuestionIndex: number;\n branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n validation?: SurveyValidationRule[];\n}" }, { - "id": "IPostHog", - "name": "IPostHog", - "properties": [], - "path": "src/types.ts" + "id": "SurveyQuestionBranchingType", + "name": "SurveyQuestionBranchingType", + "properties": [ + { + "type": "\"end\"", + "name": "End" + }, + { + "type": "\"next_question\"", + "name": "NextQuestion" + }, + { + "type": "\"response_based\"", + "name": "ResponseBased" + }, + { + "type": "\"specific_question\"", + "name": "SpecificQuestion" + } + ], + "path": "../core/src/types.ts" }, { - "id": "IPostHogContext", - "name": "IPostHogContext", - "properties": [], - "path": "src/extensions/context/types.ts" + "id": "SurveyQuestionDescriptionContentType", + "name": "SurveyQuestionDescriptionContentType", + "properties": [ + { + "type": "\"html\"", + "name": "Html" + }, + { + "type": "\"text\"", + "name": "Text" + } + ], + "path": "../core/src/types.ts" }, { - "id": "MiddlewareError", - "name": "MiddlewareError", + "id": "SurveyQuestionType", + "name": "SurveyQuestionType", "properties": [ { - "type": "{\n statusCode?: number | string;\n }", - "name": "output" + "type": "\"link\"", + "name": "Link" }, { - "type": "number | string", - "name": "status_code" + "type": "\"multiple_choice\"", + "name": "MultipleChoice" }, { - "type": "number | string", - "name": "status" + "type": "\"open\"", + "name": "Open" }, { - "type": "number | string", - "name": "statusCode" + "type": "\"rating\"", + "name": "Rating" + }, + { + "type": "\"single_choice\"", + "name": "SingleChoice" } ], - "path": "src/extensions/express.ts" + "path": "../core/src/types.ts" }, { - "id": "OverrideFeatureFlagsOptions", - "name": "OverrideFeatureFlagsOptions", - "properties": [], - "path": "src/types.ts", - "example": "false | string[] | Record | FeatureFlagOverrideOptions" + "id": "SurveyRatingDisplay", + "name": "SurveyRatingDisplay", + "properties": [ + { + "type": "\"emoji\"", + "name": "Emoji" + }, + { + "type": "\"number\"", + "name": "Number" + } + ], + "path": "../core/src/types.ts" }, { - "id": "PostHogFeatureFlag", - "name": "PostHogFeatureFlag", + "id": "SurveyResponse", + "name": "SurveyResponse", "properties": [], - "path": "src/types.ts", - "example": "{\n id: number;\n name: string;\n key: string;\n bucketing_identifier?: FeatureFlagBucketingIdentifier;\n filters?: {\n aggregation_group_type_index?: number;\n groups?: FeatureFlagCondition[];\n multivariate?: {\n variants: {\n key: string;\n rollout_percentage: number;\n }[];\n };\n payloads?: Record;\n };\n deleted: boolean;\n active: boolean;\n rollout_percentage: null | number;\n ensure_experience_continuity: boolean;\n experiment_set: number[];\n}" + "path": "../core/src/types.ts", + "example": "{\n surveys: Survey[];\n}" }, { - "id": "PostHogOptions", - "name": "PostHogOptions", - "properties": [], - "path": "src/types.ts", - "example": "Omit & {\n persistence?: 'memory';\n personalApiKey?: string;\n privacyMode?: boolean;\n enableExceptionAutocapture?: boolean;\n featureFlagsPollingInterval?: number;\n maxCacheSize?: number;\n fetch?: (url: string, options: PostHogFetchOptions) => Promise;\n enableLocalEvaluation?: boolean;\n flagDefinitionCacheProvider?: FlagDefinitionCacheProvider;\n before_send?: BeforeSendFn | BeforeSendFn[];\n evaluationContexts?: readonly string[];\n evaluationEnvironments?: readonly string[];\n custom_blocked_useragents?: string[];\n __preview_capture_bot_pageviews?: boolean;\n strictLocalEvaluation?: boolean;\n}" + "id": "SurveySchedule", + "name": "SurveySchedule", + "properties": [ + { + "type": "\"always\"", + "name": "Always" + }, + { + "type": "\"once\"", + "name": "Once" + }, + { + "type": "\"recurring\"", + "name": "Recurring" + } + ], + "path": "../core/src/types.ts" }, { - "id": "PropertyGroup", - "name": "PropertyGroup", - "properties": [], - "path": "src/types.ts", - "example": "{\n type: 'AND' | 'OR';\n values: PropertyGroup[] | FlagProperty[];\n}" + "id": "SurveyType", + "name": "SurveyType", + "properties": [ + { + "type": "\"api\"", + "name": "API" + }, + { + "type": "\"external_survey\"", + "name": "ExternalSurvey" + }, + { + "type": "\"popover\"", + "name": "Popover" + }, + { + "type": "\"widget\"", + "name": "Widget" + } + ], + "path": "../core/src/types.ts" }, { - "id": "SendFeatureFlagsOptions", - "name": "SendFeatureFlagsOptions", - "properties": [], - "path": "src/types.ts", - "example": "{\n onlyEvaluateLocally?: boolean;\n personProperties?: Record;\n groupProperties?: Record>;\n flagKeys?: string[];\n}" + "id": "SurveyValidationRule", + "name": "SurveyValidationRule", + "properties": [ + { + "type": "string", + "name": "errorMessage" + }, + { + "type": "SurveyValidationType", + "name": "type" + }, + { + "type": "number", + "name": "value" + } + ], + "path": "../core/src/types.ts" }, { - "id": "SentryIntegrationOptions", - "name": "SentryIntegrationOptions", - "properties": [], - "path": "src/extensions/sentry-integration.ts", - "example": "{\n organization?: string;\n projectId?: number;\n prefix?: string;\n severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n sendExceptionsToPostHog?: boolean;\n}" + "id": "SurveyValidationType", + "name": "SurveyValidationType", + "properties": [ + { + "type": "\"max_length\"", + "name": "MaxLength" + }, + { + "type": "\"min_length\"", + "name": "MinLength" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "SurveyWidgetType", + "name": "SurveyWidgetType", + "properties": [ + { + "type": "\"button\"", + "name": "Button" + }, + { + "type": "\"selector\"", + "name": "Selector" + }, + { + "type": "\"tab\"", + "name": "Tab" + } + ], + "path": "../core/src/types.ts" } ], "categories": [ diff --git a/packages/node/references/posthog-node-references-latest.json b/packages/node/references/posthog-node-references-latest.json index dbe3561fbf..2d1bf04a3e 100644 --- a/packages/node/references/posthog-node-references-latest.json +++ b/packages/node/references/posthog-node-references-latest.json @@ -1349,7 +1349,6 @@ }, { "category": "", - "description": "* ** QUEUEING AND FLUSHING *", "details": null, "id": "enqueue", "showDocs": true, @@ -1444,6 +1443,28 @@ }, "path": "src/entrypoints/index.node.ts" }, + { + "category": "", + "description": "Hook that allows subclasses to wait for storage operations to complete. This is called after queue changes are persisted during flush to ensure data is safely written to storage before considering events as sent.\nOverride this in implementations with async storage (e.g., React Native) to prevent duplicate events on app crash/restart scenarios.", + "details": null, + "id": "flushStorage", + "showDocs": true, + "title": "flushStorage", + "examples": [ + { + "id": "flushstorage", + "name": "Generated example for flushStorage", + "code": "// Generated example for flushStorage\nposthog.flushStorage();" + } + ], + "releaseTag": "public", + "params": [], + "returnType": { + "id": "Promise", + "name": "Promise" + }, + "path": "src/entrypoints/index.node.ts" + }, { "category": "", "details": null, @@ -1946,8 +1967,8 @@ } ], "returnType": { - "id": "Promise", - "name": "Promise" + "id": "Promise", + "name": "Promise" }, "path": "src/entrypoints/index.node.ts" }, @@ -2238,6 +2259,75 @@ }, "path": "src/entrypoints/index.node.ts" }, + { + "category": "", + "details": null, + "id": "prepareMessage", + "showDocs": true, + "title": "prepareMessage", + "examples": [ + { + "id": "preparemessage", + "name": "Generated example for prepareMessage", + "code": "// Generated example for prepareMessage\nposthog.prepareMessage();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "", + "isOptional": false, + "type": "string", + "name": "type" + }, + { + "description": "", + "isOptional": false, + "type": "any", + "name": "_message" + }, + { + "description": "", + "isOptional": true, + "type": "PostHogCaptureOptions", + "name": "options" + } + ], + "returnType": { + "id": "PostHogEventProperties", + "name": "PostHogEventProperties" + }, + "path": "src/entrypoints/index.node.ts" + }, + { + "category": "", + "description": "Hook that allows subclasses to transform or filter a message before it's queued. Return null to drop the message.", + "details": null, + "id": "processBeforeEnqueue", + "showDocs": true, + "title": "processBeforeEnqueue", + "examples": [ + { + "id": "processbeforeenqueue", + "name": "Generated example for processBeforeEnqueue", + "code": "// Generated example for processBeforeEnqueue\nposthog.processBeforeEnqueue();" + } + ], + "releaseTag": "public", + "params": [ + { + "description": "The prepared message", + "isOptional": false, + "type": "PostHogEventProperties", + "name": "message" + } + ], + "returnType": { + "id": "PostHogEventProperties | null", + "name": "PostHogEventProperties | null" + }, + "path": "src/entrypoints/index.node.ts" + }, { "category": "", "details": null, @@ -2487,6 +2577,13 @@ "path": "../core/src/types.ts", "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Open;\n}" }, + { + "id": "BeforeSendFn_2", + "name": "BeforeSendFn_2", + "properties": [], + "path": "../core/src/types.ts", + "example": "(event: CaptureEvent | null) => CaptureEvent | null" + }, { "id": "BeforeSendFn", "name": "BeforeSendFn", @@ -2494,6 +2591,13 @@ "path": "src/types.ts", "example": "(event: EventMessage | null) => EventMessage | null" }, + { + "id": "CaptureEvent", + "name": "CaptureEvent", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n uuid?: string;\n event: string;\n properties?: PostHogEventProperties;\n $set?: PostHogEventProperties;\n $set_once?: PostHogEventProperties;\n timestamp?: Date;\n}" + }, { "id": "ChunkIdMapType", "name": "ChunkIdMapType", @@ -2612,6 +2716,10 @@ "type": "Partial", "name": "mechanism" }, + { + "type": "number", + "name": "skipFirstLines" + }, { "type": "Error | null", "name": "syntheticException" @@ -2626,6 +2734,62 @@ "path": "src/types.ts", "example": "Omit & {\n distinctId?: string;\n event: string;\n groups?: Record;\n sendFeatureFlags?: boolean | SendFeatureFlagsOptions;\n timestamp?: Date;\n uuid?: string;\n _originatedFromCaptureException?: boolean;\n}" }, + { + "id": "Exception", + "name": "Exception", + "properties": [ + { + "type": "Mechanism", + "name": "mechanism" + }, + { + "type": "string", + "name": "module" + }, + { + "type": "{\n frames?: StackFrame[];\n type: 'raw';\n }", + "name": "stacktrace" + }, + { + "type": "number", + "name": "thread_id" + }, + { + "type": "string", + "name": "type" + }, + { + "type": "string", + "name": "value" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ExceptionLike", + "name": "ExceptionLike", + "properties": [ + { + "type": "ExceptionLike", + "name": "cause" + }, + { + "type": "SeverityLevel", + "name": "level" + }, + { + "type": "string", + "name": "stack" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "ExceptionList", + "name": "ExceptionList", + "properties": [], + "path": "../core/src/error-tracking/types.ts" + }, { "id": "ExpressErrorMiddleware", "name": "ExpressErrorMiddleware", @@ -2647,26 +2811,33 @@ "path": "src/types.ts", "example": "\"distinct_id\" | \"device_id\"" }, + { + "id": "FeatureFlagCondition", + "name": "FeatureFlagCondition", + "properties": [], + "path": "src/types.ts", + "example": "{\n properties: FlagProperty[];\n rollout_percentage?: number;\n variant?: string;\n}" + }, { "id": "FeatureFlagDetail", "name": "FeatureFlagDetail", "properties": [], "path": "../core/src/types.ts", - "example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n reason: EvaluationReason | undefined;\n metadata: FeatureFlagMetadata | undefined;\n}" + "example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n reason: EvaluationReason | undefined;\n metadata: FeatureFlagMetadata | undefined;\n failed?: boolean;\n}" }, { - "id": "FeatureFlagBucketingIdentifier", - "name": "FeatureFlagBucketingIdentifier", + "id": "FeatureFlagErrorType", + "name": "FeatureFlagErrorType", "properties": [], - "path": "src/types.ts", - "example": "\"distinct_id\" | \"device_id\"" + "path": "../core/src/types.ts", + "example": "\"apiError\"" }, { - "id": "FeatureFlagCondition", - "name": "FeatureFlagCondition", + "id": "FeatureFlagMetadata", + "name": "FeatureFlagMetadata", "properties": [], - "path": "src/types.ts", - "example": "{\n properties: FlagProperty[];\n rollout_percentage?: number;\n variant?: string;\n}" + "path": "../core/src/types.ts", + "example": "{\n id: number | undefined;\n version: number | undefined;\n description: string | undefined;\n payload: string | undefined;\n}" }, { "id": "FeatureFlagOverrideOptions", @@ -2675,6 +2846,13 @@ "path": "src/types.ts", "example": "{\n flags?: false | string[] | Record;\n payloads?: false | Record;\n}" }, + { + "id": "FeatureFlagRequestError", + "name": "FeatureFlagRequestError", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n type: 'timeout' | 'connection_error' | 'api_error' | 'unknown_error';\n statusCode?: number;\n}" + }, { "id": "FeatureFlagResult", "name": "FeatureFlagResult", @@ -2682,6 +2860,13 @@ "path": "src/types.ts", "example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n payload: JsonType | undefined;\n}" }, + { + "id": "FeatureFlagValue", + "name": "FeatureFlagValue", + "properties": [], + "path": "../core/src/types.ts", + "example": "string | boolean" + }, { "id": "FlagDefinitionCacheData", "name": "FlagDefinitionCacheData", @@ -2724,6 +2909,13 @@ "path": "src/types.ts", "example": "string | number | (string | number)[] | boolean" }, + { + "id": "GetFlagsResult", + "name": "GetFlagsResult", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n success: true;\n response: PostHogFeatureFlagsResponse;\n} | {\n success: false;\n error: FeatureFlagRequestError;\n}" + }, { "id": "GetModuleFn", "name": "GetModuleFn", @@ -2829,7 +3021,7 @@ "name": "MultipleSurveyQuestion", "properties": [], "path": "../core/src/types.ts", - "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n choices: string[];\n hasOpenChoice?: boolean;\n shuffleOptions?: boolean;\n}" + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n choices: string[];\n hasOpenChoice?: boolean;\n shuffleOptions?: boolean;\n skipSubmitButton?: boolean;\n}" }, { "id": "NextQuestionBranching", @@ -2874,6 +3066,10 @@ { "type": "ChunkIdMapType", "name": "chunkIdMap" + }, + { + "type": "number", + "name": "skipFirstLines" } ], "path": "../core/src/error-tracking/types.ts" @@ -2916,14 +3112,14 @@ "name": "PostHogCaptureOptions", "properties": [], "path": "../core/src/types.ts", - "example": "{\n uuid?: string;\n timestamp?: Date;\n disableGeoip?: boolean;\n}" + "example": "{\n uuid?: string;\n timestamp?: Date;\n disableGeoip?: boolean;\n _originatedFromCaptureException?: boolean;\n}" }, { "id": "PostHogCoreOptions", "name": "PostHogCoreOptions", "properties": [], "path": "../core/src/types.ts", - "example": "{\n host?: string;\n flushAt?: number;\n flushInterval?: number;\n maxBatchSize?: number;\n maxQueueSize?: number;\n disabled?: boolean;\n defaultOptIn?: boolean;\n sendFeatureFlagEvent?: boolean;\n preloadFeatureFlags?: boolean;\n disableRemoteConfig?: boolean;\n disableSurveys?: boolean;\n bootstrap?: {\n distinctId?: string;\n isIdentifiedId?: boolean;\n featureFlags?: Record;\n featureFlagPayloads?: Record;\n };\n fetchRetryCount?: number;\n fetchRetryDelay?: number;\n requestTimeout?: number;\n featureFlagsRequestTimeoutMs?: number;\n remoteConfigRequestTimeoutMs?: number;\n sessionExpirationTimeSeconds?: number;\n disableCompression?: boolean;\n disableGeoip?: boolean;\n historicalMigration?: boolean;\n evaluationEnvironments?: readonly string[];\n}" + "example": "{\n host?: string;\n flushAt?: number;\n flushInterval?: number;\n maxBatchSize?: number;\n maxQueueSize?: number;\n disabled?: boolean;\n defaultOptIn?: boolean;\n sendFeatureFlagEvent?: boolean;\n preloadFeatureFlags?: boolean;\n disableRemoteConfig?: boolean;\n disableSurveys?: boolean;\n bootstrap?: {\n distinctId?: string;\n isIdentifiedId?: boolean;\n featureFlags?: Record;\n featureFlagPayloads?: Record;\n };\n fetchRetryCount?: number;\n fetchRetryDelay?: number;\n requestTimeout?: number;\n featureFlagsRequestTimeoutMs?: number;\n remoteConfigRequestTimeoutMs?: number;\n sessionExpirationTimeSeconds?: number;\n disableCompression?: boolean;\n disableGeoip?: boolean;\n historicalMigration?: boolean;\n evaluationContexts?: readonly string[];\n evaluationEnvironments?: readonly string[];\n personProfiles?: 'always' | 'identified_only' | 'never';\n before_send?: BeforeSendFn | BeforeSendFn[];\n}" }, { "id": "PostHogEventProperties", @@ -2939,6 +3135,48 @@ "path": "src/types.ts", "example": "{\n id: number;\n name: string;\n key: string;\n bucketing_identifier?: FeatureFlagBucketingIdentifier;\n filters?: {\n aggregation_group_type_index?: number;\n groups?: FeatureFlagCondition[];\n multivariate?: {\n variants: {\n key: string;\n rollout_percentage: number;\n }[];\n };\n payloads?: Record;\n };\n deleted: boolean;\n active: boolean;\n rollout_percentage: null | number;\n ensure_experience_continuity: boolean;\n experiment_set: number[];\n}" }, + { + "id": "PostHogFeatureFlagDetails", + "name": "PostHogFeatureFlagDetails", + "properties": [], + "path": "../core/src/types.ts", + "example": "\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\"" + }, + { + "id": "PostHogFeatureFlagsResponse", + "name": "PostHogFeatureFlagsResponse", + "properties": [], + "path": "../core/src/types.ts", + "example": "\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\"" + }, + { + "id": "PostHogFetchOptions", + "name": "PostHogFetchOptions", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n method: 'GET' | 'POST' | 'PUT' | 'PATCH';\n mode?: 'no-cors';\n credentials?: 'omit';\n headers: {\n [key: string]: string;\n };\n body?: string | Blob;\n signal?: AbortSignal;\n}" + }, + { + "id": "PostHogFetchResponse", + "name": "PostHogFetchResponse", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n status: number;\n text: () => Promise;\n json: () => Promise;\n headers?: {\n get(name: string): string | null;\n };\n}" + }, + { + "id": "PostHogFlagsAndPayloadsResponse", + "name": "PostHogFlagsAndPayloadsResponse", + "properties": [], + "path": "../core/src/types.ts", + "example": "\"featureFlags\" | \"featureFlagPayloads\"" + }, + { + "id": "PostHogFlagsResponse", + "name": "PostHogFlagsResponse", + "properties": [], + "path": "../core/src/types.ts", + "example": "Omit & {\n featureFlags: {\n [key: string]: FeatureFlagValue;\n };\n featureFlagPayloads: {\n [key: string]: JsonType;\n };\n flags: {\n [key: string]: FeatureFlagDetail;\n };\n errorsWhileComputingFlags: boolean;\n sessionRecording?: boolean | {\n [key: string]: JsonType;\n };\n quotaLimited?: string[];\n requestId?: string;\n evaluatedAt?: number;\n}" + }, { "id": "PostHogOptions", "name": "PostHogOptions", @@ -2946,6 +3184,146 @@ "path": "src/types.ts", "example": "Omit & {\n persistence?: 'memory';\n personalApiKey?: string;\n privacyMode?: boolean;\n enableExceptionAutocapture?: boolean;\n featureFlagsPollingInterval?: number;\n maxCacheSize?: number;\n fetch?: (url: string, options: PostHogFetchOptions) => Promise;\n enableLocalEvaluation?: boolean;\n flagDefinitionCacheProvider?: FlagDefinitionCacheProvider;\n before_send?: BeforeSendFn | BeforeSendFn[];\n evaluationContexts?: readonly string[];\n evaluationEnvironments?: readonly string[];\n custom_blocked_useragents?: string[];\n __preview_capture_bot_pageviews?: boolean;\n strictLocalEvaluation?: boolean;\n}" }, + { + "id": "PostHogPersistedProperty", + "name": "PostHogPersistedProperty", + "properties": [ + { + "type": "\"anonymous_id\"", + "name": "AnonymousId" + }, + { + "type": "\"bootstrap_feature_flag_details\"", + "name": "BootstrapFeatureFlagDetails" + }, + { + "type": "\"bootstrap_feature_flag_payloads\"", + "name": "BootstrapFeatureFlagPayloads" + }, + { + "type": "\"bootstrap_feature_flags\"", + "name": "BootstrapFeatureFlags" + }, + { + "type": "\"distinct_id\"", + "name": "DistinctId" + }, + { + "type": "\"enable_person_processing\"", + "name": "EnablePersonProcessing" + }, + { + "type": "\"feature_flag_details\"", + "name": "FeatureFlagDetails" + }, + { + "type": "\"feature_flag_payloads\"", + "name": "FeatureFlagPayloads" + }, + { + "type": "\"feature_flags\"", + "name": "FeatureFlags" + }, + { + "type": "\"flags_endpoint_was_hit\"", + "name": "FlagsEndpointWasHit" + }, + { + "type": "\"group_properties\"", + "name": "GroupProperties" + }, + { + "type": "\"installed_app_build\"", + "name": "InstalledAppBuild" + }, + { + "type": "\"installed_app_version\"", + "name": "InstalledAppVersion" + }, + { + "type": "\"opted_out\"", + "name": "OptedOut" + }, + { + "type": "\"override_feature_flags\"", + "name": "OverrideFeatureFlags" + }, + { + "type": "\"person_mode\"", + "name": "PersonMode" + }, + { + "type": "\"person_properties\"", + "name": "PersonProperties" + }, + { + "type": "\"props\"", + "name": "Props" + }, + { + "type": "\"queue\"", + "name": "Queue" + }, + { + "type": "\"remote_config\"", + "name": "RemoteConfig" + }, + { + "type": "\"session_id\"", + "name": "SessionId" + }, + { + "type": "\"session_timestamp\"", + "name": "SessionLastTimestamp" + }, + { + "type": "\"session_replay\"", + "name": "SessionReplay" + }, + { + "type": "\"session_start_timestamp\"", + "name": "SessionStartTimestamp" + }, + { + "type": "\"survey_last_seen_date\"", + "name": "SurveyLastSeenDate" + }, + { + "type": "\"surveys\"", + "name": "Surveys" + }, + { + "type": "\"surveys_seen\"", + "name": "SurveysSeen" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "PostHogRemoteConfig", + "name": "PostHogRemoteConfig", + "properties": [], + "path": "../core/src/types.ts", + "example": "{\n sessionRecording?: boolean | {\n [key: string]: JsonType;\n };\n supportedCompression?: Compression[];\n surveys?: boolean | Survey[];\n hasFeatureFlags?: boolean;\n errorTracking?: boolean | {\n [key: string]: JsonType;\n };\n capturePerformance?: boolean | {\n [key: string]: JsonType;\n };\n}" + }, + { + "id": "PreviouslyCapturedError", + "name": "PreviouslyCapturedError", + "properties": [ + { + "type": "boolean", + "name": "__posthog_previously_captured_error" + } + ], + "path": "../core/src/error-tracking/types.ts" + }, + { + "id": "PrimitiveType", + "name": "PrimitiveType", + "properties": [], + "path": "../core/src/error-tracking/coercers/primitive-coercer.ts", + "example": "null | undefined | boolean | number | string | symbol | bigint" + }, { "id": "PropertyGroup", "name": "PropertyGroup", @@ -2958,7 +3336,7 @@ "name": "RatingSurveyQuestion", "properties": [], "path": "../core/src/types.ts", - "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Rating;\n display: SurveyRatingDisplay;\n scale: 3 | 5 | 7 | 10;\n lowerBoundLabel: string;\n upperBoundLabel: string;\n}" + "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Rating;\n display: SurveyRatingDisplay;\n scale: 2 | 3 | 5 | 7 | 10;\n lowerBoundLabel: string;\n upperBoundLabel: string;\n skipSubmitButton?: boolean;\n}" }, { "id": "ResponseBasedBranching", @@ -3107,7 +3485,7 @@ "name": "Survey", "properties": [], "path": "../core/src/types.ts", - "example": "{\n id: string;\n name: string;\n description?: string;\n type: SurveyType;\n feature_flag_keys?: {\n key: string;\n value?: string;\n }[];\n linked_flag_key?: string;\n targeting_flag_key?: string;\n internal_targeting_flag_key?: string;\n questions: SurveyQuestion[];\n appearance?: SurveyAppearance;\n conditions?: {\n url?: string;\n selector?: string;\n seenSurveyWaitPeriodInDays?: number;\n urlMatchType?: SurveyMatchType;\n events?: {\n repeatedActivation?: boolean;\n values?: {\n name: string;\n }[];\n };\n actions?: {\n values: SurveyActionType[];\n };\n deviceTypes?: string[];\n deviceTypesMatchType?: SurveyMatchType;\n linkedFlagVariant?: string;\n };\n start_date?: string;\n end_date?: string;\n current_iteration?: number;\n current_iteration_start_date?: string;\n}" + "example": "{\n id: string;\n name: string;\n description?: string;\n type: SurveyType;\n feature_flag_keys?: {\n key: string;\n value?: string;\n }[];\n linked_flag_key?: string;\n targeting_flag_key?: string;\n internal_targeting_flag_key?: string;\n questions: SurveyQuestion[];\n appearance?: SurveyAppearance;\n conditions?: {\n url?: string;\n selector?: string;\n seenSurveyWaitPeriodInDays?: number;\n urlMatchType?: SurveyMatchType;\n events?: {\n repeatedActivation?: boolean;\n values?: {\n name: string;\n }[];\n };\n actions?: {\n values: SurveyActionType[];\n };\n deviceTypes?: string[];\n deviceTypesMatchType?: SurveyMatchType;\n linkedFlagVariant?: string;\n };\n start_date?: string;\n end_date?: string;\n current_iteration?: number;\n current_iteration_start_date?: string;\n schedule?: SurveySchedule;\n}" }, { "id": "SurveyActionType", @@ -3209,7 +3587,7 @@ "name": "SurveyQuestionBase", "properties": [], "path": "../core/src/types.ts", - "example": "{\n question: string;\n id: string;\n description?: string;\n descriptionContentType?: SurveyQuestionDescriptionContentType;\n optional?: boolean;\n buttonText?: string;\n originalQuestionIndex: number;\n branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n}" + "example": "{\n question: string;\n id: string;\n description?: string;\n descriptionContentType?: SurveyQuestionDescriptionContentType;\n optional?: boolean;\n buttonText?: string;\n originalQuestionIndex: number;\n branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n validation?: SurveyValidationRule[];\n}" }, { "id": "SurveyQuestionBranchingType", @@ -3298,6 +3676,25 @@ "path": "../core/src/types.ts", "example": "{\n surveys: Survey[];\n}" }, + { + "id": "SurveySchedule", + "name": "SurveySchedule", + "properties": [ + { + "type": "\"always\"", + "name": "Always" + }, + { + "type": "\"once\"", + "name": "Once" + }, + { + "type": "\"recurring\"", + "name": "Recurring" + } + ], + "path": "../core/src/types.ts" + }, { "id": "SurveyType", "name": "SurveyType", @@ -3321,6 +3718,40 @@ ], "path": "../core/src/types.ts" }, + { + "id": "SurveyValidationRule", + "name": "SurveyValidationRule", + "properties": [ + { + "type": "string", + "name": "errorMessage" + }, + { + "type": "SurveyValidationType", + "name": "type" + }, + { + "type": "number", + "name": "value" + } + ], + "path": "../core/src/types.ts" + }, + { + "id": "SurveyValidationType", + "name": "SurveyValidationType", + "properties": [ + { + "type": "\"max_length\"", + "name": "MaxLength" + }, + { + "type": "\"min_length\"", + "name": "MinLength" + } + ], + "path": "../core/src/types.ts" + }, { "id": "SurveyWidgetType", "name": "SurveyWidgetType", From 99b6dcddae26745648f487fd6caaacad16ac26e9 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 24 Feb 2026 12:11:49 -0500 Subject: [PATCH 3/5] Reset old refernces --- .../posthog-node-references-5.19.0.json | 2498 ++--------------- 1 file changed, 169 insertions(+), 2329 deletions(-) diff --git a/packages/node/references/posthog-node-references-5.19.0.json b/packages/node/references/posthog-node-references-5.19.0.json index 6fac00dc5e..5b7fd27c6e 100644 --- a/packages/node/references/posthog-node-references-5.19.0.json +++ b/packages/node/references/posthog-node-references-5.19.0.json @@ -1082,2423 +1082,263 @@ "name": "T" }, "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "addPendingPromise", - "showDocs": true, - "title": "addPendingPromise", - "examples": [ - { - "id": "addpendingpromise", - "name": "Generated example for addPendingPromise", - "code": "// Generated example for addPendingPromise\nposthog.addPendingPromise();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "Promise", - "name": "promise" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "aliasStateless", - "showDocs": true, - "title": "aliasStateless", - "examples": [ - { - "id": "aliasstateless", - "name": "Generated example for aliasStateless", - "code": "// Generated example for aliasStateless\nposthog.aliasStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "alias" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "aliasStatelessImmediate", - "showDocs": true, - "title": "aliasStatelessImmediate", - "examples": [ - { - "id": "aliasstatelessimmediate", - "name": "Generated example for aliasStatelessImmediate", - "code": "// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "alias" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "captureStateless", - "showDocs": true, - "title": "captureStateless", - "examples": [ - { - "id": "capturestateless", - "name": "Generated example for captureStateless", - "code": "// Generated example for captureStateless\nposthog.captureStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "event" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "captureStatelessImmediate", - "showDocs": true, - "title": "captureStatelessImmediate", - "examples": [ - { - "id": "capturestatelessimmediate", - "name": "Generated example for captureStatelessImmediate", - "code": "// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "event" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** QUEUEING AND FLUSHING *", - "details": null, - "id": "enqueue", - "showDocs": true, - "title": "enqueue", - "examples": [ - { - "id": "enqueue", - "name": "Generated example for enqueue", - "code": "// Generated example for enqueue\nposthog.enqueue();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "fetch", - "showDocs": true, - "title": "fetch", - "examples": [ - { - "id": "fetch", - "name": "Generated example for fetch", - "code": "// Generated example for fetch\nposthog.fetch();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "url" - }, - { - "description": "", - "isOptional": false, - "type": "PostHogFetchOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "Initialization", - "description": "Flushes the queue of pending events.\nThis function will return a promise that will resolve when the flush is complete, or reject if there was an error (for example if the server or network is down).\nIf there is already a flush in progress, this function will wait for that flush to complete.\nIt's recommended to do error handling in the callback of the promise.", - "details": null, - "id": "flush", - "showDocs": true, - "title": "flush", - "examples": [ - { - "id": "flush_with_error_handling", - "name": "flush with error handling", - "code": "\n\n// flush with error handling\nposthog.flush().then(() => {\n console.log('Flush complete')\n}).catch((err) => {\n console.error('Flush failed', err)\n})\n\n\n" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getCommonEventProperties", - "showDocs": true, - "title": "getCommonEventProperties", - "examples": [ - { - "id": "getcommoneventproperties", - "name": "Generated example for getCommonEventProperties", - "code": "// Generated example for getCommonEventProperties\nposthog.getCommonEventProperties();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "PostHogEventProperties", - "name": "PostHogEventProperties" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getCustomHeaders", - "showDocs": true, - "title": "getCustomHeaders", - "examples": [ - { - "id": "getcustomheaders", - "name": "Generated example for getCustomHeaders", - "code": "// Generated example for getCustomHeaders\nposthog.getCustomHeaders();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "{\n [key: string]: string;\n }", - "name": "{\n [key: string]: string;\n }" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagDetailsStateless", - "showDocs": true, - "title": "getFeatureFlagDetailsStateless", - "examples": [ - { - "id": "getfeatureflagdetailsstateless", - "name": "Generated example for getFeatureFlagDetailsStateless", - "code": "// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagDetailStateless", - "showDocs": true, - "title": "getFeatureFlagDetailStateless", - "examples": [ - { - "id": "getfeatureflagdetailstateless", - "name": "Generated example for getFeatureFlagDetailStateless", - "code": "// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>", - "name": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagPayloadsStateless", - "showDocs": true, - "title": "getFeatureFlagPayloadsStateless", - "examples": [ - { - "id": "getfeatureflagpayloadsstateless", - "name": "Generated example for getFeatureFlagPayloadsStateless", - "code": "// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagPayloadStateless", - "showDocs": true, - "title": "getFeatureFlagPayloadStateless", - "examples": [ - { - "id": "getfeatureflagpayloadstateless", - "name": "Generated example for getFeatureFlagPayloadStateless", - "code": "// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagsAndPayloadsStateless", - "showDocs": true, - "title": "getFeatureFlagsAndPayloadsStateless", - "examples": [ - { - "id": "getfeatureflagsandpayloadsstateless", - "name": "Generated example for getFeatureFlagsAndPayloadsStateless", - "code": "// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", - "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagsStateless", - "showDocs": true, - "title": "getFeatureFlagsStateless", - "examples": [ - { - "id": "getfeatureflagsstateless", - "name": "Generated example for getFeatureFlagsStateless", - "code": "// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", - "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagStateless", - "showDocs": true, - "title": "getFeatureFlagStateless", - "examples": [ - { - "id": "getfeatureflagstateless", - "name": "Generated example for getFeatureFlagStateless", - "code": "// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>", - "name": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** FEATURE FLAGS *", - "details": null, - "id": "getFlags", - "showDocs": true, - "title": "getFlags", - "examples": [ - { - "id": "getflags", - "name": "Generated example for getFlags", - "code": "// Generated example for getFlags\nposthog.getFlags();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "extraPayload" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "fetchConfig" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getRemoteConfig", - "showDocs": true, - "title": "getRemoteConfig", - "examples": [ - { - "id": "getremoteconfig", - "name": "Generated example for getRemoteConfig", - "code": "// Generated example for getRemoteConfig\nposthog.getRemoteConfig();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** SURVEYS *", - "details": null, - "id": "getSurveysStateless", - "showDocs": true, - "title": "getSurveysStateless", - "examples": [ - { - "id": "getsurveysstateless", - "name": "Generated example for getSurveysStateless", - "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** GROUPS *", - "details": null, - "id": "groupIdentifyStateless", - "showDocs": true, - "title": "groupIdentifyStateless", - "examples": [ - { - "id": "groupidentifystateless", - "name": "Generated example for groupIdentifyStateless", - "code": "// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "groupType" - }, - { - "description": "", - "isOptional": false, - "type": "string | number", - "name": "groupKey" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - }, - { - "description": "", - "isOptional": true, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "eventProperties" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** TRACKING *", - "details": null, - "id": "identifyStateless", - "showDocs": true, - "title": "identifyStateless", - "examples": [ - { - "id": "identifystateless", - "name": "Generated example for identifyStateless", - "code": "// Generated example for identifyStateless\nposthog.identifyStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "identifyStatelessImmediate", - "showDocs": true, - "title": "identifyStatelessImmediate", - "examples": [ - { - "id": "identifystatelessimmediate", - "name": "Generated example for identifyStatelessImmediate", - "code": "// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "logMsgIfDebug", - "showDocs": true, - "title": "logMsgIfDebug", - "examples": [ - { - "id": "logmsgifdebug", - "name": "Generated example for logMsgIfDebug", - "code": "// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "() => void", - "name": "fn" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "on", - "showDocs": true, - "title": "on", - "examples": [ - { - "id": "on", - "name": "Generated example for on", - "code": "// Generated example for on\nposthog.on();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "event" - }, - { - "description": "", - "isOptional": false, - "type": "(...args: any[]) => void", - "name": "cb" - } - ], - "returnType": { - "id": "() => void", - "name": "() => void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "optIn", - "showDocs": true, - "title": "optIn", - "examples": [ - { - "id": "optin", - "name": "Generated example for optIn", - "code": "// Generated example for optIn\nposthog.optIn();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "optOut", - "showDocs": true, - "title": "optOut", - "examples": [ - { - "id": "optout", - "name": "Generated example for optOut", - "code": "// Generated example for optOut\nposthog.optOut();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "register", - "showDocs": true, - "title": "register", - "examples": [ - { - "id": "register", - "name": "Generated example for register", - "code": "// Generated example for register\nposthog.register();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "PostHogEventProperties", - "name": "properties" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "sendImmediate", - "showDocs": true, - "title": "sendImmediate", - "examples": [ - { - "id": "sendimmediate", - "name": "Generated example for sendImmediate", - "code": "// Generated example for sendImmediate\nposthog.sendImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "Initialization", - "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", - "details": null, - "id": "shutdown", - "showDocs": true, - "title": "shutdown", - "examples": [ - { - "id": "shutdown_before_process_exit", - "name": "shutdown before process exit", - "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "Maximum time to wait for shutdown in milliseconds", - "isOptional": true, - "type": "number", - "name": "shutdownTimeoutMs" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "unregister", - "showDocs": true, - "title": "unregister", - "examples": [ - { - "id": "unregister", - "name": "Generated example for unregister", - "code": "// Generated example for unregister\nposthog.unregister();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "property" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "wrap", - "showDocs": true, - "title": "wrap", - "examples": [ - { - "id": "wrap", - "name": "Generated example for wrap", - "code": "// Generated example for wrap\nposthog.wrap();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "() => void", - "name": "fn" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - } - ] - } - ], - "types": [ - { - "id": "_SentryEvent", - "name": "_SentryEvent", - "properties": [], - "path": "src/extensions/sentry-integration.ts" - }, - { - "id": "_SentryEventProcessor", - "name": "_SentryEventProcessor", - "properties": [], - "path": "src/extensions/sentry-integration.ts" - }, - { - "id": "_SentryHub", - "name": "_SentryHub", - "properties": [], - "path": "src/extensions/sentry-integration.ts" - }, - { - "id": "_SentryIntegration", - "name": "_SentryIntegration", - "properties": [ - { - "type": "string", - "name": "name" - } - ], - "path": "src/extensions/sentry-integration.ts" - }, - { - "id": "_SentryIntegrationClass", - "name": "_SentryIntegrationClass", - "properties": [ - { - "type": "string", - "name": "name" - } - ], - "path": "src/extensions/sentry-integration.ts" - }, - { - "id": "ActionStepStringMatching", - "name": "ActionStepStringMatching", - "properties": [ - { - "type": "\"contains\"", - "name": "Contains" - }, - { - "type": "\"exact\"", - "name": "Exact" - }, - { - "type": "\"regex\"", - "name": "Regex" - } - ], - "path": "../core/src/types.ts" - }, - { - "id": "ActionStepType", - "name": "ActionStepType", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n event?: string;\n selector?: string;\n text?: string;\n text_matching?: ActionStepStringMatching;\n href?: string;\n href_matching?: ActionStepStringMatching;\n url?: string;\n url_matching?: ActionStepStringMatching;\n}" - }, - { - "id": "BaseException", - "name": "BaseException", - "properties": [ - { - "type": "boolean", - "name": "synthetic" - }, - { - "type": "string", - "name": "type" - }, - { - "type": "string", - "name": "value" - } - ], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "BasicSurveyQuestion", - "name": "BasicSurveyQuestion", - "properties": [], - "path": "../core/src/types.ts", - "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Open;\n}" - }, - { - "id": "BeforeSendFn", - "name": "BeforeSendFn", - "properties": [], - "path": "src/types.ts", - "example": "(event: EventMessage | null) => EventMessage | null" - }, - { - "id": "ChunkIdMapType", - "name": "ChunkIdMapType", - "properties": [], - "path": "../core/src/error-tracking/types.ts", - "example": "Record" - }, - { - "id": "Coercer", - "name": "Coercer", - "properties": [], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "CoercingContext", - "name": "CoercingContext", - "properties": [ - { - "type": "(input: unknown) => ExceptionLike", - "name": "apply" - }, - { - "type": "(input: unknown) => ExceptionLike | undefined", - "name": "next" - } - ], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "Compression", - "name": "Compression", - "properties": [ - { - "type": "\"base64\"", - "name": "Base64" - }, - { - "type": "\"gzip-js\"", - "name": "GZipJS" - } - ], - "path": "../core/src/types.ts" - }, - { - "id": "ContextData", - "name": "ContextData", - "properties": [ - { - "type": "string", - "name": "distinctId" - }, - { - "type": "Record", - "name": "properties" - }, - { - "type": "string", - "name": "sessionId" - } - ], - "path": "src/extensions/context/types.ts" - }, - { - "id": "ContextOptions", - "name": "ContextOptions", - "properties": [ - { - "description": "If true, replaces the current context entirely. If false, merges with the existing context (new values override existing ones). false", - "type": "boolean", - "name": "fresh" - } - ], - "path": "src/extensions/context/types.ts" - }, - { - "id": "EndBranching", - "name": "EndBranching", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n type: SurveyQuestionBranchingType.End;\n}" - }, - { - "id": "ErrorProperties", - "name": "ErrorProperties", - "properties": [ - { - "type": "SeverityLevel", - "name": "$exception_level" - }, - { - "type": "Exception[]", - "name": "$exception_list" - } - ], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "ErrorTrackingCoercer", - "name": "ErrorTrackingCoercer", - "properties": [], - "path": "../core/src/error-tracking/types.ts", - "example": "Coercer" - }, - { - "id": "EvaluationReason", - "name": "EvaluationReason", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n code: string | undefined;\n condition_index: number | undefined;\n description: string | undefined;\n}" - }, - { - "id": "EventHint", - "name": "EventHint", - "properties": [ - { - "type": "Partial", - "name": "mechanism" - }, - { - "type": "Error | null", - "name": "syntheticException" - } - ], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "EventMessage", - "name": "EventMessage", - "properties": [], - "path": "src/types.ts", - "example": "Omit & {\n distinctId?: string;\n event: string;\n groups?: Record;\n sendFeatureFlags?: boolean | SendFeatureFlagsOptions;\n timestamp?: Date;\n uuid?: string;\n}" - }, - { - "id": "Exception", - "name": "Exception", - "properties": [ - { - "type": "Mechanism", - "name": "mechanism" - }, - { - "type": "string", - "name": "module" - }, - { - "type": "{\n frames?: StackFrame[];\n type: 'raw';\n }", - "name": "stacktrace" - }, - { - "type": "number", - "name": "thread_id" - }, - { - "type": "string", - "name": "type" - }, - { - "type": "string", - "name": "value" - } - ], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "ExceptionLike", - "name": "ExceptionLike", - "properties": [ - { - "type": "ExceptionLike", - "name": "cause" - }, - { - "type": "SeverityLevel", - "name": "level" - }, - { - "type": "string", - "name": "stack" - } - ], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "ExceptionList", - "name": "ExceptionList", - "properties": [], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "ExpressErrorMiddleware", - "name": "ExpressErrorMiddleware", - "properties": [], - "path": "src/extensions/express.ts", - "example": "(error: MiddlewareError, req: Request, res: Response, next: (error: MiddlewareError) => void) => void" - }, - { - "id": "ExpressMiddleware", - "name": "ExpressMiddleware", - "properties": [], - "path": "src/extensions/express.ts", - "example": "(req: Request, res: Response, next: () => void) => void" - }, - { - "id": "FeatureFlagCondition", - "name": "FeatureFlagCondition", - "properties": [], - "path": "src/types.ts", - "example": "{\n properties: FlagProperty[];\n rollout_percentage?: number;\n variant?: string;\n}" - }, - { - "id": "FeatureFlagDetail", - "name": "FeatureFlagDetail", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n reason: EvaluationReason | undefined;\n metadata: FeatureFlagMetadata | undefined;\n}" - }, - { - "id": "FeatureFlagErrorType", - "name": "FeatureFlagErrorType", - "properties": [], - "path": "src/types.ts", - "example": "(typeof FeatureFlagError)[keyof typeof FeatureFlagError] | string" - }, - { - "id": "FeatureFlagMetadata", - "name": "FeatureFlagMetadata", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n id: number | undefined;\n version: number | undefined;\n description: string | undefined;\n payload: string | undefined;\n}" - }, - { - "id": "FeatureFlagOverrideOptions", - "name": "FeatureFlagOverrideOptions", - "properties": [], - "path": "src/types.ts", - "example": "{\n flags?: false | string[] | Record;\n payloads?: false | Record;\n}" - }, - { - "id": "FeatureFlagValue", - "name": "FeatureFlagValue", - "properties": [], - "path": "../core/src/types.ts", - "example": "string | boolean" - }, - { - "id": "FlagDefinitionCacheData", - "name": "FlagDefinitionCacheData", - "properties": [ - { - "description": "Cohort property groups for local evaluation", - "type": "Record", - "name": "cohorts" - }, - { - "description": "Array of feature flag definitions", - "type": "PostHogFeatureFlag[]", - "name": "flags" - }, - { - "description": "Mapping of group type index to group name", - "type": "Record", - "name": "groupTypeMapping" - } - ], - "path": "src/extensions/feature-flags/cache.ts" - }, - { - "id": "FlagDefinitionCacheProvider", - "name": "FlagDefinitionCacheProvider", - "properties": [], - "path": "src/extensions/feature-flags/cache.ts" - }, - { - "id": "FlagProperty", - "name": "FlagProperty", - "properties": [], - "path": "src/types.ts", - "example": "{\n key: string;\n type?: string;\n value: FlagPropertyValue;\n operator?: string;\n negation?: boolean;\n dependency_chain?: string[];\n}" - }, - { - "id": "FlagPropertyValue", - "name": "FlagPropertyValue", - "properties": [], - "path": "src/types.ts", - "example": "string | number | (string | number)[] | boolean" - }, - { - "id": "GetModuleFn", - "name": "GetModuleFn", - "properties": [], - "path": "../core/src/error-tracking/types.ts", - "example": "(filename: string | undefined) => string | undefined" - }, - { - "id": "GroupIdentifyMessage", - "name": "GroupIdentifyMessage", - "properties": [], - "path": "src/types.ts", - "example": "{\n groupType: string;\n groupKey: string;\n properties?: Record;\n distinctId?: string;\n disableGeoip?: boolean;\n}" - }, - { - "id": "IdentifyMessage", - "name": "IdentifyMessage", - "properties": [], - "path": "src/types.ts", - "example": "{\n distinctId: string;\n properties?: Record;\n disableGeoip?: boolean;\n}" - }, - { - "id": "IPostHog", - "name": "IPostHog", - "properties": [], - "path": "src/types.ts" - }, - { - "id": "IPostHogContext", - "name": "IPostHogContext", - "properties": [], - "path": "src/extensions/context/types.ts" - }, - { - "id": "JsonType", - "name": "JsonType", - "properties": [], - "path": "../core/src/types.ts", - "example": "string | number | boolean | null | {\n [key: string]: JsonType;\n} | Array | JsonType[]" - }, - { - "id": "LinkSurveyQuestion", - "name": "LinkSurveyQuestion", - "properties": [], - "path": "../core/src/types.ts", - "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Link;\n link?: string;\n}" - }, - { - "id": "Logger", - "name": "Logger", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n info: (...args: any[]) => void;\n warn: (...args: any[]) => void;\n error: (...args: any[]) => void;\n critical: (...args: any[]) => void;\n createLogger: (prefix: string) => Logger;\n}" - }, - { - "id": "Mechanism", - "name": "Mechanism", - "properties": [ - { - "type": "boolean", - "name": "handled" - }, - { - "type": "string", - "name": "source" - }, - { - "type": "boolean", - "name": "synthetic" - }, - { - "type": "'generic' | 'onunhandledrejection' | 'onuncaughtexception' | 'onconsole' | 'middleware'", - "name": "type" - } - ], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "MiddlewareError", - "name": "MiddlewareError", - "properties": [ - { - "type": "{\n statusCode?: number | string;\n }", - "name": "output" - }, - { - "type": "number | string", - "name": "status_code" - }, - { - "type": "number | string", - "name": "status" - }, - { - "type": "number | string", - "name": "statusCode" - } - ], - "path": "src/extensions/express.ts" - }, - { - "id": "MultipleSurveyQuestion", - "name": "MultipleSurveyQuestion", - "properties": [], - "path": "../core/src/types.ts", - "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n choices: string[];\n hasOpenChoice?: boolean;\n shuffleOptions?: boolean;\n}" - }, - { - "id": "NextQuestionBranching", - "name": "NextQuestionBranching", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n type: SurveyQuestionBranchingType.NextQuestion;\n}" - }, - { - "id": "ObjectLike", - "name": "ObjectLike", - "properties": [], - "path": "../core/src/error-tracking/coercers/object-coercer.ts", - "example": "Record" - }, - { - "id": "OverrideFeatureFlagsOptions", - "name": "OverrideFeatureFlagsOptions", - "properties": [], - "path": "src/types.ts", - "example": "false | string[] | Record | FeatureFlagOverrideOptions" - }, - { - "id": "ParsedException", - "name": "ParsedException", - "properties": [ - { - "type": "ParsedException", - "name": "cause" - }, - { - "type": "StackFrame[]", - "name": "stack" - } - ], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "ParsingContext", - "name": "ParsingContext", - "properties": [ - { - "type": "ChunkIdMapType", - "name": "chunkIdMap" - } - ], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "PartialWithRequired", - "name": "PartialWithRequired", - "properties": [], - "path": "../core/src/types.ts", - "example": "keyof T> = {\n [P in K]: T[P];\n} & {\n [P in Exclude]?: T[P];\n}" - }, - { - "id": "Platform", - "name": "Platform", - "properties": [], - "path": "../core/src/error-tracking/types.ts", - "example": "\"node:javascript\" | \"web:javascript\" | \"hermes\"" - }, - { - "id": "PolymorphicEvent", - "name": "PolymorphicEvent", - "properties": [ - { - "type": "unknown", - "name": "currentTarget" - }, - { - "type": "unknown", - "name": "target" - }, - { - "type": "string", - "name": "type" - } - ], - "path": "../core/src/error-tracking/types.ts" - }, - { - "id": "PostHogCaptureOptions", - "name": "PostHogCaptureOptions", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n uuid?: string;\n timestamp?: Date;\n disableGeoip?: boolean;\n}" - }, - { - "id": "PostHogCoreOptions", - "name": "PostHogCoreOptions", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n host?: string;\n flushAt?: number;\n flushInterval?: number;\n maxBatchSize?: number;\n maxQueueSize?: number;\n disabled?: boolean;\n defaultOptIn?: boolean;\n sendFeatureFlagEvent?: boolean;\n preloadFeatureFlags?: boolean;\n disableRemoteConfig?: boolean;\n disableSurveys?: boolean;\n bootstrap?: {\n distinctId?: string;\n isIdentifiedId?: boolean;\n featureFlags?: Record;\n featureFlagPayloads?: Record;\n };\n fetchRetryCount?: number;\n fetchRetryDelay?: number;\n requestTimeout?: number;\n featureFlagsRequestTimeoutMs?: number;\n remoteConfigRequestTimeoutMs?: number;\n sessionExpirationTimeSeconds?: number;\n disableCompression?: boolean;\n disableGeoip?: boolean;\n historicalMigration?: boolean;\n evaluationEnvironments?: readonly string[];\n}" - }, - { - "id": "PostHogEventProperties", - "name": "PostHogEventProperties", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n [key: string]: JsonType;\n}" - }, - { - "id": "PostHogFeatureFlag", - "name": "PostHogFeatureFlag", - "properties": [], - "path": "src/types.ts", - "example": "{\n id: number;\n name: string;\n key: string;\n filters?: {\n aggregation_group_type_index?: number;\n groups?: FeatureFlagCondition[];\n multivariate?: {\n variants: {\n key: string;\n rollout_percentage: number;\n }[];\n };\n payloads?: Record;\n };\n deleted: boolean;\n active: boolean;\n rollout_percentage: null | number;\n ensure_experience_continuity: boolean;\n experiment_set: number[];\n}" - }, - { - "id": "PostHogFeatureFlagDetails", - "name": "PostHogFeatureFlagDetails", - "properties": [], - "path": "../core/src/types.ts", - "example": "\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\"" - }, - { - "id": "PostHogFetchOptions", - "name": "PostHogFetchOptions", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n method: 'GET' | 'POST' | 'PUT' | 'PATCH';\n mode?: 'no-cors';\n credentials?: 'omit';\n headers: {\n [key: string]: string;\n };\n body?: string | Blob;\n signal?: AbortSignal;\n}" - }, - { - "id": "PostHogFetchResponse", - "name": "PostHogFetchResponse", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n status: number;\n text: () => Promise;\n json: () => Promise;\n headers?: {\n get(name: string): string | null;\n };\n}" - }, - { - "id": "PostHogFlagsAndPayloadsResponse", - "name": "PostHogFlagsAndPayloadsResponse", - "properties": [], - "path": "../core/src/types.ts", - "example": "\"featureFlags\" | \"featureFlagPayloads\"" - }, - { - "id": "PostHogFlagsResponse", - "name": "PostHogFlagsResponse", - "properties": [], - "path": "../core/src/types.ts", - "example": "Omit & {\n featureFlags: {\n [key: string]: FeatureFlagValue;\n };\n featureFlagPayloads: {\n [key: string]: JsonType;\n };\n flags: {\n [key: string]: FeatureFlagDetail;\n };\n errorsWhileComputingFlags: boolean;\n sessionRecording?: boolean | {\n [key: string]: JsonType;\n };\n quotaLimited?: string[];\n requestId?: string;\n evaluatedAt?: number;\n}" - }, - { - "id": "PostHogOptions", - "name": "PostHogOptions", - "properties": [], - "path": "src/types.ts", - "example": "PostHogCoreOptions & {\n persistence?: 'memory';\n personalApiKey?: string;\n privacyMode?: boolean;\n enableExceptionAutocapture?: boolean;\n featureFlagsPollingInterval?: number;\n maxCacheSize?: number;\n fetch?: (url: string, options: PostHogFetchOptions) => Promise;\n enableLocalEvaluation?: boolean;\n flagDefinitionCacheProvider?: FlagDefinitionCacheProvider;\n before_send?: BeforeSendFn | BeforeSendFn[];\n evaluationEnvironments?: readonly string[];\n custom_blocked_useragents?: string[];\n __preview_capture_bot_pageviews?: boolean;\n}" - }, - { - "id": "PostHogPersistedProperty", - "name": "PostHogPersistedProperty", - "properties": [ - { - "type": "\"anonymous_id\"", - "name": "AnonymousId" - }, - { - "type": "\"bootstrap_feature_flag_details\"", - "name": "BootstrapFeatureFlagDetails" - }, - { - "type": "\"bootstrap_feature_flag_payloads\"", - "name": "BootstrapFeatureFlagPayloads" - }, - { - "type": "\"bootstrap_feature_flags\"", - "name": "BootstrapFeatureFlags" - }, - { - "type": "\"distinct_id\"", - "name": "DistinctId" - }, - { - "type": "\"feature_flag_details\"", - "name": "FeatureFlagDetails" - }, - { - "type": "\"feature_flag_payloads\"", - "name": "FeatureFlagPayloads" - }, - { - "type": "\"feature_flags\"", - "name": "FeatureFlags" - }, - { - "type": "\"flags_endpoint_was_hit\"", - "name": "FlagsEndpointWasHit" - }, - { - "type": "\"group_properties\"", - "name": "GroupProperties" - }, - { - "type": "\"installed_app_build\"", - "name": "InstalledAppBuild" - }, - { - "type": "\"installed_app_version\"", - "name": "InstalledAppVersion" - }, - { - "type": "\"opted_out\"", - "name": "OptedOut" - }, - { - "type": "\"override_feature_flags\"", - "name": "OverrideFeatureFlags" - }, - { - "type": "\"person_properties\"", - "name": "PersonProperties" - }, - { - "type": "\"props\"", - "name": "Props" - }, - { - "type": "\"queue\"", - "name": "Queue" - }, - { - "type": "\"remote_config\"", - "name": "RemoteConfig" - }, - { - "type": "\"session_id\"", - "name": "SessionId" - }, - { - "type": "\"session_timestamp\"", - "name": "SessionLastTimestamp" - }, - { - "type": "\"session_replay\"", - "name": "SessionReplay" - }, - { - "type": "\"session_start_timestamp\"", - "name": "SessionStartTimestamp" - }, - { - "type": "\"survey_last_seen_date\"", - "name": "SurveyLastSeenDate" - }, - { - "type": "\"surveys\"", - "name": "Surveys" - }, - { - "type": "\"surveys_seen\"", - "name": "SurveysSeen" - } - ], - "path": "../core/src/types.ts" - }, - { - "id": "PostHogRemoteConfig", - "name": "PostHogRemoteConfig", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n sessionRecording?: boolean | {\n [key: string]: JsonType;\n };\n supportedCompression?: Compression[];\n surveys?: boolean | Survey[];\n hasFeatureFlags?: boolean;\n}" - }, - { - "id": "PrimitiveType", - "name": "PrimitiveType", - "properties": [], - "path": "../core/src/error-tracking/coercers/primitive-coercer.ts", - "example": "null | undefined | boolean | number | string | symbol | bigint" - }, - { - "id": "PropertyGroup", - "name": "PropertyGroup", - "properties": [], - "path": "src/types.ts", - "example": "{\n type: 'AND' | 'OR';\n values: PropertyGroup[] | FlagProperty[];\n}" - }, - { - "id": "RatingSurveyQuestion", - "name": "RatingSurveyQuestion", - "properties": [], - "path": "../core/src/types.ts", - "example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Rating;\n display: SurveyRatingDisplay;\n scale: 3 | 5 | 7 | 10;\n lowerBoundLabel: string;\n upperBoundLabel: string;\n}" - }, - { - "id": "ResponseBasedBranching", - "name": "ResponseBasedBranching", - "properties": [], - "path": "../core/src/types.ts", - "example": "{\n type: SurveyQuestionBranchingType.ResponseBased;\n responseValues: Record;\n}" - }, - { - "id": "RetriableOptions", - "name": "RetriableOptions", - "properties": [ - { - "type": "(err: unknown) => boolean", - "name": "retryCheck" - }, - { - "type": "number", - "name": "retryCount" - }, - { - "type": "number", - "name": "retryDelay" } - ], - "path": "../core/src/utils/index.ts" - }, - { - "id": "SendFeatureFlagsOptions", - "name": "SendFeatureFlagsOptions", - "properties": [], - "path": "src/types.ts", - "example": "{\n onlyEvaluateLocally?: boolean;\n personProperties?: Record;\n groupProperties?: Record>;\n flagKeys?: string[];\n}" - }, + ] + } + ], + "types": [ { - "id": "SentryIntegrationOptions", - "name": "SentryIntegrationOptions", + "id": "_SentryEvent", + "name": "_SentryEvent", "properties": [], - "path": "src/extensions/sentry-integration.ts", - "example": "{\n organization?: string;\n projectId?: number;\n prefix?: string;\n severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n sendExceptionsToPostHog?: boolean;\n}" + "path": "src/extensions/sentry-integration.ts" }, { - "id": "SeverityLevel", - "name": "SeverityLevel", + "id": "_SentryEventProcessor", + "name": "_SentryEventProcessor", "properties": [], - "path": "../core/src/error-tracking/types.ts", - "example": "(typeof severityLevels)[number]" + "path": "src/extensions/sentry-integration.ts" }, { - "id": "SpecificQuestionBranching", - "name": "SpecificQuestionBranching", + "id": "_SentryHub", + "name": "_SentryHub", "properties": [], - "path": "../core/src/types.ts", - "example": "{\n type: SurveyQuestionBranchingType.SpecificQuestion;\n index: number;\n}" + "path": "src/extensions/sentry-integration.ts" }, { - "id": "StackFrame", - "name": "StackFrame", + "id": "_SentryIntegration", + "name": "_SentryIntegration", "properties": [ { "type": "string", - "name": "abs_path" - }, - { - "type": "string", - "name": "addr_mode" - }, + "name": "name" + } + ], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "_SentryIntegrationClass", + "name": "_SentryIntegrationClass", + "properties": [ { "type": "string", - "name": "chunk_id" - }, - { - "type": "number", - "name": "colno" - }, + "name": "name" + } + ], + "path": "src/extensions/sentry-integration.ts" + }, + { + "id": "BeforeSendFn", + "name": "BeforeSendFn", + "properties": [], + "path": "src/types.ts", + "example": "(event: EventMessage | null) => EventMessage | null" + }, + { + "id": "ContextData", + "name": "ContextData", + "properties": [ { "type": "string", - "name": "context_line" + "name": "distinctId" }, { - "type": "string", - "name": "filename" + "type": "Record", + "name": "properties" }, { "type": "string", - "name": "function" - }, + "name": "sessionId" + } + ], + "path": "src/extensions/context/types.ts" + }, + { + "id": "ContextOptions", + "name": "ContextOptions", + "properties": [ { + "description": "If true, replaces the current context entirely. If false, merges with the existing context (new values override existing ones). false", "type": "boolean", - "name": "in_app" - }, - { - "type": "string", - "name": "instruction_addr" - }, - { - "type": "number", - "name": "lineno" - }, - { - "type": "string", - "name": "module" - }, - { - "type": "Platform", - "name": "platform" - }, - { - "type": "string[]", - "name": "post_context" - }, - { - "type": "string[]", - "name": "pre_context" - }, - { - "type": "{\n [key: string]: JsonType;\n }", - "name": "vars" + "name": "fresh" } ], - "path": "../core/src/error-tracking/types.ts" + "path": "src/extensions/context/types.ts" }, { - "id": "StackFrameModifierFn", - "name": "StackFrameModifierFn", + "id": "EventMessage", + "name": "EventMessage", "properties": [], - "path": "../core/src/error-tracking/types.ts", - "example": "(frames: StackFrame[]) => Promise" + "path": "src/types.ts", + "example": "Omit & {\n distinctId?: string;\n event: string;\n groups?: Record;\n sendFeatureFlags?: boolean | SendFeatureFlagsOptions;\n timestamp?: Date;\n uuid?: string;\n}" }, { - "id": "StackLineParser", - "name": "StackLineParser", + "id": "ExpressErrorMiddleware", + "name": "ExpressErrorMiddleware", "properties": [], - "path": "../core/src/error-tracking/types.ts", - "example": "(line: string, platform: Platform) => StackFrame | undefined" + "path": "src/extensions/express.ts", + "example": "(error: MiddlewareError, req: Request, res: Response, next: (error: MiddlewareError) => void) => void" }, { - "id": "StackParser", - "name": "StackParser", + "id": "ExpressMiddleware", + "name": "ExpressMiddleware", "properties": [], - "path": "../core/src/error-tracking/types.ts", - "example": "(stack: string, skipFirstLines?: number) => StackFrame[]" + "path": "src/extensions/express.ts", + "example": "(req: Request, res: Response, next: () => void) => void" }, { - "id": "Survey", - "name": "Survey", + "id": "FeatureFlagCondition", + "name": "FeatureFlagCondition", "properties": [], - "path": "../core/src/types.ts", - "example": "{\n id: string;\n name: string;\n description?: string;\n type: SurveyType;\n feature_flag_keys?: {\n key: string;\n value?: string;\n }[];\n linked_flag_key?: string;\n targeting_flag_key?: string;\n internal_targeting_flag_key?: string;\n questions: SurveyQuestion[];\n appearance?: SurveyAppearance;\n conditions?: {\n url?: string;\n selector?: string;\n seenSurveyWaitPeriodInDays?: number;\n urlMatchType?: SurveyMatchType;\n events?: {\n repeatedActivation?: boolean;\n values?: {\n name: string;\n }[];\n };\n actions?: {\n values: SurveyActionType[];\n };\n deviceTypes?: string[];\n deviceTypesMatchType?: SurveyMatchType;\n linkedFlagVariant?: string;\n };\n start_date?: string;\n end_date?: string;\n current_iteration?: number;\n current_iteration_start_date?: string;\n}" + "path": "src/types.ts", + "example": "{\n properties: FlagProperty[];\n rollout_percentage?: number;\n variant?: string;\n}" }, { - "id": "SurveyActionType", - "name": "SurveyActionType", + "id": "FeatureFlagErrorType", + "name": "FeatureFlagErrorType", "properties": [], - "path": "../core/src/types.ts", - "example": "{\n id: number;\n name?: string;\n steps?: ActionStepType[];\n}" + "path": "src/types.ts", + "example": "(typeof FeatureFlagError)[keyof typeof FeatureFlagError] | string" }, { - "id": "SurveyAppearance", - "name": "SurveyAppearance", + "id": "FeatureFlagOverrideOptions", + "name": "FeatureFlagOverrideOptions", "properties": [], - "path": "../core/src/types.ts", - "example": "{\n backgroundColor?: string;\n textColor?: string;\n submitButtonColor?: string;\n submitButtonText?: string;\n submitButtonTextColor?: string;\n ratingButtonColor?: string;\n ratingButtonActiveColor?: string;\n inputBackground?: string;\n inputTextColor?: string;\n autoDisappear?: boolean;\n displayThankYouMessage?: boolean;\n thankYouMessageHeader?: string;\n thankYouMessageDescription?: string;\n thankYouMessageDescriptionContentType?: SurveyQuestionDescriptionContentType;\n thankYouMessageCloseButtonText?: string;\n borderColor?: string;\n position?: SurveyPosition;\n placeholder?: string;\n shuffleQuestions?: boolean;\n surveyPopupDelaySeconds?: number;\n widgetType?: SurveyWidgetType;\n widgetSelector?: string;\n widgetLabel?: string;\n widgetColor?: string;\n}" + "path": "src/types.ts", + "example": "{\n flags?: false | string[] | Record;\n payloads?: false | Record;\n}" }, { - "id": "SurveyMatchType", - "name": "SurveyMatchType", + "id": "FlagDefinitionCacheData", + "name": "FlagDefinitionCacheData", "properties": [ { - "type": "\"exact\"", - "name": "Exact" - }, - { - "type": "\"icontains\"", - "name": "Icontains" - }, - { - "type": "\"is_not\"", - "name": "IsNot" - }, - { - "type": "\"not_icontains\"", - "name": "NotIcontains" + "description": "Cohort property groups for local evaluation", + "type": "Record", + "name": "cohorts" }, { - "type": "\"not_regex\"", - "name": "NotRegex" + "description": "Array of feature flag definitions", + "type": "PostHogFeatureFlag[]", + "name": "flags" }, { - "type": "\"regex\"", - "name": "Regex" + "description": "Mapping of group type index to group name", + "type": "Record", + "name": "groupTypeMapping" } ], - "path": "../core/src/types.ts" + "path": "src/extensions/feature-flags/cache.ts" }, { - "id": "SurveyPosition", - "name": "SurveyPosition", - "properties": [ - { - "type": "\"center\"", - "name": "Center" - }, - { - "type": "\"left\"", - "name": "Left" - }, - { - "type": "\"middle_center\"", - "name": "MiddleCenter" - }, - { - "type": "\"middle_left\"", - "name": "MiddleLeft" - }, - { - "type": "\"middle_right\"", - "name": "MiddleRight" - }, - { - "type": "\"right\"", - "name": "Right" - }, - { - "type": "\"top_center\"", - "name": "TopCenter" - }, - { - "type": "\"top_left\"", - "name": "TopLeft" - }, - { - "type": "\"top_right\"", - "name": "TopRight" - } - ], - "path": "../core/src/types.ts" + "id": "FlagDefinitionCacheProvider", + "name": "FlagDefinitionCacheProvider", + "properties": [], + "path": "src/extensions/feature-flags/cache.ts" }, { - "id": "SurveyQuestion", - "name": "SurveyQuestion", + "id": "FlagProperty", + "name": "FlagProperty", "properties": [], - "path": "../core/src/types.ts", - "example": "BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion" + "path": "src/types.ts", + "example": "{\n key: string;\n type?: string;\n value: FlagPropertyValue;\n operator?: string;\n negation?: boolean;\n dependency_chain?: string[];\n}" }, { - "id": "SurveyQuestionBase", - "name": "SurveyQuestionBase", + "id": "FlagPropertyValue", + "name": "FlagPropertyValue", "properties": [], - "path": "../core/src/types.ts", - "example": "{\n question: string;\n id: string;\n description?: string;\n descriptionContentType?: SurveyQuestionDescriptionContentType;\n optional?: boolean;\n buttonText?: string;\n originalQuestionIndex: number;\n branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n}" + "path": "src/types.ts", + "example": "string | number | (string | number)[] | boolean" }, { - "id": "SurveyQuestionBranchingType", - "name": "SurveyQuestionBranchingType", - "properties": [ - { - "type": "\"end\"", - "name": "End" - }, - { - "type": "\"next_question\"", - "name": "NextQuestion" - }, - { - "type": "\"response_based\"", - "name": "ResponseBased" - }, - { - "type": "\"specific_question\"", - "name": "SpecificQuestion" - } - ], - "path": "../core/src/types.ts" + "id": "GroupIdentifyMessage", + "name": "GroupIdentifyMessage", + "properties": [], + "path": "src/types.ts", + "example": "{\n groupType: string;\n groupKey: string;\n properties?: Record;\n distinctId?: string;\n disableGeoip?: boolean;\n}" }, { - "id": "SurveyQuestionDescriptionContentType", - "name": "SurveyQuestionDescriptionContentType", - "properties": [ - { - "type": "\"html\"", - "name": "Html" - }, - { - "type": "\"text\"", - "name": "Text" - } - ], - "path": "../core/src/types.ts" + "id": "IdentifyMessage", + "name": "IdentifyMessage", + "properties": [], + "path": "src/types.ts", + "example": "{\n distinctId: string;\n properties?: Record;\n disableGeoip?: boolean;\n}" + }, + { + "id": "IPostHog", + "name": "IPostHog", + "properties": [], + "path": "src/types.ts" + }, + { + "id": "IPostHogContext", + "name": "IPostHogContext", + "properties": [], + "path": "src/extensions/context/types.ts" }, { - "id": "SurveyQuestionType", - "name": "SurveyQuestionType", + "id": "MiddlewareError", + "name": "MiddlewareError", "properties": [ { - "type": "\"link\"", - "name": "Link" - }, - { - "type": "\"multiple_choice\"", - "name": "MultipleChoice" + "type": "{\n statusCode?: number | string;\n }", + "name": "output" }, { - "type": "\"open\"", - "name": "Open" + "type": "number | string", + "name": "status_code" }, { - "type": "\"rating\"", - "name": "Rating" + "type": "number | string", + "name": "status" }, { - "type": "\"single_choice\"", - "name": "SingleChoice" + "type": "number | string", + "name": "statusCode" } ], - "path": "../core/src/types.ts" + "path": "src/extensions/express.ts" }, { - "id": "SurveyRatingDisplay", - "name": "SurveyRatingDisplay", - "properties": [ - { - "type": "\"emoji\"", - "name": "Emoji" - }, - { - "type": "\"number\"", - "name": "Number" - } - ], - "path": "../core/src/types.ts" + "id": "OverrideFeatureFlagsOptions", + "name": "OverrideFeatureFlagsOptions", + "properties": [], + "path": "src/types.ts", + "example": "false | string[] | Record | FeatureFlagOverrideOptions" }, { - "id": "SurveyResponse", - "name": "SurveyResponse", + "id": "PostHogFeatureFlag", + "name": "PostHogFeatureFlag", "properties": [], - "path": "../core/src/types.ts", - "example": "{\n surveys: Survey[];\n}" + "path": "src/types.ts", + "example": "{\n id: number;\n name: string;\n key: string;\n filters?: {\n aggregation_group_type_index?: number;\n groups?: FeatureFlagCondition[];\n multivariate?: {\n variants: {\n key: string;\n rollout_percentage: number;\n }[];\n };\n payloads?: Record;\n };\n deleted: boolean;\n active: boolean;\n rollout_percentage: null | number;\n ensure_experience_continuity: boolean;\n experiment_set: number[];\n}" }, { - "id": "SurveyType", - "name": "SurveyType", - "properties": [ - { - "type": "\"api\"", - "name": "API" - }, - { - "type": "\"external_survey\"", - "name": "ExternalSurvey" - }, - { - "type": "\"popover\"", - "name": "Popover" - }, - { - "type": "\"widget\"", - "name": "Widget" - } - ], - "path": "../core/src/types.ts" + "id": "PostHogOptions", + "name": "PostHogOptions", + "properties": [], + "path": "src/types.ts", + "example": "PostHogCoreOptions & {\n persistence?: 'memory';\n personalApiKey?: string;\n privacyMode?: boolean;\n enableExceptionAutocapture?: boolean;\n featureFlagsPollingInterval?: number;\n maxCacheSize?: number;\n fetch?: (url: string, options: PostHogFetchOptions) => Promise;\n enableLocalEvaluation?: boolean;\n flagDefinitionCacheProvider?: FlagDefinitionCacheProvider;\n before_send?: BeforeSendFn | BeforeSendFn[];\n evaluationEnvironments?: readonly string[];\n custom_blocked_useragents?: string[];\n __preview_capture_bot_pageviews?: boolean;\n}" }, { - "id": "SurveyWidgetType", - "name": "SurveyWidgetType", - "properties": [ - { - "type": "\"button\"", - "name": "Button" - }, - { - "type": "\"selector\"", - "name": "Selector" - }, - { - "type": "\"tab\"", - "name": "Tab" - } - ], - "path": "../core/src/types.ts" + "id": "PropertyGroup", + "name": "PropertyGroup", + "properties": [], + "path": "src/types.ts", + "example": "{\n type: 'AND' | 'OR';\n values: PropertyGroup[] | FlagProperty[];\n}" + }, + { + "id": "SendFeatureFlagsOptions", + "name": "SendFeatureFlagsOptions", + "properties": [], + "path": "src/types.ts", + "example": "{\n onlyEvaluateLocally?: boolean;\n personProperties?: Record;\n groupProperties?: Record>;\n flagKeys?: string[];\n}" + }, + { + "id": "SentryIntegrationOptions", + "name": "SentryIntegrationOptions", + "properties": [], + "path": "src/extensions/sentry-integration.ts", + "example": "{\n organization?: string;\n projectId?: number;\n prefix?: string;\n severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n sendExceptionsToPostHog?: boolean;\n}" } ], "categories": [ From e791093b0b4262bda5043ffbea9df87e7d1ad1c1 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Wed, 25 Feb 2026 11:29:18 -0500 Subject: [PATCH 4/5] Remove all protected methods --- packages/core/src/posthog-core-stateless.ts | 5 +- .../posthog-node-references-5.25.0.json | 1296 ++--------------- .../posthog-node-references-latest.json | 1296 ++--------------- ...osthog-react-native-references-4.36.0.json | 1259 +--------------- ...osthog-react-native-references-latest.json | 1259 +--------------- scripts/docs/methods.js | 13 +- 6 files changed, 246 insertions(+), 4882 deletions(-) diff --git a/packages/core/src/posthog-core-stateless.ts b/packages/core/src/posthog-core-stateless.ts index e15e796ee6..e87899d909 100644 --- a/packages/core/src/posthog-core-stateless.ts +++ b/packages/core/src/posthog-core-stateless.ts @@ -289,7 +289,10 @@ export abstract class PostHogCoreStateless { }, } } - + + /** + * @internal + */ public addPendingPromise(promise: Promise): Promise { return this.promiseQueue.add(promise) } diff --git a/packages/node/references/posthog-node-references-5.25.0.json b/packages/node/references/posthog-node-references-5.25.0.json index 2d1bf04a3e..96cf299e25 100644 --- a/packages/node/references/posthog-node-references-5.25.0.json +++ b/packages/node/references/posthog-node-references-5.25.0.json @@ -35,27 +35,6 @@ }, "path": "src/entrypoints/index.node.ts" }, - { - "category": "", - "details": null, - "id": "initializeContext", - "showDocs": true, - "title": "initializeContext", - "examples": [ - { - "id": "initializecontext", - "name": "Generated example for initializeContext", - "code": "// Generated example for initializeContext\nposthog.initializeContext();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "PostHogContext", - "name": "PostHogContext" - }, - "path": "src/entrypoints/index.node.ts" - }, { "category": "Initialization", "description": "Initialize a new PostHog client instance.", @@ -1138,14 +1117,14 @@ { "category": "", "details": null, - "id": "addPendingPromise", + "id": "fetch", "showDocs": true, - "title": "addPendingPromise", + "title": "fetch", "examples": [ { - "id": "addpendingpromise", - "name": "Generated example for addPendingPromise", - "code": "// Generated example for addPendingPromise\nposthog.addPendingPromise();" + "id": "fetch", + "name": "Generated example for fetch", + "code": "// Generated example for fetch\nposthog.fetch();" } ], "releaseTag": "public", @@ -1153,129 +1132,81 @@ { "description": "", "isOptional": false, - "type": "Promise", - "name": "promise" + "type": "string", + "name": "url" + }, + { + "description": "", + "isOptional": false, + "type": "PostHogFetchOptions", + "name": "options" } ], "returnType": { - "id": "Promise", - "name": "Promise" + "id": "Promise", + "name": "Promise" }, "path": "src/entrypoints/index.node.ts" }, { - "category": "", + "category": "Initialization", + "description": "Flushes the queue of pending events.\nThis function will return a promise that will resolve when the flush is complete, or reject if there was an error (for example if the server or network is down).\nIf there is already a flush in progress, this function will wait for that flush to complete.\nIt's recommended to do error handling in the callback of the promise.", "details": null, - "id": "aliasStateless", + "id": "flush", "showDocs": true, - "title": "aliasStateless", + "title": "flush", "examples": [ { - "id": "aliasstateless", - "name": "Generated example for aliasStateless", - "code": "// Generated example for aliasStateless\nposthog.aliasStateless();" + "id": "flush_with_error_handling", + "name": "flush with error handling", + "code": "\n\n// flush with error handling\nposthog.flush().then(() => {\n console.log('Flush complete')\n}).catch((err) => {\n console.error('Flush failed', err)\n})\n\n\n" } ], "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "alias" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], + "params": [], "returnType": { - "id": "void", - "name": "void" + "id": "Promise", + "name": "Promise" }, "path": "src/entrypoints/index.node.ts" }, { "category": "", + "description": "* ** SURVEYS *", "details": null, - "id": "aliasStatelessImmediate", + "id": "getSurveysStateless", "showDocs": true, - "title": "aliasStatelessImmediate", + "title": "getSurveysStateless", "examples": [ { - "id": "aliasstatelessimmediate", - "name": "Generated example for aliasStatelessImmediate", - "code": "// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();" + "id": "getsurveysstateless", + "name": "Generated example for getSurveysStateless", + "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" } ], "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "alias" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], + "params": [], "returnType": { - "id": "Promise", - "name": "Promise" + "id": "Promise", + "name": "Promise" }, "path": "src/entrypoints/index.node.ts" }, { "category": "", "details": null, - "id": "captureStateless", + "id": "on", "showDocs": true, - "title": "captureStateless", + "title": "on", "examples": [ { - "id": "capturestateless", - "name": "Generated example for captureStateless", - "code": "// Generated example for captureStateless\nposthog.captureStateless();" + "id": "on", + "name": "Generated example for on", + "code": "// Generated example for on\nposthog.on();" } ], "releaseTag": "public", "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, { "description": "", "isOptional": false, @@ -1284,63 +1215,32 @@ }, { "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" + "isOptional": false, + "type": "(...args: any[]) => void", + "name": "cb" } ], "returnType": { - "id": "void", - "name": "void" + "id": "() => void", + "name": "() => void" }, "path": "src/entrypoints/index.node.ts" }, { "category": "", "details": null, - "id": "captureStatelessImmediate", + "id": "optIn", "showDocs": true, - "title": "captureStatelessImmediate", + "title": "optIn", "examples": [ { - "id": "capturestatelessimmediate", - "name": "Generated example for captureStatelessImmediate", - "code": "// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();" + "id": "optin", + "name": "Generated example for optIn", + "code": "// Generated example for optIn\nposthog.optIn();" } ], "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "event" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], + "params": [], "returnType": { "id": "Promise", "name": "Promise" @@ -1350,54 +1250,35 @@ { "category": "", "details": null, - "id": "enqueue", + "id": "optOut", "showDocs": true, - "title": "enqueue", + "title": "optOut", "examples": [ { - "id": "enqueue", - "name": "Generated example for enqueue", - "code": "// Generated example for enqueue\nposthog.enqueue();" + "id": "optout", + "name": "Generated example for optOut", + "code": "// Generated example for optOut\nposthog.optOut();" } ], "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], + "params": [], "returnType": { - "id": "void", - "name": "void" + "id": "Promise", + "name": "Promise" }, "path": "src/entrypoints/index.node.ts" }, { "category": "", "details": null, - "id": "fetch", + "id": "register", "showDocs": true, - "title": "fetch", + "title": "register", "examples": [ { - "id": "fetch", - "name": "Generated example for fetch", - "code": "// Generated example for fetch\nposthog.fetch();" + "id": "register", + "name": "Generated example for register", + "code": "// Generated example for register\nposthog.register();" } ], "releaseTag": "public", @@ -1405,60 +1286,39 @@ { "description": "", "isOptional": false, - "type": "string", - "name": "url" - }, - { - "description": "", - "isOptional": false, - "type": "PostHogFetchOptions", - "name": "options" + "type": "PostHogEventProperties", + "name": "properties" } ], "returnType": { - "id": "Promise", - "name": "Promise" + "id": "Promise", + "name": "Promise" }, "path": "src/entrypoints/index.node.ts" }, { "category": "Initialization", - "description": "Flushes the queue of pending events.\nThis function will return a promise that will resolve when the flush is complete, or reject if there was an error (for example if the server or network is down).\nIf there is already a flush in progress, this function will wait for that flush to complete.\nIt's recommended to do error handling in the callback of the promise.", + "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", "details": null, - "id": "flush", + "id": "shutdown", "showDocs": true, - "title": "flush", + "title": "shutdown", "examples": [ { - "id": "flush_with_error_handling", - "name": "flush with error handling", - "code": "\n\n// flush with error handling\nposthog.flush().then(() => {\n console.log('Flush complete')\n}).catch((err) => {\n console.error('Flush failed', err)\n})\n\n\n" + "id": "shutdown_before_process_exit", + "name": "shutdown before process exit", + "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" } ], "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "Hook that allows subclasses to wait for storage operations to complete. This is called after queue changes are persisted during flush to ensure data is safely written to storage before considering events as sent.\nOverride this in implementations with async storage (e.g., React Native) to prevent duplicate events on app crash/restart scenarios.", - "details": null, - "id": "flushStorage", - "showDocs": true, - "title": "flushStorage", - "examples": [ + "params": [ { - "id": "flushstorage", - "name": "Generated example for flushStorage", - "code": "// Generated example for flushStorage\nposthog.flushStorage();" + "description": "Maximum time to wait for shutdown in milliseconds", + "isOptional": true, + "type": "number", + "name": "shutdownTimeoutMs" } ], - "releaseTag": "public", - "params": [], "returnType": { "id": "Promise", "name": "Promise" @@ -1468,978 +1328,18 @@ { "category": "", "details": null, - "id": "getCommonEventProperties", + "id": "unregister", "showDocs": true, - "title": "getCommonEventProperties", + "title": "unregister", "examples": [ { - "id": "getcommoneventproperties", - "name": "Generated example for getCommonEventProperties", - "code": "// Generated example for getCommonEventProperties\nposthog.getCommonEventProperties();" + "id": "unregister", + "name": "Generated example for unregister", + "code": "// Generated example for unregister\nposthog.unregister();" } ], "releaseTag": "public", - "params": [], - "returnType": { - "id": "PostHogEventProperties", - "name": "PostHogEventProperties" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getCustomHeaders", - "showDocs": true, - "title": "getCustomHeaders", - "examples": [ - { - "id": "getcustomheaders", - "name": "Generated example for getCustomHeaders", - "code": "// Generated example for getCustomHeaders\nposthog.getCustomHeaders();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "{\n [key: string]: string;\n }", - "name": "{\n [key: string]: string;\n }" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagDetailsStateless", - "showDocs": true, - "title": "getFeatureFlagDetailsStateless", - "examples": [ - { - "id": "getfeatureflagdetailsstateless", - "name": "Generated example for getFeatureFlagDetailsStateless", - "code": "// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagDetailStateless", - "showDocs": true, - "title": "getFeatureFlagDetailStateless", - "examples": [ - { - "id": "getfeatureflagdetailstateless", - "name": "Generated example for getFeatureFlagDetailStateless", - "code": "// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>", - "name": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagPayloadsStateless", - "showDocs": true, - "title": "getFeatureFlagPayloadsStateless", - "examples": [ - { - "id": "getfeatureflagpayloadsstateless", - "name": "Generated example for getFeatureFlagPayloadsStateless", - "code": "// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagPayloadStateless", - "showDocs": true, - "title": "getFeatureFlagPayloadStateless", - "examples": [ - { - "id": "getfeatureflagpayloadstateless", - "name": "Generated example for getFeatureFlagPayloadStateless", - "code": "// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagsAndPayloadsStateless", - "showDocs": true, - "title": "getFeatureFlagsAndPayloadsStateless", - "examples": [ - { - "id": "getfeatureflagsandpayloadsstateless", - "name": "Generated example for getFeatureFlagsAndPayloadsStateless", - "code": "// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", - "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagsStateless", - "showDocs": true, - "title": "getFeatureFlagsStateless", - "examples": [ - { - "id": "getfeatureflagsstateless", - "name": "Generated example for getFeatureFlagsStateless", - "code": "// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", - "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagStateless", - "showDocs": true, - "title": "getFeatureFlagStateless", - "examples": [ - { - "id": "getfeatureflagstateless", - "name": "Generated example for getFeatureFlagStateless", - "code": "// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>", - "name": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** FEATURE FLAGS *", - "details": null, - "id": "getFlags", - "showDocs": true, - "title": "getFlags", - "examples": [ - { - "id": "getflags", - "name": "Generated example for getFlags", - "code": "// Generated example for getFlags\nposthog.getFlags();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "extraPayload" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "fetchConfig" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getRemoteConfig", - "showDocs": true, - "title": "getRemoteConfig", - "examples": [ - { - "id": "getremoteconfig", - "name": "Generated example for getRemoteConfig", - "code": "// Generated example for getRemoteConfig\nposthog.getRemoteConfig();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** SURVEYS *", - "details": null, - "id": "getSurveysStateless", - "showDocs": true, - "title": "getSurveysStateless", - "examples": [ - { - "id": "getsurveysstateless", - "name": "Generated example for getSurveysStateless", - "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** GROUPS *", - "details": null, - "id": "groupIdentifyStateless", - "showDocs": true, - "title": "groupIdentifyStateless", - "examples": [ - { - "id": "groupidentifystateless", - "name": "Generated example for groupIdentifyStateless", - "code": "// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "groupType" - }, - { - "description": "", - "isOptional": false, - "type": "string | number", - "name": "groupKey" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - }, - { - "description": "", - "isOptional": true, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "eventProperties" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** TRACKING *", - "details": null, - "id": "identifyStateless", - "showDocs": true, - "title": "identifyStateless", - "examples": [ - { - "id": "identifystateless", - "name": "Generated example for identifyStateless", - "code": "// Generated example for identifyStateless\nposthog.identifyStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "identifyStatelessImmediate", - "showDocs": true, - "title": "identifyStatelessImmediate", - "examples": [ - { - "id": "identifystatelessimmediate", - "name": "Generated example for identifyStatelessImmediate", - "code": "// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "logMsgIfDebug", - "showDocs": true, - "title": "logMsgIfDebug", - "examples": [ - { - "id": "logmsgifdebug", - "name": "Generated example for logMsgIfDebug", - "code": "// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "() => void", - "name": "fn" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "on", - "showDocs": true, - "title": "on", - "examples": [ - { - "id": "on", - "name": "Generated example for on", - "code": "// Generated example for on\nposthog.on();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "event" - }, - { - "description": "", - "isOptional": false, - "type": "(...args: any[]) => void", - "name": "cb" - } - ], - "returnType": { - "id": "() => void", - "name": "() => void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "optIn", - "showDocs": true, - "title": "optIn", - "examples": [ - { - "id": "optin", - "name": "Generated example for optIn", - "code": "// Generated example for optIn\nposthog.optIn();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "optOut", - "showDocs": true, - "title": "optOut", - "examples": [ - { - "id": "optout", - "name": "Generated example for optOut", - "code": "// Generated example for optOut\nposthog.optOut();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "prepareMessage", - "showDocs": true, - "title": "prepareMessage", - "examples": [ - { - "id": "preparemessage", - "name": "Generated example for prepareMessage", - "code": "// Generated example for prepareMessage\nposthog.prepareMessage();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "PostHogEventProperties", - "name": "PostHogEventProperties" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "Hook that allows subclasses to transform or filter a message before it's queued. Return null to drop the message.", - "details": null, - "id": "processBeforeEnqueue", - "showDocs": true, - "title": "processBeforeEnqueue", - "examples": [ - { - "id": "processbeforeenqueue", - "name": "Generated example for processBeforeEnqueue", - "code": "// Generated example for processBeforeEnqueue\nposthog.processBeforeEnqueue();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "The prepared message", - "isOptional": false, - "type": "PostHogEventProperties", - "name": "message" - } - ], - "returnType": { - "id": "PostHogEventProperties | null", - "name": "PostHogEventProperties | null" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "register", - "showDocs": true, - "title": "register", - "examples": [ - { - "id": "register", - "name": "Generated example for register", - "code": "// Generated example for register\nposthog.register();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "PostHogEventProperties", - "name": "properties" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "sendImmediate", - "showDocs": true, - "title": "sendImmediate", - "examples": [ - { - "id": "sendimmediate", - "name": "Generated example for sendImmediate", - "code": "// Generated example for sendImmediate\nposthog.sendImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "Initialization", - "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", - "details": null, - "id": "shutdown", - "showDocs": true, - "title": "shutdown", - "examples": [ - { - "id": "shutdown_before_process_exit", - "name": "shutdown before process exit", - "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "Maximum time to wait for shutdown in milliseconds", - "isOptional": true, - "type": "number", - "name": "shutdownTimeoutMs" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "unregister", - "showDocs": true, - "title": "unregister", - "examples": [ - { - "id": "unregister", - "name": "Generated example for unregister", - "code": "// Generated example for unregister\nposthog.unregister();" - } - ], - "releaseTag": "public", - "params": [ + "params": [ { "description": "", "isOptional": false, @@ -2452,34 +1352,6 @@ "name": "Promise" }, "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "wrap", - "showDocs": true, - "title": "wrap", - "examples": [ - { - "id": "wrap", - "name": "Generated example for wrap", - "code": "// Generated example for wrap\nposthog.wrap();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "() => void", - "name": "fn" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" } ] } diff --git a/packages/node/references/posthog-node-references-latest.json b/packages/node/references/posthog-node-references-latest.json index 2d1bf04a3e..96cf299e25 100644 --- a/packages/node/references/posthog-node-references-latest.json +++ b/packages/node/references/posthog-node-references-latest.json @@ -35,27 +35,6 @@ }, "path": "src/entrypoints/index.node.ts" }, - { - "category": "", - "details": null, - "id": "initializeContext", - "showDocs": true, - "title": "initializeContext", - "examples": [ - { - "id": "initializecontext", - "name": "Generated example for initializeContext", - "code": "// Generated example for initializeContext\nposthog.initializeContext();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "PostHogContext", - "name": "PostHogContext" - }, - "path": "src/entrypoints/index.node.ts" - }, { "category": "Initialization", "description": "Initialize a new PostHog client instance.", @@ -1138,14 +1117,14 @@ { "category": "", "details": null, - "id": "addPendingPromise", + "id": "fetch", "showDocs": true, - "title": "addPendingPromise", + "title": "fetch", "examples": [ { - "id": "addpendingpromise", - "name": "Generated example for addPendingPromise", - "code": "// Generated example for addPendingPromise\nposthog.addPendingPromise();" + "id": "fetch", + "name": "Generated example for fetch", + "code": "// Generated example for fetch\nposthog.fetch();" } ], "releaseTag": "public", @@ -1153,129 +1132,81 @@ { "description": "", "isOptional": false, - "type": "Promise", - "name": "promise" + "type": "string", + "name": "url" + }, + { + "description": "", + "isOptional": false, + "type": "PostHogFetchOptions", + "name": "options" } ], "returnType": { - "id": "Promise", - "name": "Promise" + "id": "Promise", + "name": "Promise" }, "path": "src/entrypoints/index.node.ts" }, { - "category": "", + "category": "Initialization", + "description": "Flushes the queue of pending events.\nThis function will return a promise that will resolve when the flush is complete, or reject if there was an error (for example if the server or network is down).\nIf there is already a flush in progress, this function will wait for that flush to complete.\nIt's recommended to do error handling in the callback of the promise.", "details": null, - "id": "aliasStateless", + "id": "flush", "showDocs": true, - "title": "aliasStateless", + "title": "flush", "examples": [ { - "id": "aliasstateless", - "name": "Generated example for aliasStateless", - "code": "// Generated example for aliasStateless\nposthog.aliasStateless();" + "id": "flush_with_error_handling", + "name": "flush with error handling", + "code": "\n\n// flush with error handling\nposthog.flush().then(() => {\n console.log('Flush complete')\n}).catch((err) => {\n console.error('Flush failed', err)\n})\n\n\n" } ], "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "alias" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], + "params": [], "returnType": { - "id": "void", - "name": "void" + "id": "Promise", + "name": "Promise" }, "path": "src/entrypoints/index.node.ts" }, { "category": "", + "description": "* ** SURVEYS *", "details": null, - "id": "aliasStatelessImmediate", + "id": "getSurveysStateless", "showDocs": true, - "title": "aliasStatelessImmediate", + "title": "getSurveysStateless", "examples": [ { - "id": "aliasstatelessimmediate", - "name": "Generated example for aliasStatelessImmediate", - "code": "// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();" + "id": "getsurveysstateless", + "name": "Generated example for getSurveysStateless", + "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" } ], "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "alias" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], + "params": [], "returnType": { - "id": "Promise", - "name": "Promise" + "id": "Promise", + "name": "Promise" }, "path": "src/entrypoints/index.node.ts" }, { "category": "", "details": null, - "id": "captureStateless", + "id": "on", "showDocs": true, - "title": "captureStateless", + "title": "on", "examples": [ { - "id": "capturestateless", - "name": "Generated example for captureStateless", - "code": "// Generated example for captureStateless\nposthog.captureStateless();" + "id": "on", + "name": "Generated example for on", + "code": "// Generated example for on\nposthog.on();" } ], "releaseTag": "public", "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, { "description": "", "isOptional": false, @@ -1284,63 +1215,32 @@ }, { "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" + "isOptional": false, + "type": "(...args: any[]) => void", + "name": "cb" } ], "returnType": { - "id": "void", - "name": "void" + "id": "() => void", + "name": "() => void" }, "path": "src/entrypoints/index.node.ts" }, { "category": "", "details": null, - "id": "captureStatelessImmediate", + "id": "optIn", "showDocs": true, - "title": "captureStatelessImmediate", + "title": "optIn", "examples": [ { - "id": "capturestatelessimmediate", - "name": "Generated example for captureStatelessImmediate", - "code": "// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();" + "id": "optin", + "name": "Generated example for optIn", + "code": "// Generated example for optIn\nposthog.optIn();" } ], "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "event" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], + "params": [], "returnType": { "id": "Promise", "name": "Promise" @@ -1350,54 +1250,35 @@ { "category": "", "details": null, - "id": "enqueue", + "id": "optOut", "showDocs": true, - "title": "enqueue", + "title": "optOut", "examples": [ { - "id": "enqueue", - "name": "Generated example for enqueue", - "code": "// Generated example for enqueue\nposthog.enqueue();" + "id": "optout", + "name": "Generated example for optOut", + "code": "// Generated example for optOut\nposthog.optOut();" } ], "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], + "params": [], "returnType": { - "id": "void", - "name": "void" + "id": "Promise", + "name": "Promise" }, "path": "src/entrypoints/index.node.ts" }, { "category": "", "details": null, - "id": "fetch", + "id": "register", "showDocs": true, - "title": "fetch", + "title": "register", "examples": [ { - "id": "fetch", - "name": "Generated example for fetch", - "code": "// Generated example for fetch\nposthog.fetch();" + "id": "register", + "name": "Generated example for register", + "code": "// Generated example for register\nposthog.register();" } ], "releaseTag": "public", @@ -1405,60 +1286,39 @@ { "description": "", "isOptional": false, - "type": "string", - "name": "url" - }, - { - "description": "", - "isOptional": false, - "type": "PostHogFetchOptions", - "name": "options" + "type": "PostHogEventProperties", + "name": "properties" } ], "returnType": { - "id": "Promise", - "name": "Promise" + "id": "Promise", + "name": "Promise" }, "path": "src/entrypoints/index.node.ts" }, { "category": "Initialization", - "description": "Flushes the queue of pending events.\nThis function will return a promise that will resolve when the flush is complete, or reject if there was an error (for example if the server or network is down).\nIf there is already a flush in progress, this function will wait for that flush to complete.\nIt's recommended to do error handling in the callback of the promise.", + "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", "details": null, - "id": "flush", + "id": "shutdown", "showDocs": true, - "title": "flush", + "title": "shutdown", "examples": [ { - "id": "flush_with_error_handling", - "name": "flush with error handling", - "code": "\n\n// flush with error handling\nposthog.flush().then(() => {\n console.log('Flush complete')\n}).catch((err) => {\n console.error('Flush failed', err)\n})\n\n\n" + "id": "shutdown_before_process_exit", + "name": "shutdown before process exit", + "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" } ], "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "Hook that allows subclasses to wait for storage operations to complete. This is called after queue changes are persisted during flush to ensure data is safely written to storage before considering events as sent.\nOverride this in implementations with async storage (e.g., React Native) to prevent duplicate events on app crash/restart scenarios.", - "details": null, - "id": "flushStorage", - "showDocs": true, - "title": "flushStorage", - "examples": [ + "params": [ { - "id": "flushstorage", - "name": "Generated example for flushStorage", - "code": "// Generated example for flushStorage\nposthog.flushStorage();" + "description": "Maximum time to wait for shutdown in milliseconds", + "isOptional": true, + "type": "number", + "name": "shutdownTimeoutMs" } ], - "releaseTag": "public", - "params": [], "returnType": { "id": "Promise", "name": "Promise" @@ -1468,978 +1328,18 @@ { "category": "", "details": null, - "id": "getCommonEventProperties", + "id": "unregister", "showDocs": true, - "title": "getCommonEventProperties", + "title": "unregister", "examples": [ { - "id": "getcommoneventproperties", - "name": "Generated example for getCommonEventProperties", - "code": "// Generated example for getCommonEventProperties\nposthog.getCommonEventProperties();" + "id": "unregister", + "name": "Generated example for unregister", + "code": "// Generated example for unregister\nposthog.unregister();" } ], "releaseTag": "public", - "params": [], - "returnType": { - "id": "PostHogEventProperties", - "name": "PostHogEventProperties" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getCustomHeaders", - "showDocs": true, - "title": "getCustomHeaders", - "examples": [ - { - "id": "getcustomheaders", - "name": "Generated example for getCustomHeaders", - "code": "// Generated example for getCustomHeaders\nposthog.getCustomHeaders();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "{\n [key: string]: string;\n }", - "name": "{\n [key: string]: string;\n }" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagDetailsStateless", - "showDocs": true, - "title": "getFeatureFlagDetailsStateless", - "examples": [ - { - "id": "getfeatureflagdetailsstateless", - "name": "Generated example for getFeatureFlagDetailsStateless", - "code": "// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagDetailStateless", - "showDocs": true, - "title": "getFeatureFlagDetailStateless", - "examples": [ - { - "id": "getfeatureflagdetailstateless", - "name": "Generated example for getFeatureFlagDetailStateless", - "code": "// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>", - "name": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagPayloadsStateless", - "showDocs": true, - "title": "getFeatureFlagPayloadsStateless", - "examples": [ - { - "id": "getfeatureflagpayloadsstateless", - "name": "Generated example for getFeatureFlagPayloadsStateless", - "code": "// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagPayloadStateless", - "showDocs": true, - "title": "getFeatureFlagPayloadStateless", - "examples": [ - { - "id": "getfeatureflagpayloadstateless", - "name": "Generated example for getFeatureFlagPayloadStateless", - "code": "// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagsAndPayloadsStateless", - "showDocs": true, - "title": "getFeatureFlagsAndPayloadsStateless", - "examples": [ - { - "id": "getfeatureflagsandpayloadsstateless", - "name": "Generated example for getFeatureFlagsAndPayloadsStateless", - "code": "// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", - "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagsStateless", - "showDocs": true, - "title": "getFeatureFlagsStateless", - "examples": [ - { - "id": "getfeatureflagsstateless", - "name": "Generated example for getFeatureFlagsStateless", - "code": "// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", - "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagStateless", - "showDocs": true, - "title": "getFeatureFlagStateless", - "examples": [ - { - "id": "getfeatureflagstateless", - "name": "Generated example for getFeatureFlagStateless", - "code": "// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>", - "name": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** FEATURE FLAGS *", - "details": null, - "id": "getFlags", - "showDocs": true, - "title": "getFlags", - "examples": [ - { - "id": "getflags", - "name": "Generated example for getFlags", - "code": "// Generated example for getFlags\nposthog.getFlags();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "extraPayload" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "fetchConfig" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "getRemoteConfig", - "showDocs": true, - "title": "getRemoteConfig", - "examples": [ - { - "id": "getremoteconfig", - "name": "Generated example for getRemoteConfig", - "code": "// Generated example for getRemoteConfig\nposthog.getRemoteConfig();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** SURVEYS *", - "details": null, - "id": "getSurveysStateless", - "showDocs": true, - "title": "getSurveysStateless", - "examples": [ - { - "id": "getsurveysstateless", - "name": "Generated example for getSurveysStateless", - "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** GROUPS *", - "details": null, - "id": "groupIdentifyStateless", - "showDocs": true, - "title": "groupIdentifyStateless", - "examples": [ - { - "id": "groupidentifystateless", - "name": "Generated example for groupIdentifyStateless", - "code": "// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "groupType" - }, - { - "description": "", - "isOptional": false, - "type": "string | number", - "name": "groupKey" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - }, - { - "description": "", - "isOptional": true, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "eventProperties" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "* ** TRACKING *", - "details": null, - "id": "identifyStateless", - "showDocs": true, - "title": "identifyStateless", - "examples": [ - { - "id": "identifystateless", - "name": "Generated example for identifyStateless", - "code": "// Generated example for identifyStateless\nposthog.identifyStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "identifyStatelessImmediate", - "showDocs": true, - "title": "identifyStatelessImmediate", - "examples": [ - { - "id": "identifystatelessimmediate", - "name": "Generated example for identifyStatelessImmediate", - "code": "// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "logMsgIfDebug", - "showDocs": true, - "title": "logMsgIfDebug", - "examples": [ - { - "id": "logmsgifdebug", - "name": "Generated example for logMsgIfDebug", - "code": "// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "() => void", - "name": "fn" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "on", - "showDocs": true, - "title": "on", - "examples": [ - { - "id": "on", - "name": "Generated example for on", - "code": "// Generated example for on\nposthog.on();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "event" - }, - { - "description": "", - "isOptional": false, - "type": "(...args: any[]) => void", - "name": "cb" - } - ], - "returnType": { - "id": "() => void", - "name": "() => void" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "optIn", - "showDocs": true, - "title": "optIn", - "examples": [ - { - "id": "optin", - "name": "Generated example for optIn", - "code": "// Generated example for optIn\nposthog.optIn();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "optOut", - "showDocs": true, - "title": "optOut", - "examples": [ - { - "id": "optout", - "name": "Generated example for optOut", - "code": "// Generated example for optOut\nposthog.optOut();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "prepareMessage", - "showDocs": true, - "title": "prepareMessage", - "examples": [ - { - "id": "preparemessage", - "name": "Generated example for prepareMessage", - "code": "// Generated example for prepareMessage\nposthog.prepareMessage();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "PostHogEventProperties", - "name": "PostHogEventProperties" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "description": "Hook that allows subclasses to transform or filter a message before it's queued. Return null to drop the message.", - "details": null, - "id": "processBeforeEnqueue", - "showDocs": true, - "title": "processBeforeEnqueue", - "examples": [ - { - "id": "processbeforeenqueue", - "name": "Generated example for processBeforeEnqueue", - "code": "// Generated example for processBeforeEnqueue\nposthog.processBeforeEnqueue();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "The prepared message", - "isOptional": false, - "type": "PostHogEventProperties", - "name": "message" - } - ], - "returnType": { - "id": "PostHogEventProperties | null", - "name": "PostHogEventProperties | null" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "register", - "showDocs": true, - "title": "register", - "examples": [ - { - "id": "register", - "name": "Generated example for register", - "code": "// Generated example for register\nposthog.register();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "PostHogEventProperties", - "name": "properties" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "sendImmediate", - "showDocs": true, - "title": "sendImmediate", - "examples": [ - { - "id": "sendimmediate", - "name": "Generated example for sendImmediate", - "code": "// Generated example for sendImmediate\nposthog.sendImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "Initialization", - "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", - "details": null, - "id": "shutdown", - "showDocs": true, - "title": "shutdown", - "examples": [ - { - "id": "shutdown_before_process_exit", - "name": "shutdown before process exit", - "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "Maximum time to wait for shutdown in milliseconds", - "isOptional": true, - "type": "number", - "name": "shutdownTimeoutMs" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "unregister", - "showDocs": true, - "title": "unregister", - "examples": [ - { - "id": "unregister", - "name": "Generated example for unregister", - "code": "// Generated example for unregister\nposthog.unregister();" - } - ], - "releaseTag": "public", - "params": [ + "params": [ { "description": "", "isOptional": false, @@ -2452,34 +1352,6 @@ "name": "Promise" }, "path": "src/entrypoints/index.node.ts" - }, - { - "category": "", - "details": null, - "id": "wrap", - "showDocs": true, - "title": "wrap", - "examples": [ - { - "id": "wrap", - "name": "Generated example for wrap", - "code": "// Generated example for wrap\nposthog.wrap();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "() => void", - "name": "fn" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "src/entrypoints/index.node.ts" } ] } diff --git a/packages/react-native/references/posthog-react-native-references-4.36.0.json b/packages/react-native/references/posthog-react-native-references-4.36.0.json index 16064e2248..37debfb88b 100644 --- a/packages/react-native/references/posthog-react-native-references-4.36.0.json +++ b/packages/react-native/references/posthog-react-native-references-4.36.0.json @@ -229,28 +229,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "description": "Waits for any pending storage operations to complete. This ensures data has been safely written to async storage before considering events as sent, preventing duplicate events on app crash/restart.", - "details": null, - "id": "flushStorage", - "showDocs": true, - "title": "flushStorage", - "examples": [ - { - "id": "flushstorage", - "name": "Generated example for flushStorage", - "code": "// Generated example for flushStorage\nposthog.flushStorage();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "", "details": null, @@ -1334,35 +1312,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "description": "* ** FEATURE FLAGS *", - "details": null, - "id": "flagsAsync", - "showDocs": true, - "title": "flagsAsync", - "examples": [ - { - "id": "flagsasync", - "name": "Generated example for flagsAsync", - "code": "// Generated example for flagsAsync\nposthog.flagsAsync();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": true, - "type": "FlagsAsyncOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "Identification", "description": "Returns the current anonymous ID.\nThis is the ID assigned to users before they are identified. It's used to track anonymous users and link them to identified users when they sign up.", @@ -1503,27 +1452,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "details": null, - "id": "getKnownFeatureFlags", - "showDocs": true, - "title": "getKnownFeatureFlags", - "examples": [ - { - "id": "getknownfeatureflags", - "name": "Generated example for getKnownFeatureFlags", - "code": "// Generated example for getKnownFeatureFlags\nposthog.getKnownFeatureFlags();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "PostHogFlagsResponse['featureFlags'] | undefined", - "name": "PostHogFlagsResponse['featureFlags'] | undefined" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "", "details": null, @@ -1695,35 +1623,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "description": "Called when remote config has been loaded (from either the remote config endpoint or the flags endpoint). Override in subclasses to react to remote config changes (e.g., gating error tracking, session replay features).\nThe full response is passed so consumers can read whatever fields they need. This is called exactly once per remote config load cycle.", - "details": null, - "id": "onRemoteConfig", - "showDocs": true, - "title": "onRemoteConfig", - "examples": [ - { - "id": "onremoteconfig", - "name": "Generated example for onRemoteConfig", - "code": "// Generated example for onRemoteConfig\nposthog.onRemoteConfig();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "The remote config or flags response containing config fields", - "isOptional": false, - "type": "PostHogRemoteConfig", - "name": "_response" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "", "details": null, @@ -1752,35 +1651,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "description": "Override processBeforeEnqueue to run before_send hooks. This runs after prepareMessage, giving users full control over the final event.\nThe internal message contains many fields (event, distinct_id, properties, type, library, library_version, timestamp, uuid). CaptureEvent exposes a subset matching the web SDK's CaptureResult: uuid, event, properties, $set, $set_once, timestamp. Note: $set/$set_once are extracted from properties.$set and properties.$set_once.", - "details": null, - "id": "processBeforeEnqueue", - "showDocs": true, - "title": "processBeforeEnqueue", - "examples": [ - { - "id": "processbeforeenqueue", - "name": "Generated example for processBeforeEnqueue", - "code": "// Generated example for processBeforeEnqueue\nposthog.processBeforeEnqueue();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "PostHogEventProperties", - "name": "message" - } - ], - "returnType": { - "id": "PostHogEventProperties | null", - "name": "PostHogEventProperties | null" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "", "details": null, @@ -1830,34 +1700,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "details": null, - "id": "setupBootstrap", - "showDocs": true, - "title": "setupBootstrap", - "examples": [ - { - "id": "setupbootstrap", - "name": "Generated example for setupBootstrap", - "code": "// Generated example for setupBootstrap\nposthog.setupBootstrap();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": true, - "type": "Partial", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "", "details": null, @@ -1887,71 +1729,31 @@ "path": "dist/posthog-rn.d.ts" }, { - "category": "", - "details": null, - "id": "addPendingPromise", + "category": "Initialization", + "description": "Enables or disables debug mode for detailed logging.", + "details": "Debug mode logs all PostHog calls to the console for troubleshooting. This is useful during development to understand what data is being sent.", + "id": "debug", "showDocs": true, - "title": "addPendingPromise", + "title": "debug", "examples": [ { - "id": "addpendingpromise", - "name": "Generated example for addPendingPromise", - "code": "// Generated example for addPendingPromise\nposthog.addPendingPromise();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "Promise", - "name": "promise" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "aliasStateless", - "showDocs": true, - "title": "aliasStateless", - "examples": [ + "id": "enable_debug_mode", + "name": "enable debug mode", + "code": "\n\n// enable debug mode\nposthog.debug(true)\n\n\n" + }, { - "id": "aliasstateless", - "name": "Generated example for aliasStateless", - "code": "// Generated example for aliasStateless\nposthog.aliasStateless();" + "id": "disable_debug_mode", + "name": "disable debug mode", + "code": "\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n" } ], "releaseTag": "public", "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "alias" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, { "description": "", "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" + "type": "boolean", + "name": "enabled" } ], "returnType": { @@ -1962,1014 +1764,47 @@ }, { "category": "", + "description": "* ** SURVEYS *", "details": null, - "id": "aliasStatelessImmediate", + "id": "getSurveysStateless", "showDocs": true, - "title": "aliasStatelessImmediate", + "title": "getSurveysStateless", "examples": [ { - "id": "aliasstatelessimmediate", - "name": "Generated example for aliasStatelessImmediate", - "code": "// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();" + "id": "getsurveysstateless", + "name": "Generated example for getSurveysStateless", + "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" } ], "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "alias" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], + "params": [], "returnType": { - "id": "Promise", - "name": "Promise" + "id": "Promise", + "name": "Promise" }, "path": "dist/posthog-rn.d.ts" }, { - "category": "", + "category": "Initialization", + "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", "details": null, - "id": "captureStateless", + "id": "shutdown", "showDocs": true, - "title": "captureStateless", + "title": "shutdown", "examples": [ { - "id": "capturestateless", - "name": "Generated example for captureStateless", - "code": "// Generated example for captureStateless\nposthog.captureStateless();" + "id": "shutdown_before_process_exit", + "name": "shutdown before process exit", + "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" } ], "releaseTag": "public", "params": [ { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "event" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", + "description": "Maximum time to wait for shutdown in milliseconds", "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "captureStatelessImmediate", - "showDocs": true, - "title": "captureStatelessImmediate", - "examples": [ - { - "id": "capturestatelessimmediate", - "name": "Generated example for captureStatelessImmediate", - "code": "// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "event" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "Initialization", - "description": "Enables or disables debug mode for detailed logging.", - "details": "Debug mode logs all PostHog calls to the console for troubleshooting. This is useful during development to understand what data is being sent.", - "id": "debug", - "showDocs": true, - "title": "debug", - "examples": [ - { - "id": "enable_debug_mode", - "name": "enable debug mode", - "code": "\n\n// enable debug mode\nposthog.debug(true)\n\n\n" - }, - { - "id": "disable_debug_mode", - "name": "disable debug mode", - "code": "\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "enabled" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "enqueue", - "showDocs": true, - "title": "enqueue", - "examples": [ - { - "id": "enqueue", - "name": "Generated example for enqueue", - "code": "// Generated example for enqueue\nposthog.enqueue();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getCustomHeaders", - "showDocs": true, - "title": "getCustomHeaders", - "examples": [ - { - "id": "getcustomheaders", - "name": "Generated example for getCustomHeaders", - "code": "// Generated example for getCustomHeaders\nposthog.getCustomHeaders();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "{\n [key: string]: string;\n }", - "name": "{\n [key: string]: string;\n }" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagDetailsStateless", - "showDocs": true, - "title": "getFeatureFlagDetailsStateless", - "examples": [ - { - "id": "getfeatureflagdetailsstateless", - "name": "Generated example for getFeatureFlagDetailsStateless", - "code": "// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagDetailStateless", - "showDocs": true, - "title": "getFeatureFlagDetailStateless", - "examples": [ - { - "id": "getfeatureflagdetailstateless", - "name": "Generated example for getFeatureFlagDetailStateless", - "code": "// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>", - "name": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagPayloadsStateless", - "showDocs": true, - "title": "getFeatureFlagPayloadsStateless", - "examples": [ - { - "id": "getfeatureflagpayloadsstateless", - "name": "Generated example for getFeatureFlagPayloadsStateless", - "code": "// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagPayloadStateless", - "showDocs": true, - "title": "getFeatureFlagPayloadStateless", - "examples": [ - { - "id": "getfeatureflagpayloadstateless", - "name": "Generated example for getFeatureFlagPayloadStateless", - "code": "// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagsAndPayloadsStateless", - "showDocs": true, - "title": "getFeatureFlagsAndPayloadsStateless", - "examples": [ - { - "id": "getfeatureflagsandpayloadsstateless", - "name": "Generated example for getFeatureFlagsAndPayloadsStateless", - "code": "// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", - "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagsStateless", - "showDocs": true, - "title": "getFeatureFlagsStateless", - "examples": [ - { - "id": "getfeatureflagsstateless", - "name": "Generated example for getFeatureFlagsStateless", - "code": "// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", - "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagStateless", - "showDocs": true, - "title": "getFeatureFlagStateless", - "examples": [ - { - "id": "getfeatureflagstateless", - "name": "Generated example for getFeatureFlagStateless", - "code": "// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>", - "name": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "description": "* ** FEATURE FLAGS *", - "details": null, - "id": "getFlags", - "showDocs": true, - "title": "getFlags", - "examples": [ - { - "id": "getflags", - "name": "Generated example for getFlags", - "code": "// Generated example for getFlags\nposthog.getFlags();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "extraPayload" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "fetchConfig" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getRemoteConfig", - "showDocs": true, - "title": "getRemoteConfig", - "examples": [ - { - "id": "getremoteconfig", - "name": "Generated example for getRemoteConfig", - "code": "// Generated example for getRemoteConfig\nposthog.getRemoteConfig();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "description": "* ** SURVEYS *", - "details": null, - "id": "getSurveysStateless", - "showDocs": true, - "title": "getSurveysStateless", - "examples": [ - { - "id": "getsurveysstateless", - "name": "Generated example for getSurveysStateless", - "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "description": "* ** GROUPS *", - "details": null, - "id": "groupIdentifyStateless", - "showDocs": true, - "title": "groupIdentifyStateless", - "examples": [ - { - "id": "groupidentifystateless", - "name": "Generated example for groupIdentifyStateless", - "code": "// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "groupType" - }, - { - "description": "", - "isOptional": false, - "type": "string | number", - "name": "groupKey" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - }, - { - "description": "", - "isOptional": true, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "eventProperties" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "description": "* ** TRACKING *", - "details": null, - "id": "identifyStateless", - "showDocs": true, - "title": "identifyStateless", - "examples": [ - { - "id": "identifystateless", - "name": "Generated example for identifyStateless", - "code": "// Generated example for identifyStateless\nposthog.identifyStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "identifyStatelessImmediate", - "showDocs": true, - "title": "identifyStatelessImmediate", - "examples": [ - { - "id": "identifystatelessimmediate", - "name": "Generated example for identifyStatelessImmediate", - "code": "// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "logMsgIfDebug", - "showDocs": true, - "title": "logMsgIfDebug", - "examples": [ - { - "id": "logmsgifdebug", - "name": "Generated example for logMsgIfDebug", - "code": "// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "() => void", - "name": "fn" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "prepareMessage", - "showDocs": true, - "title": "prepareMessage", - "examples": [ - { - "id": "preparemessage", - "name": "Generated example for prepareMessage", - "code": "// Generated example for prepareMessage\nposthog.prepareMessage();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "PostHogEventProperties", - "name": "PostHogEventProperties" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "sendImmediate", - "showDocs": true, - "title": "sendImmediate", - "examples": [ - { - "id": "sendimmediate", - "name": "Generated example for sendImmediate", - "code": "// Generated example for sendImmediate\nposthog.sendImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "Initialization", - "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", - "details": null, - "id": "shutdown", - "showDocs": true, - "title": "shutdown", - "examples": [ - { - "id": "shutdown_before_process_exit", - "name": "shutdown before process exit", - "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "Maximum time to wait for shutdown in milliseconds", - "isOptional": true, - "type": "number", - "name": "shutdownTimeoutMs" + "type": "number", + "name": "shutdownTimeoutMs" } ], "returnType": { @@ -2977,34 +1812,6 @@ "name": "Promise" }, "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "wrap", - "showDocs": true, - "title": "wrap", - "examples": [ - { - "id": "wrap", - "name": "Generated example for wrap", - "code": "// Generated example for wrap\nposthog.wrap();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "() => void", - "name": "fn" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" } ] } diff --git a/packages/react-native/references/posthog-react-native-references-latest.json b/packages/react-native/references/posthog-react-native-references-latest.json index 16064e2248..37debfb88b 100644 --- a/packages/react-native/references/posthog-react-native-references-latest.json +++ b/packages/react-native/references/posthog-react-native-references-latest.json @@ -229,28 +229,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "description": "Waits for any pending storage operations to complete. This ensures data has been safely written to async storage before considering events as sent, preventing duplicate events on app crash/restart.", - "details": null, - "id": "flushStorage", - "showDocs": true, - "title": "flushStorage", - "examples": [ - { - "id": "flushstorage", - "name": "Generated example for flushStorage", - "code": "// Generated example for flushStorage\nposthog.flushStorage();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "", "details": null, @@ -1334,35 +1312,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "description": "* ** FEATURE FLAGS *", - "details": null, - "id": "flagsAsync", - "showDocs": true, - "title": "flagsAsync", - "examples": [ - { - "id": "flagsasync", - "name": "Generated example for flagsAsync", - "code": "// Generated example for flagsAsync\nposthog.flagsAsync();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": true, - "type": "FlagsAsyncOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "Identification", "description": "Returns the current anonymous ID.\nThis is the ID assigned to users before they are identified. It's used to track anonymous users and link them to identified users when they sign up.", @@ -1503,27 +1452,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "details": null, - "id": "getKnownFeatureFlags", - "showDocs": true, - "title": "getKnownFeatureFlags", - "examples": [ - { - "id": "getknownfeatureflags", - "name": "Generated example for getKnownFeatureFlags", - "code": "// Generated example for getKnownFeatureFlags\nposthog.getKnownFeatureFlags();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "PostHogFlagsResponse['featureFlags'] | undefined", - "name": "PostHogFlagsResponse['featureFlags'] | undefined" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "", "details": null, @@ -1695,35 +1623,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "description": "Called when remote config has been loaded (from either the remote config endpoint or the flags endpoint). Override in subclasses to react to remote config changes (e.g., gating error tracking, session replay features).\nThe full response is passed so consumers can read whatever fields they need. This is called exactly once per remote config load cycle.", - "details": null, - "id": "onRemoteConfig", - "showDocs": true, - "title": "onRemoteConfig", - "examples": [ - { - "id": "onremoteconfig", - "name": "Generated example for onRemoteConfig", - "code": "// Generated example for onRemoteConfig\nposthog.onRemoteConfig();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "The remote config or flags response containing config fields", - "isOptional": false, - "type": "PostHogRemoteConfig", - "name": "_response" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "", "details": null, @@ -1752,35 +1651,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "description": "Override processBeforeEnqueue to run before_send hooks. This runs after prepareMessage, giving users full control over the final event.\nThe internal message contains many fields (event, distinct_id, properties, type, library, library_version, timestamp, uuid). CaptureEvent exposes a subset matching the web SDK's CaptureResult: uuid, event, properties, $set, $set_once, timestamp. Note: $set/$set_once are extracted from properties.$set and properties.$set_once.", - "details": null, - "id": "processBeforeEnqueue", - "showDocs": true, - "title": "processBeforeEnqueue", - "examples": [ - { - "id": "processbeforeenqueue", - "name": "Generated example for processBeforeEnqueue", - "code": "// Generated example for processBeforeEnqueue\nposthog.processBeforeEnqueue();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "PostHogEventProperties", - "name": "message" - } - ], - "returnType": { - "id": "PostHogEventProperties | null", - "name": "PostHogEventProperties | null" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "", "details": null, @@ -1830,34 +1700,6 @@ }, "path": "dist/posthog-rn.d.ts" }, - { - "category": "", - "details": null, - "id": "setupBootstrap", - "showDocs": true, - "title": "setupBootstrap", - "examples": [ - { - "id": "setupbootstrap", - "name": "Generated example for setupBootstrap", - "code": "// Generated example for setupBootstrap\nposthog.setupBootstrap();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": true, - "type": "Partial", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, { "category": "", "details": null, @@ -1887,71 +1729,31 @@ "path": "dist/posthog-rn.d.ts" }, { - "category": "", - "details": null, - "id": "addPendingPromise", + "category": "Initialization", + "description": "Enables or disables debug mode for detailed logging.", + "details": "Debug mode logs all PostHog calls to the console for troubleshooting. This is useful during development to understand what data is being sent.", + "id": "debug", "showDocs": true, - "title": "addPendingPromise", + "title": "debug", "examples": [ { - "id": "addpendingpromise", - "name": "Generated example for addPendingPromise", - "code": "// Generated example for addPendingPromise\nposthog.addPendingPromise();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "Promise", - "name": "promise" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "aliasStateless", - "showDocs": true, - "title": "aliasStateless", - "examples": [ + "id": "enable_debug_mode", + "name": "enable debug mode", + "code": "\n\n// enable debug mode\nposthog.debug(true)\n\n\n" + }, { - "id": "aliasstateless", - "name": "Generated example for aliasStateless", - "code": "// Generated example for aliasStateless\nposthog.aliasStateless();" + "id": "disable_debug_mode", + "name": "disable debug mode", + "code": "\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n" } ], "releaseTag": "public", "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "alias" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, { "description": "", "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" + "type": "boolean", + "name": "enabled" } ], "returnType": { @@ -1962,1014 +1764,47 @@ }, { "category": "", + "description": "* ** SURVEYS *", "details": null, - "id": "aliasStatelessImmediate", + "id": "getSurveysStateless", "showDocs": true, - "title": "aliasStatelessImmediate", + "title": "getSurveysStateless", "examples": [ { - "id": "aliasstatelessimmediate", - "name": "Generated example for aliasStatelessImmediate", - "code": "// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();" + "id": "getsurveysstateless", + "name": "Generated example for getSurveysStateless", + "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" } ], "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "alias" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], + "params": [], "returnType": { - "id": "Promise", - "name": "Promise" + "id": "Promise", + "name": "Promise" }, "path": "dist/posthog-rn.d.ts" }, { - "category": "", + "category": "Initialization", + "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", "details": null, - "id": "captureStateless", + "id": "shutdown", "showDocs": true, - "title": "captureStateless", + "title": "shutdown", "examples": [ { - "id": "capturestateless", - "name": "Generated example for captureStateless", - "code": "// Generated example for captureStateless\nposthog.captureStateless();" + "id": "shutdown_before_process_exit", + "name": "shutdown before process exit", + "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" } ], "releaseTag": "public", "params": [ { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "event" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", + "description": "Maximum time to wait for shutdown in milliseconds", "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "captureStatelessImmediate", - "showDocs": true, - "title": "captureStatelessImmediate", - "examples": [ - { - "id": "capturestatelessimmediate", - "name": "Generated example for captureStatelessImmediate", - "code": "// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "event" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "Initialization", - "description": "Enables or disables debug mode for detailed logging.", - "details": "Debug mode logs all PostHog calls to the console for troubleshooting. This is useful during development to understand what data is being sent.", - "id": "debug", - "showDocs": true, - "title": "debug", - "examples": [ - { - "id": "enable_debug_mode", - "name": "enable debug mode", - "code": "\n\n// enable debug mode\nposthog.debug(true)\n\n\n" - }, - { - "id": "disable_debug_mode", - "name": "disable debug mode", - "code": "\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "enabled" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "enqueue", - "showDocs": true, - "title": "enqueue", - "examples": [ - { - "id": "enqueue", - "name": "Generated example for enqueue", - "code": "// Generated example for enqueue\nposthog.enqueue();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getCustomHeaders", - "showDocs": true, - "title": "getCustomHeaders", - "examples": [ - { - "id": "getcustomheaders", - "name": "Generated example for getCustomHeaders", - "code": "// Generated example for getCustomHeaders\nposthog.getCustomHeaders();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "{\n [key: string]: string;\n }", - "name": "{\n [key: string]: string;\n }" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagDetailsStateless", - "showDocs": true, - "title": "getFeatureFlagDetailsStateless", - "examples": [ - { - "id": "getfeatureflagdetailsstateless", - "name": "Generated example for getFeatureFlagDetailsStateless", - "code": "// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagDetailStateless", - "showDocs": true, - "title": "getFeatureFlagDetailStateless", - "examples": [ - { - "id": "getfeatureflagdetailstateless", - "name": "Generated example for getFeatureFlagDetailStateless", - "code": "// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>", - "name": "Promise<{\n response: FeatureFlagDetail | undefined;\n requestId: string | undefined;\n evaluatedAt: number | undefined;\n } | undefined>" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagPayloadsStateless", - "showDocs": true, - "title": "getFeatureFlagPayloadsStateless", - "examples": [ - { - "id": "getfeatureflagpayloadsstateless", - "name": "Generated example for getFeatureFlagPayloadsStateless", - "code": "// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagPayloadStateless", - "showDocs": true, - "title": "getFeatureFlagPayloadStateless", - "examples": [ - { - "id": "getfeatureflagpayloadstateless", - "name": "Generated example for getFeatureFlagPayloadStateless", - "code": "// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagsAndPayloadsStateless", - "showDocs": true, - "title": "getFeatureFlagsAndPayloadsStateless", - "examples": [ - { - "id": "getfeatureflagsandpayloadsstateless", - "name": "Generated example for getFeatureFlagsAndPayloadsStateless", - "code": "// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", - "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagsStateless", - "showDocs": true, - "title": "getFeatureFlagsStateless", - "examples": [ - { - "id": "getfeatureflagsstateless", - "name": "Generated example for getFeatureFlagsStateless", - "code": "// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - }, - { - "description": "", - "isOptional": true, - "type": "string[]", - "name": "flagKeysToEvaluate" - } - ], - "returnType": { - "id": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>", - "name": "Promise<{\n flags: PostHogFlagsResponse['featureFlags'] | undefined;\n payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n requestId: PostHogFlagsResponse['requestId'] | undefined;\n }>" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getFeatureFlagStateless", - "showDocs": true, - "title": "getFeatureFlagStateless", - "examples": [ - { - "id": "getfeatureflagstateless", - "name": "Generated example for getFeatureFlagStateless", - "code": "// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "key" - }, - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "disableGeoip" - } - ], - "returnType": { - "id": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>", - "name": "Promise<{\n response: FeatureFlagValue | undefined;\n requestId: string | undefined;\n }>" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "description": "* ** FEATURE FLAGS *", - "details": null, - "id": "getFlags", - "showDocs": true, - "title": "getFlags", - "examples": [ - { - "id": "getflags", - "name": "Generated example for getFlags", - "code": "// Generated example for getFlags\nposthog.getFlags();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "groups" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "personProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record>", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "Record", - "name": "extraPayload" - }, - { - "description": "", - "isOptional": true, - "type": "boolean", - "name": "fetchConfig" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "getRemoteConfig", - "showDocs": true, - "title": "getRemoteConfig", - "examples": [ - { - "id": "getremoteconfig", - "name": "Generated example for getRemoteConfig", - "code": "// Generated example for getRemoteConfig\nposthog.getRemoteConfig();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "description": "* ** SURVEYS *", - "details": null, - "id": "getSurveysStateless", - "showDocs": true, - "title": "getSurveysStateless", - "examples": [ - { - "id": "getsurveysstateless", - "name": "Generated example for getSurveysStateless", - "code": "// Generated example for getSurveysStateless\nposthog.getSurveysStateless();" - } - ], - "releaseTag": "public", - "params": [], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "description": "* ** GROUPS *", - "details": null, - "id": "groupIdentifyStateless", - "showDocs": true, - "title": "groupIdentifyStateless", - "examples": [ - { - "id": "groupidentifystateless", - "name": "Generated example for groupIdentifyStateless", - "code": "// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "groupType" - }, - { - "description": "", - "isOptional": false, - "type": "string | number", - "name": "groupKey" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "groupProperties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - }, - { - "description": "", - "isOptional": true, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "eventProperties" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "description": "* ** TRACKING *", - "details": null, - "id": "identifyStateless", - "showDocs": true, - "title": "identifyStateless", - "examples": [ - { - "id": "identifystateless", - "name": "Generated example for identifyStateless", - "code": "// Generated example for identifyStateless\nposthog.identifyStateless();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "identifyStatelessImmediate", - "showDocs": true, - "title": "identifyStatelessImmediate", - "examples": [ - { - "id": "identifystatelessimmediate", - "name": "Generated example for identifyStatelessImmediate", - "code": "// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "distinctId" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogEventProperties", - "name": "properties" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "logMsgIfDebug", - "showDocs": true, - "title": "logMsgIfDebug", - "examples": [ - { - "id": "logmsgifdebug", - "name": "Generated example for logMsgIfDebug", - "code": "// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "() => void", - "name": "fn" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "prepareMessage", - "showDocs": true, - "title": "prepareMessage", - "examples": [ - { - "id": "preparemessage", - "name": "Generated example for prepareMessage", - "code": "// Generated example for prepareMessage\nposthog.prepareMessage();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "PostHogEventProperties", - "name": "PostHogEventProperties" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "sendImmediate", - "showDocs": true, - "title": "sendImmediate", - "examples": [ - { - "id": "sendimmediate", - "name": "Generated example for sendImmediate", - "code": "// Generated example for sendImmediate\nposthog.sendImmediate();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "string", - "name": "type" - }, - { - "description": "", - "isOptional": false, - "type": "any", - "name": "_message" - }, - { - "description": "", - "isOptional": true, - "type": "PostHogCaptureOptions", - "name": "options" - } - ], - "returnType": { - "id": "Promise", - "name": "Promise" - }, - "path": "dist/posthog-rn.d.ts" - }, - { - "category": "Initialization", - "description": "Shuts down the PostHog instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this PostHog instance after calling it. Use flush() for per-request cleanup instead.", - "details": null, - "id": "shutdown", - "showDocs": true, - "title": "shutdown", - "examples": [ - { - "id": "shutdown_before_process_exit", - "name": "shutdown before process exit", - "code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await posthog.shutdown()\n process.exit(0)\n})\n\n\n\n" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "Maximum time to wait for shutdown in milliseconds", - "isOptional": true, - "type": "number", - "name": "shutdownTimeoutMs" + "type": "number", + "name": "shutdownTimeoutMs" } ], "returnType": { @@ -2977,34 +1812,6 @@ "name": "Promise" }, "path": "dist/posthog-rn.d.ts" - }, - { - "category": "", - "details": null, - "id": "wrap", - "showDocs": true, - "title": "wrap", - "examples": [ - { - "id": "wrap", - "name": "Generated example for wrap", - "code": "// Generated example for wrap\nposthog.wrap();" - } - ], - "releaseTag": "public", - "params": [ - { - "description": "", - "isOptional": false, - "type": "() => void", - "name": "fn" - } - ], - "returnType": { - "id": "void", - "name": "void" - }, - "path": "dist/posthog-rn.d.ts" } ] } diff --git a/scripts/docs/methods.js b/scripts/docs/methods.js index 6697a8e573..960d1bc371 100644 --- a/scripts/docs/methods.js +++ b/scripts/docs/methods.js @@ -46,11 +46,14 @@ const collectMethodsWithInheritance = (posthogClass, rootClass) => { const inheritanceResult = currentClass.findMembersWithInheritance(); const members = inheritanceResult.items || []; - const methods = members.filter(member => - (member.kind === ApiItemKind.Method && - !member.name.startsWith('_') ) || - member.kind === ApiItemKind.Constructor - ); + const methods = members.filter(member => { + if (member.kind === ApiItemKind.Constructor) return true; + if (member.kind !== ApiItemKind.Method) return false; + // Exclude private-by-convention (leading _) and protected methods + if (member.name.startsWith('_')) return false; + if (member.isProtected) return false; + return true; + }); // Add methods to map (child methods take precedence over parent methods) methods.forEach(method => { From 5c02228c2882afc765c358f9d27d0452938552d9 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Wed, 25 Feb 2026 13:07:46 -0500 Subject: [PATCH 5/5] Fix linter issues --- packages/core/src/posthog-core-stateless.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/posthog-core-stateless.ts b/packages/core/src/posthog-core-stateless.ts index e87899d909..99d886c937 100644 --- a/packages/core/src/posthog-core-stateless.ts +++ b/packages/core/src/posthog-core-stateless.ts @@ -289,7 +289,7 @@ export abstract class PostHogCoreStateless { }, } } - + /** * @internal */