/** Event names supported by CAPI providers. */ type EventName = 'PageView' | 'ViewContent' | 'AddToCart' | 'InitiateCheckout' | 'StartTrial' | 'Subscribe' | 'Purchase' | 'CompleteRegistration' | 'Search' | (string & {}); /** Parameters for tracking an event. */ interface TrackEventParams { /** Event name. */ name: EventName; /** Custom data to attach to the event. */ data?: Record; /** Monetary value of the event. */ value?: number; /** Currency code (e.g. "USD"). */ currency?: string; /** Deduplicate event across client/server using this ID. */ eventId?: string; } /** User identity for the identify call. */ interface IdentifyParams { /** Your internal user ID. */ userId?: string; /** User email (hashed server-side for privacy). */ email?: string; /** User phone number (hashed server-side for privacy). */ phone?: string; /** User display name. */ name?: string; } /** Deep link parameters returned from resolve. */ type DeepLinkParams = Record; /** Opaque attribution data returned from resolve. */ type Attribution = Record; /** * Browser SDK — public entry. * * Wraps the vendored `../core/appcat-core-browser` bundle in a defensive * facade. Every exported method has a top-level try/catch so that a throw * from the core — whether caused by a hostile host (private-mode storage, * sandboxed iframes, disabled cookies, strict CSP, missing * `AbortController`, etc.) — can never escape into consumer code. * * Public API mirrors the mobile SDKs (`@appcat/react-native-sdk`, * `appcat-ios-sdk`, `appcat-android-sdk`): a single `init()` call configures * the SDK and resolves any pending deferred deep link in one round-trip. * Callers no longer invoke `resolve()` separately. */ /** Public browser SDK configuration. */ interface AppCatConfig { /** Your API key from the AppCat dashboard. */ apiKey: string; /** App ID, resolved automatically from API key if omitted. */ appId?: string; /** Enable debug logging. */ debug?: boolean; } /** * Response returned from `AppCat.init()`. * * Shape mirrors the mobile SDK responses: `deepLinkParams` are the query * params from the matched ad click URL (or `null` if no match), and * `matched`/`matchMethod` describe how the match was made. */ interface InitResponse { /** Whether a click match was found for this device. */ matched: boolean; /** How the match was made (e.g. `"ip_device"`, `"device_id"`). Optional. */ matchMethod?: string; /** Query params from the matched ad click URL, or null if no match. */ deepLinkParams: DeepLinkParams | null; } /** * Browser singleton. Public surface mirrors the mobile SDKs: `init()` is * the single entry point that configures the SDK and resolves a deferred * deep link in one call. */ declare const AppCat: { /** * Initialize the SDK and resolve any pending deferred deep link. * * Returns an `InitResponse` whose `deepLinkParams` carries the query * params from the matched ad click URL (or `null` on no match). */ init(config: AppCatConfig): Promise; trackEvent(params: TrackEventParams): Promise; identify(params: IdentifyParams): Promise; setTrackingConsent(granted: boolean): Promise; storeClick(queryParams?: Record): Promise; getDeviceId(): string; getFbc(): string | undefined; getFbp(): string | undefined; getTtp(): string | undefined; }; export { AppCat, type AppCatConfig, type Attribution, type DeepLinkParams, type EventName, type IdentifyParams, type InitResponse, type TrackEventParams };