import { d as HeyCatchPersonProperties, b as HeyCatchConfig, e as HeyCatchProperties, i as ServerTrackOptions } from './shared-C0-GQTbz.cjs'; export { H as HeyCatchBeforeSend, a as HeyCatchCapturedEvent, c as HeyCatchPersistence, f as HeyCatchSanitizeProperties, K as KNOWN_FRAMEWORKS, g as KNOWN_INSTALL_AGENTS, P as PersonPropertyUpdate, S as SDK_VERSION, h as STAGE, T as TRACING_HEADERS, U as UNKNOWN_INSTALL_VALUE } from './shared-C0-GQTbz.cjs'; /** * The consent pair, present on the server namespace so the `analytics` * object has the SAME shape under every `exports` condition - the * invariant that lets isomorphic code call `analytics.optInCapturing()` * from a file the bundler resolves for the browser and `tsc` resolves for * Node. Omitting them here is what broke that: the call typechecked in the * browser and failed under the `node` condition. * * Both are deliberate no-ops rather than a thrown error or a console * warning. A server has no consent state to gate: there is no ambient * person and no browser storage, every server write already names its * `userId` explicitly, and it only happens because the app chose to call * it. A warning would fire on every isomorphic boot and teach customers to * ignore our console output. */ /** No-op on the server. See the note above. */ declare function optInCapturing(): void; /** No-op on the server. See the note above. */ declare function optOutCapturing(): void; /** * Update a user's person properties from the server - a payment webhook, a * plan change, a cron. Same signature as the browser `setIdentity`; the * `userId` must be the SAME stable internal id the app passes client-side, * that is what joins the two. * * Sends immediately and resolves when ingest answered - `await` it so a * serverless handler cannot freeze mid-send. Never throws: a failure logs * a `[HeyCatch]` console error and resolves, so an analytics hiccup cannot * fail the caller's webhook. */ declare function setIdentity(userId: string, properties?: HeyCatchPersonProperties, propertiesOnce?: HeyCatchPersonProperties): Promise; /** * Server signature exists only for API parity. A server process has no * ambient person to update - say WHO via `setIdentity(userId, properties)` * (or `trackEvent(..., { userId, set })`). */ declare function setPersonProperties(_set?: HeyCatchPersonProperties, _setOnce?: HeyCatchPersonProperties): void; /** * No-op on the server: sessions are a browser concept; there is nothing to * reset in a stateless process. Exists so isomorphic sign-out code that * imports `resetIdentity` resolves under the node condition too. */ declare function resetIdentity(): void; /** * Initialize the server entry. Call once at module scope; idempotent. * Takes the same config shape as the browser `init` - `install` metadata * is accepted for symmetry but not stamped: install facts describe the * client app, and the events they ride on are client events. Same for the * privacy passthrough fields (`autocapture`, `maskAllText`, `persistence`, * …, see `shared.ts`): they parse cleanly here, so one `HeyCatchConfig` * object works under every `exports` condition, but none is read - a * server has no DOM to autocapture from and no browser storage to gate. * Deliberate, not a gap: only the web entry applies them. */ declare function init(config: HeyCatchConfig): void; /** * Record a business event from the server - a completed payment, a * subscription change, anything only the backend knows for sure. Requires * `options.userId` (there is no ambient person in a webhook); `set` / * `setOnce` attach person property updates to the same request. * * Sends immediately, never throws - same contract as `setIdentity`. */ declare function trackEvent(event: string, properties: HeyCatchProperties | undefined, options: ServerTrackOptions): Promise; /** * The server entry. Conditional `exports` route a bare `@heycatch/sdk` * import here on Node and to the browser bundle everywhere else, so the * customer-facing API is ONE surface - same names, environment-appropriate * implementation. `@heycatch/sdk/server` resolves here explicitly. * * Wraps posthog-node (bundled, like posthog-js in the browser entry) in * IMMEDIATE mode only: every send is one awaited request via * `captureImmediate`, never the batching default. Batching is wrong for * our callers - webhooks on serverless, where a buffered event dies with * the frozen function unless someone remembers to flush; an awaited send * has nothing to forget. * * There is no server-side autocapture - a server has no DOM to observe. * This entry carries what only the backend knows: identity and business * events (plan changes, payments, subscriptions), which also makes them * immune to adblockers and client tampering. */ /** * The same-shaped `analytics` namespace as the browser entry - one API * surface under every `exports` condition (see src/web/index.ts). */ declare const analytics: { readonly init: typeof init; readonly optInCapturing: typeof optInCapturing; readonly optOutCapturing: typeof optOutCapturing; readonly resetIdentity: typeof resetIdentity; readonly setIdentity: typeof setIdentity; readonly setPersonProperties: typeof setPersonProperties; readonly trackEvent: typeof trackEvent; }; export { HeyCatchConfig, HeyCatchPersonProperties, HeyCatchProperties, ServerTrackOptions, ServerTrackOptions as TrackOptions, analytics };