import type { CallerType, IdentifyInput, PublicInitOptions, SessionInfo, SessionUpdate, TrackEventAttributes, UpdatePayload, UserUpdate } from "./types"; export declare enum Commands { Init = "init", Identify = "identify", Update = "update", UpdateUser = "updateUser", UpdateSession = "updateSession", StopRecording = "stopRecording", InitCrossOriginIframe = "initCrossOriginIframe", TrackEvent = "trackEvent" } /** * Initializes a Milana recording session. Call this once, as early in the * page lifecycle as you can. Only one session can be active at a time — * subsequent `init()` calls while a session is active are rejected with * `{ success: false }`. After a `stopRecording()`, a fresh `init()` is * supported and starts a brand-new session. * * @param productId - Your Milana product ID (starts with `prd_`). * @param clientKey - Your Milana client key (starts with `key_`). * @param info - Session metadata (environment, version, optional metadata). * @param options - Optional recording/privacy overrides. * @returns `{ success: true }` if the session started and is sampled, * `{ success: false }` if initialization failed or the session was * not sampled. */ export declare const init: (productId: string, clientKey: string, info: SessionInfo, options?: PublicInitOptions) => Promise<{ success: boolean; }>; export declare const _initWithCallerType: (productId: string, clientKey: string, info: SessionInfo, callerType: CallerType, options?: PublicInitOptions) => Promise<{ success: boolean; }>; /** * Associates the current session with a known user — typically right * after sign-in. Requires `userId` and `email`; additional profile * fields (`name`, `metadata`) are optional. * * For partial user updates later in the session (e.g. plan changes) use * `updateUser`, which makes `email` optional. */ export declare const identify: (input: IdentifyInput) => Promise<{ success: boolean; }>; /** * @deprecated Prefer the granular entry points: `identify` for initial * user identification, `updateUser` for partial user updates, and * `updateSession` for session-level metadata. `update` remains for * backward compatibility but is no longer the recommended API. */ export declare const update: (input: UpdatePayload) => Promise<{ success: boolean; }>; /** * Updates profile fields (name, email, metadata) for the user identified * by `userId`. User metadata has upsert semantics across the user's * lifetime: any fields you provide are merged with previously set values. * * Does not change the session's identity: once a session has been * attached to a user (via the first `identify` or `updateUser` call), * subsequent `updateUser` calls with a different `userId` will not * re-attribute the session. * * For the initial "user just signed in" flow with a known email, * `identify` is the more focused entry point. */ export declare const updateUser: (user: UserUpdate) => Promise<{ success: boolean; }>; /** * Attaches or refreshes session-level metadata on the active session — * feature flags, traffic origin, experiment variant, current workflow, * etc. Session metadata has upsert semantics within the session: any * fields you provide are merged with previously set values. */ export declare const updateSession: (session: SessionUpdate) => Promise<{ success: boolean; }>; /** * Stops the active recording session. Sends a best-effort close signal to * the server (so the session is finalized immediately, not after the * backend inactivity timeout), tears down local listeners and buffers, and * clears the persisted session id so a subsequent `init()` starts a * brand-new session rather than resuming the one we just closed. * * No-op if no session is active. Returns `{ success: true }` when a session * was torn down, `{ success: false }` otherwise. */ export declare const stopRecording: () => Promise<{ success: boolean; }>; /** * Initializes rrweb cross-origin iframe recording. Call this from within * the iframe itself (not the parent page) when the iframe is hosted on a * different origin than the main document. */ export declare const initCrossOriginIframe: () => void; /** * Records a named event with optional attributes on the active session. * Attributes are limited to JSON-scalar values (`string | number | boolean * | null`). Calls made before `init()` completes are queued. */ export declare const trackEvent: (eventName: string, attributes?: TrackEventAttributes) => void; export type { IdentifyInput, InitPrivacyOptions, IntegrationName, PostHogIntegrationState, PrivacyMaskingLevel, PublicInitOptions, SentryIntegrationState, SessionInfo, SessionIntegrations, SessionUpdate, TrackEventAttributes, TrackEventAttributeValue, UpdatePayload, UserUpdate, } from "./types"; //# sourceMappingURL=index.d.ts.map