import { Destination as Destination$1, WalkerOS, Mapping as Mapping$1 } from '@walkeros/core'; import { DestinationWeb } from '@walkeros/web-core'; import { SelfDescribingJson, CommonEventProperties } from '@snowplow/tracker-core'; import { BrowserPlugin, ActivityTrackingConfiguration } from '@snowplow/browser-tracker-core'; import { Action, Cart, CheckoutStep, Page, Product, Refund, SPPromotion, SPTransaction, TransactionError, User } from '@snowplow/browser-plugin-snowplow-ecommerce'; declare global { interface Window { snowplow?: SnowplowFunction; GlobalSnowplowNamespace?: string[]; } } interface SnowplowFunction { (...args: unknown[]): void; q?: unknown[]; } /** * Tracker factory function type (from @snowplow/browser-tracker) * * This is the `newTracker` function signature. When provided via `settings.code`, * the destination uses this directly instead of loading sp.js. */ type TrackerFactory = (trackerId: string, endpoint: string, configuration?: Record) => void; /** * Browser-tracker module functions passed via $code: for npm mode * * These are the individual tracking functions imported from @snowplow/browser-tracker * that replace the sp.js command queue approach. */ interface TrackerFunctions { /** Initialize tracker - always required */ newTracker: TrackerFactory; /** Track self-describing events - required for event tracking */ trackSelfDescribingEvent: (event: SelfDescribingEvent, trackers?: string[]) => void; /** Track page views */ trackPageView?: (event?: Record, trackers?: string[]) => void; /** Track structured events */ trackStructEvent?: (event: Record, trackers?: string[]) => void; /** Set user ID */ setUserId?: (userId?: string | null, trackers?: string[]) => void; /** Enable activity tracking */ enableActivityTracking?: (config: ActivityTrackingConfiguration, trackers?: string[]) => void; /** Add plugin */ addPlugin?: (config: { plugin: BrowserPlugin; }, trackers?: string[]) => void; /** Add global contexts */ addGlobalContexts?: (contexts: unknown[], trackers?: string[]) => void; /** Clear user data */ clearUserData?: (config?: Record, trackers?: string[]) => void; /** Enable anonymous tracking */ enableAnonymousTracking?: (config?: Record, trackers?: string[]) => void; /** Disable anonymous tracking */ disableAnonymousTracking?: (config?: Record, trackers?: string[]) => void; /** Consent tracking - from Enhanced Consent plugin */ trackConsentAllow?: (params: Record, trackers?: string[]) => void; trackConsentDeny?: (params: Record, trackers?: string[]) => void; trackConsentSelected?: (params: Record, trackers?: string[]) => void; /** Set page context - from Snowplow Ecommerce plugin */ setPageType?: (page: { type: string; language?: string; locale?: string; }, trackers?: string[]) => void; } /** * Unified adapter interface for Snowplow tracking * * Provides a consistent API regardless of whether using sp.js command queue * or @snowplow/browser-tracker module functions. */ interface SnowplowAdapter { trackPageView(event?: Record): void; trackSelfDescribingEvent(event: SelfDescribingEvent): void; trackStructEvent(event: Record): void; setUserId(userId?: string | null): void; enableActivityTracking(config: ActivityTrackingConfiguration): void; addPlugin(config: { plugin: BrowserPlugin; } | [string, [string, string]]): void; addGlobalContexts(contexts: unknown[]): void; clearUserData(config?: Record): void; enableAnonymousTracking(config?: Record): void; disableAnonymousTracking(config?: Record): void; trackConsentAllow(params: Record): void; trackConsentDeny(params: Record): void; trackConsentSelected(params: Record): void; /** Set page context - from Snowplow Ecommerce plugin */ setPageType(page: { type: string; language?: string; locale?: string; }): void; /** For URL-based plugins that need enable methods */ call(method: string, ...args: unknown[]): void; } /** * Complete self-describing event structure * This is the full parameter passed to window.snowplow('trackSelfDescribingEvent', ...) */ type SelfDescribingEvent = { event: SelfDescribingJson; } & CommonEventProperties; /** * Page context settings for setPageType * * Each field is resolved via getMappingValue, allowing dynamic values * from event data or static values. * * @example * // Dynamic values from globals * page: { * type: 'globals.page_type', * language: 'globals.language', * locale: 'globals.locale' * } * * // Mixed static and dynamic * page: { * type: 'globals.page_type', * language: { value: 'en' }, * locale: { value: 'en-US' } * } */ interface PageSettings { /** Page type (required) */ type: Mapping$1.Value; /** Page language (optional) */ language?: Mapping$1.Value; /** Page locale (optional) */ locale?: Mapping$1.Value; } /** * URL-based plugin configuration (for sp.js JavaScript tracker) */ interface UrlBasedPlugin { /** CDN or self-hosted URL to the plugin script */ url: string; /** [globalName, constructorName] for the plugin */ name: [string, string]; /** Optional override for enable method (derived by convention if omitted) */ enableMethod?: string; /** Options passed to the enable method */ options?: Record; } /** * Code-based plugin configuration (for @snowplow/browser-tracker npm approach) * * Use when the plugin is imported via packages.imports and passed via $code: */ interface CodeBasedPlugin { /** The plugin factory function passed via $code: */ code: BrowserPlugin | ((...args: unknown[]) => BrowserPlugin); /** Configuration options passed to the plugin factory */ config?: Record; } /** * Union type for all supported plugin forms */ type SnowplowPlugin = BrowserPlugin | UrlBasedPlugin | CodeBasedPlugin; /** * Built-in context entity types for tracker initialization */ interface TrackerContexts { /** Web page context (default: true) */ webPage?: boolean; /** Client session context - enables client_session schema */ session?: boolean; /** Browser context - device info, viewport, language, etc. */ browser?: boolean; /** Performance timing context */ performanceTiming?: boolean; /** Geolocation context */ geolocation?: boolean; } /** * Anonymous tracking configuration * * When enabled, the tracker will not set any user identifiers (domain_userid, network_userid). * This is useful for privacy-focused tracking or when user consent has not been given. */ interface AnonymousTrackingConfig { /** * Request server-side anonymisation * * When true, the collector will anonymise the user's IP address * and not set the network_userid cookie. */ withServerAnonymisation?: boolean; /** * Continue session tracking in anonymous mode * * When true, session context will still be attached to events * even when anonymous tracking is enabled. */ withSessionTracking?: boolean; } /** * Basis for processing under GDPR */ type BasisForProcessing = 'consent' | 'contract' | 'legal_obligation' | 'vital_interests' | 'public_task' | 'legitimate_interests'; /** * Consent tracking configuration * * Enables consent event tracking via the Snowplow Enhanced Consent plugin. * When configured, walkerOS consent events are translated to Snowplow * trackConsentAllow/Deny/Selected calls via the `on('consent')` handler. * * Requires @snowplow/browser-plugin-enhanced-consent to be loaded. * * @example * consent: { * required: ['analytics', 'marketing'], * basisForProcessing: 'consent', * consentUrl: 'https://example.com/privacy', * consentVersion: '2.0', * domainsApplied: ['example.com'], * gdprApplies: true, * } */ interface ConsentConfig { /** * walkerOS consent groups to check * * If not specified, all consent groups from the event are used. * Use this to filter which consent groups are relevant for Snowplow. * * @example ['analytics', 'marketing'] */ required?: string[]; /** * Legal basis for processing under GDPR * * @default 'consent' */ basisForProcessing?: BasisForProcessing; /** * URL to the privacy policy or consent document */ consentUrl?: string; /** * Version of the consent document/policy */ consentVersion?: string; /** * Domains where this consent applies * * @example ['example.com', 'shop.example.com'] */ domainsApplied?: string[]; /** * Whether GDPR applies to this user/region */ gdprApplies?: boolean; } /** * walkerOS mapping-based global context */ interface MappedGlobalContext { /** Iglu schema URI */ schema: string; /** Data mapping using walkerOS syntax */ data: Mapping$1.Map; /** Discriminator flag */ __mapped: true; } /** * Static global context (same for all events) */ interface StaticGlobalContext { schema: string; data: Record; } /** * Dynamic global context generator function */ type GlobalContextGenerator = () => StaticGlobalContext | null; /** * Union type for all global context forms */ type GlobalContext = StaticGlobalContext | GlobalContextGenerator | MappedGlobalContext; /** * Internal runtime state for the destination * * This state is instance-scoped and managed by the destination, * not configured by users. It solves SSR/serverless state leakage. */ interface RuntimeState { /** JSON stringified page object for setPageType change detection */ page?: string; /** Whether setUserId has been called for this instance */ userIdSet?: boolean; /** The initialized adapter instance */ adapter?: SnowplowAdapter; } /** * Configuration settings for Snowplow destination */ interface Settings { /** * Snowplow collector endpoint URL * * Required. The URL of your Snowplow collector. * * @example "https://collector.example.com" */ collectorUrl?: string; /** * URL to the Snowplow JavaScript tracker script * * Used when `loadScript: true`. If not provided, defaults to the jsdelivr CDN * with `@latest` version tag. * * **Security Recommendation:** Always pin to a specific version in production. * * @example 'https://cdn.jsdelivr.net/npm/@snowplow/javascript-tracker@3.24.0/dist/sp.js' * @default 'https://cdn.jsdelivr.net/npm/@snowplow/javascript-tracker@latest/dist/sp.js' */ scriptUrl?: string; /** * Tracker functions for bundled browser-tracker mode * * When provided, the destination uses these functions directly instead of * loading sp.js via script tag. Use with flow.json `$code:` syntax: * * @example * ```json * { * "packages": { * "@snowplow/browser-tracker": { * "imports": ["newTracker", "trackSelfDescribingEvent", "trackPageView"] * } * }, * "settings": { * "tracker": { * "newTracker": "$code:newTracker", * "trackSelfDescribingEvent": "$code:trackSelfDescribingEvent", * "trackPageView": "$code:trackPageView" * }, * "collectorUrl": "https://collector.example.com" * } * } * ``` */ tracker?: TrackerFunctions; /** * Application ID * * Identifier for your application in Snowplow. * * @default undefined */ appId?: string; /** * Tracker instance name * * Name for the tracker instance. Useful when running multiple trackers. * * @default "sp" */ trackerName?: string; /** * Platform identifier * * Platform the tracker is running on. * * @default "web" */ platform?: string; /** * Enable automatic page view tracking * * If true, page view events will be tracked automatically. * * @default false */ pageViewTracking?: boolean; /** * Track page view on tracker initialization * * When true, calls `trackPageView()` immediately after tracker init. * This uses Snowplow's built-in page view tracking. * * @default false */ trackPageView?: boolean; /** * Event name that triggers trackPageView * * When a walkerOS event matches this name, `trackPageView()` is called * instead of `trackSelfDescribingEvent()`. * * @example 'page view' * @example 'pageview' * @example 'screen view' */ pageViewEvent?: string; /** * Snowplow-specific ecommerce configuration */ snowplow?: SnowplowSettings; /** * Global page context (calls setPageType) * * Each field is resolved via getMappingValue. When the resolved page object * changes, setPageType is called to update the global Page context. * * @example * // Dynamic from globals * page: { * type: 'globals.page_type', * language: 'globals.language' * } * * // Static values * page: { * type: { value: 'product' }, * language: { value: 'en' }, * locale: { value: 'en-US' } * } */ page?: PageSettings; /** * User ID for Snowplow's cross-session user stitching * * Called once via setUserId() on the first event where the value resolves. * Subsequent events automatically include this user_id. * * @example * // From walkerOS user object (recommended) * userId: 'user.id' * * // From globals * userId: 'globals.user_id' */ userId?: Mapping$1.Value; /** * Discover and set the root domain for cookies * @default true */ discoverRootDomain?: boolean; /** * SameSite attribute for cookies * @default undefined (browser default) */ cookieSameSite?: 'Strict' | 'Lax' | 'None'; /** * Application version string */ appVersion?: string; /** * Built-in context entities to attach to events */ contexts?: TrackerContexts; /** * Enable anonymous tracking * * When enabled, the tracker will not set user identifiers. * Can be a boolean (true enables basic anonymous tracking) or * a configuration object for fine-grained control. * * @example * // Basic anonymous tracking * anonymousTracking: true * * @example * // With server-side anonymisation * anonymousTracking: { * withServerAnonymisation: true, * withSessionTracking: true * } */ anonymousTracking?: boolean | AnonymousTrackingConfig; /** * Snowplow plugins to load (BrowserPlugin or URL-based) */ plugins?: SnowplowPlugin[]; /** * Activity tracking configuration (page pings) */ activityTracking?: ActivityTrackingConfiguration; /** * Global context entities attached to all events */ globalContexts?: GlobalContext[]; /** * Consent tracking configuration * * When configured, enables consent event tracking via the `on('consent')` handler. * Requires @snowplow/browser-plugin-enhanced-consent to be loaded. * * @example * consent: { * required: ['analytics', 'marketing'], * basisForProcessing: 'consent', * consentUrl: 'https://example.com/privacy', * consentVersion: '2.0', * } */ consent?: ConsentConfig; /** * Internal runtime state (managed by destination, not user-configured) * @internal */ _state?: RuntimeState; } /** * Snowplow-specific settings (similar to GA4Settings in gtag) */ interface SnowplowSettings { /** * Ecommerce action schema URI * * Schema used for all ecommerce action events. * * @default "iglu:com.snowplowanalytics.snowplow.ecommerce/snowplow_ecommerce_action/jsonschema/1-0-2" */ actionSchema?: string; /** * Product entity schema URI * * @default "iglu:com.snowplowanalytics.snowplow.ecommerce/product/jsonschema/1-0-0" */ productSchema?: string; /** * Cart entity schema URI * * @default "iglu:com.snowplowanalytics.snowplow.ecommerce/cart/jsonschema/1-0-0" */ cartSchema?: string; /** * Transaction entity schema URI * * @default "iglu:com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0" */ transactionSchema?: string; /** * Refund entity schema URI * * @default "iglu:com.snowplowanalytics.snowplow.ecommerce/refund/jsonschema/1-0-0" */ refundSchema?: string; /** * Checkout step entity schema URI * * @default "iglu:com.snowplowanalytics.snowplow.ecommerce/checkout_step/jsonschema/1-0-0" */ checkoutStepSchema?: string; /** * Promotion entity schema URI * * @default "iglu:com.snowplowanalytics.snowplow.ecommerce/promotion/jsonschema/1-0-0" */ promotionSchema?: string; /** * User entity schema URI (optional) * * @example "iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-0" */ userSchema?: string; /** * Custom entity schemas * * Define schemas for custom context entities. * * @example { custom_entity: "iglu:com.example/custom/jsonschema/1-0-0" } */ customSchemas?: { [entityType: string]: string; }; /** * Default currency code (ISO 4217) * * Used as fallback when currency is not specified in event data. * * @example "USD", "EUR", "GBP" * @default "USD" */ currency?: string; /** * Data mapping at destination level * * Global data transformation applied to all events. */ data?: Mapping$1.Value | Mapping$1.Values; } /** * Context entity definition for Snowplow * * Each context entity has a schema URI and data mapping. */ interface ContextEntity { /** * Iglu schema URI for this context entity * * @example SCHEMAS.PRODUCT, SCHEMAS.TRANSACTION */ schema: string; /** * Data mapping for this context entity * * Uses standard walkerOS mapping syntax. * * @example { id: 'data.id', name: 'data.name', price: 'data.price' } */ data: Mapping$1.Map; } /** * Structured event mapping for Snowplow's trackStructEvent * * When configured, bypasses self-describing events entirely * and calls trackStructEvent with the resolved values. * * @example * struct: { * category: { value: 'ui' }, * action: { value: 'click' }, * label: 'data.button_name', * property: 'data.section', * value: 'data.position', * } */ interface StructuredEventMapping { /** Event category (required) */ category: Mapping$1.Value; /** Event action (required) */ action: Mapping$1.Value; /** Event label (optional) */ label?: Mapping$1.Value; /** Event property (optional) */ property?: Mapping$1.Value; /** Event value - must resolve to a number (optional) */ value?: Mapping$1.Value; } /** * Custom mapping parameters for Snowplow events * * Uses standard `name` field for action type. * The `name` from the mapping rule becomes Snowplow's event.data.type. */ interface Mapping { /** * Context entities to attach to this event * * Each entry defines a schema and data mapping. * Explicit - no auto-detection. * * @example * context: [ * { schema: SCHEMAS.PRODUCT, data: { id: 'data.id', name: 'data.name' } } * ] */ context?: ContextEntity[]; /** * Snowplow-specific settings override */ snowplow?: SnowplowMappingSettings; /** * Custom data mapping for self-describing event payload * * When specified with a `map` property, the mapped values are used * as the event data instead of the default ecommerce pattern. * Useful for media events (percent_progress) and custom schemas. * * @example * data: { map: { percentProgress: 'data.progress' } } */ data?: Mapping$1.Value; /** * Structured event mapping (bypasses self-describing events) * * When configured, calls trackStructEvent instead of trackSelfDescribingEvent. * No schema is used - this completely bypasses the self-describing event path. * * @example * struct: { * category: { value: 'ui' }, * action: { value: 'click' }, * label: 'data.button_name', * } */ struct?: StructuredEventMapping; } /** * Per-event Snowplow settings override */ interface SnowplowMappingSettings { /** * Override action schema for this specific event */ actionSchema?: string; } /** * Environment dependencies for Snowplow destination */ interface Env extends DestinationWeb.Env { window: { snowplow?: SnowplowFunction; }; } type Types = Destination$1.Types; type Destination = DestinationWeb.Destination; type Config = DestinationWeb.Config; type Rule = Mapping$1.Rule; type Rules = Mapping$1.Rules; type Param = Mapping$1.Value; /** * Snowplow Ecommerce Schema URIs * Based on Snowplow Analytics official ecommerce schema */ declare const SCHEMAS: { readonly ACTION: "iglu:com.snowplowanalytics.snowplow.ecommerce/snowplow_ecommerce_action/jsonschema/1-0-2"; readonly PRODUCT: "iglu:com.snowplowanalytics.snowplow.ecommerce/product/jsonschema/1-0-0"; readonly CART: "iglu:com.snowplowanalytics.snowplow.ecommerce/cart/jsonschema/1-0-0"; readonly TRANSACTION: "iglu:com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0"; readonly REFUND: "iglu:com.snowplowanalytics.snowplow.ecommerce/refund/jsonschema/1-0-0"; readonly CHECKOUT_STEP: "iglu:com.snowplowanalytics.snowplow.ecommerce/checkout_step/jsonschema/1-0-0"; readonly PROMOTION: "iglu:com.snowplowanalytics.snowplow.ecommerce/promotion/jsonschema/1-0-0"; readonly PAGE: "iglu:com.snowplowanalytics.snowplow.ecommerce/page/jsonschema/1-0-0"; readonly USER: "iglu:com.snowplowanalytics.snowplow.ecommerce/user/jsonschema/1-0-0"; }; /** * Snowplow ecommerce action types * Type-safe values matching official Action['type'] */ declare const ACTIONS: { readonly PRODUCT_VIEW: "product_view"; readonly LIST_VIEW: "list_view"; readonly LIST_CLICK: "list_click"; readonly ADD_TO_CART: "add_to_cart"; readonly REMOVE_FROM_CART: "remove_from_cart"; readonly CHECKOUT_STEP: "checkout_step"; readonly TRANSACTION: "transaction"; readonly REFUND: "refund"; readonly PROMO_VIEW: "promo_view"; readonly PROMO_CLICK: "promo_click"; readonly TRANSACTION_ERROR: "trns_error"; }; /** * Snowplow Web Schema URIs * Events and contexts for web analytics tracking */ declare const WEB_SCHEMAS: { readonly LINK_CLICK: "iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1"; readonly CHANGE_FORM: "iglu:com.snowplowanalytics.snowplow/change_form/jsonschema/1-0-0"; readonly FOCUS_FORM: "iglu:com.snowplowanalytics.snowplow/focus_form/jsonschema/1-0-0"; readonly SUBMIT_FORM: "iglu:com.snowplowanalytics.snowplow/submit_form/jsonschema/1-0-0"; readonly SITE_SEARCH: "iglu:com.snowplowanalytics.snowplow/site_search/jsonschema/1-0-0"; readonly SOCIAL: "iglu:com.snowplowanalytics.snowplow/social_interaction/jsonschema/1-0-0"; readonly TIMING: "iglu:com.snowplowanalytics.snowplow/timing/jsonschema/1-0-0"; readonly WEB_VITALS: "iglu:com.snowplowanalytics.snowplow/web_vitals/jsonschema/1-0-0"; readonly WEB_PAGE: "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0"; readonly BROWSER: "iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0"; readonly CLIENT_SESSION: "iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2"; readonly GEOLOCATION: "iglu:com.snowplowanalytics.snowplow/geolocation_context/jsonschema/1-1-0"; }; /** * Snowplow Consent Schema URIs * For Enhanced Consent plugin events and contexts */ declare const CONSENT_SCHEMAS: { readonly PREFERENCES: "iglu:com.snowplowanalytics.snowplow/consent_preferences/jsonschema/1-0-0"; readonly CMP_VISIBLE: "iglu:com.snowplowanalytics.snowplow/cmp_visible/jsonschema/1-0-0"; readonly DOCUMENT: "iglu:com.snowplowanalytics.snowplow/consent_document/jsonschema/1-0-0"; readonly GDPR: "iglu:com.snowplowanalytics.snowplow/gdpr/jsonschema/1-0-0"; }; /** * Snowplow Media Schema URIs * Events and contexts for media (video/audio) tracking * * Requires @snowplow/browser-plugin-media-tracking for automatic tracking * or can be used manually with trackSelfDescribingEvent * * @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/media/ */ declare const MEDIA_SCHEMAS: { readonly PLAY: "iglu:com.snowplowanalytics.snowplow.media/play_event/jsonschema/1-0-0"; readonly PAUSE: "iglu:com.snowplowanalytics.snowplow.media/pause_event/jsonschema/1-0-0"; readonly END: "iglu:com.snowplowanalytics.snowplow.media/end_event/jsonschema/1-0-0"; readonly READY: "iglu:com.snowplowanalytics.snowplow.media/ready_event/jsonschema/1-0-0"; readonly SEEK_START: "iglu:com.snowplowanalytics.snowplow.media/seek_start_event/jsonschema/1-0-0"; readonly SEEK_END: "iglu:com.snowplowanalytics.snowplow.media/seek_end_event/jsonschema/1-0-0"; readonly BUFFER_START: "iglu:com.snowplowanalytics.snowplow.media/buffer_start_event/jsonschema/1-0-0"; readonly BUFFER_END: "iglu:com.snowplowanalytics.snowplow.media/buffer_end_event/jsonschema/1-0-0"; readonly QUALITY_CHANGE: "iglu:com.snowplowanalytics.snowplow.media/quality_change_event/jsonschema/1-0-0"; readonly FULLSCREEN_CHANGE: "iglu:com.snowplowanalytics.snowplow.media/fullscreen_change_event/jsonschema/1-0-0"; readonly VOLUME_CHANGE: "iglu:com.snowplowanalytics.snowplow.media/volume_change_event/jsonschema/1-0-0"; readonly PLAYBACK_RATE_CHANGE: "iglu:com.snowplowanalytics.snowplow.media/playback_rate_change_event/jsonschema/1-0-0"; readonly PIP_CHANGE: "iglu:com.snowplowanalytics.snowplow.media/picture_in_picture_change_event/jsonschema/1-0-0"; readonly PING: "iglu:com.snowplowanalytics.snowplow.media/ping_event/jsonschema/1-0-0"; readonly PERCENT_PROGRESS: "iglu:com.snowplowanalytics.snowplow.media/percent_progress_event/jsonschema/1-0-0"; readonly ERROR: "iglu:com.snowplowanalytics.snowplow.media/error_event/jsonschema/1-0-0"; readonly AD_BREAK_START: "iglu:com.snowplowanalytics.snowplow.media/ad_break_start_event/jsonschema/1-0-0"; readonly AD_BREAK_END: "iglu:com.snowplowanalytics.snowplow.media/ad_break_end_event/jsonschema/1-0-0"; readonly AD_START: "iglu:com.snowplowanalytics.snowplow.media/ad_start_event/jsonschema/1-0-0"; readonly AD_COMPLETE: "iglu:com.snowplowanalytics.snowplow.media/ad_complete_event/jsonschema/1-0-0"; readonly AD_SKIP: "iglu:com.snowplowanalytics.snowplow.media/ad_skip_event/jsonschema/1-0-0"; readonly AD_CLICK: "iglu:com.snowplowanalytics.snowplow.media/ad_click_event/jsonschema/1-0-0"; readonly AD_PAUSE: "iglu:com.snowplowanalytics.snowplow.media/ad_pause_event/jsonschema/1-0-0"; readonly AD_RESUME: "iglu:com.snowplowanalytics.snowplow.media/ad_resume_event/jsonschema/1-0-0"; readonly AD_QUARTILE: "iglu:com.snowplowanalytics.snowplow.media/ad_quartile_event/jsonschema/1-0-0"; readonly MEDIA_PLAYER: "iglu:com.snowplowanalytics.snowplow/media_player/jsonschema/1-0-0"; readonly SESSION: "iglu:com.snowplowanalytics.snowplow.media/session/jsonschema/1-0-0"; readonly AD: "iglu:com.snowplowanalytics.snowplow.media/ad/jsonschema/1-0-0"; readonly AD_BREAK: "iglu:com.snowplowanalytics.snowplow.media/ad_break/jsonschema/1-0-0"; }; /** * Media action types for event mapping * Use with mapping.name to specify the action type */ declare const MEDIA_ACTIONS: { readonly PLAY: "play"; readonly PAUSE: "pause"; readonly END: "end"; readonly READY: "ready"; readonly SEEK_START: "seek_start"; readonly SEEK_END: "seek_end"; readonly BUFFER_START: "buffer_start"; readonly BUFFER_END: "buffer_end"; readonly QUALITY_CHANGE: "quality_change"; readonly FULLSCREEN_CHANGE: "fullscreen_change"; readonly VOLUME_CHANGE: "volume_change"; readonly PLAYBACK_RATE_CHANGE: "playback_rate_change"; readonly PIP_CHANGE: "pip_change"; readonly PING: "ping"; readonly PERCENT_PROGRESS: "percent_progress"; readonly ERROR: "error"; readonly AD_BREAK_START: "ad_break_start"; readonly AD_BREAK_END: "ad_break_end"; readonly AD_START: "ad_start"; readonly AD_COMPLETE: "ad_complete"; readonly AD_SKIP: "ad_skip"; readonly AD_CLICK: "ad_click"; readonly AD_PAUSE: "ad_pause"; readonly AD_RESUME: "ad_resume"; readonly AD_QUARTILE: "ad_quartile"; }; /** * Type guard for URL-based plugins */ declare function isUrlBasedPlugin(plugin: SnowplowPlugin): plugin is UrlBasedPlugin; /** * Type guard for code-based plugins */ declare function isCodeBasedPlugin(plugin: SnowplowPlugin): plugin is CodeBasedPlugin; /** * Type guard for mapped global contexts */ declare function isMappedGlobalContext(ctx: GlobalContext): ctx is MappedGlobalContext; /** * Derive enable method from plugin constructor name * 'LinkClickTrackingPlugin' -> 'enableLinkClickTracking' */ declare function deriveEnableMethod(constructorName: string): string; declare const index_ACTIONS: typeof ACTIONS; declare const index_Action: typeof Action; declare const index_ActivityTrackingConfiguration: typeof ActivityTrackingConfiguration; type index_AnonymousTrackingConfig = AnonymousTrackingConfig; type index_BasisForProcessing = BasisForProcessing; declare const index_BrowserPlugin: typeof BrowserPlugin; declare const index_CONSENT_SCHEMAS: typeof CONSENT_SCHEMAS; declare const index_Cart: typeof Cart; declare const index_CheckoutStep: typeof CheckoutStep; type index_CodeBasedPlugin = CodeBasedPlugin; declare const index_CommonEventProperties: typeof CommonEventProperties; type index_Config = Config; type index_ConsentConfig = ConsentConfig; type index_ContextEntity = ContextEntity; type index_Destination = Destination; type index_Env = Env; type index_GlobalContext = GlobalContext; type index_GlobalContextGenerator = GlobalContextGenerator; declare const index_MEDIA_ACTIONS: typeof MEDIA_ACTIONS; declare const index_MEDIA_SCHEMAS: typeof MEDIA_SCHEMAS; type index_MappedGlobalContext = MappedGlobalContext; type index_Mapping = Mapping; declare const index_Page: typeof Page; type index_PageSettings = PageSettings; type index_Param = Param; declare const index_Product: typeof Product; declare const index_Refund: typeof Refund; type index_Rule = Rule; type index_Rules = Rules; type index_RuntimeState = RuntimeState; declare const index_SCHEMAS: typeof SCHEMAS; declare const index_SPPromotion: typeof SPPromotion; declare const index_SPTransaction: typeof SPTransaction; type index_SelfDescribingEvent = SelfDescribingEvent; declare const index_SelfDescribingJson: typeof SelfDescribingJson; type index_Settings = Settings; type index_SnowplowAdapter = SnowplowAdapter; type index_SnowplowFunction = SnowplowFunction; type index_SnowplowMappingSettings = SnowplowMappingSettings; type index_SnowplowPlugin = SnowplowPlugin; type index_SnowplowSettings = SnowplowSettings; type index_StaticGlobalContext = StaticGlobalContext; type index_StructuredEventMapping = StructuredEventMapping; type index_TrackerContexts = TrackerContexts; type index_TrackerFactory = TrackerFactory; type index_TrackerFunctions = TrackerFunctions; declare const index_TransactionError: typeof TransactionError; type index_Types = Types; type index_UrlBasedPlugin = UrlBasedPlugin; declare const index_User: typeof User; declare const index_WEB_SCHEMAS: typeof WEB_SCHEMAS; declare const index_deriveEnableMethod: typeof deriveEnableMethod; declare const index_isCodeBasedPlugin: typeof isCodeBasedPlugin; declare const index_isMappedGlobalContext: typeof isMappedGlobalContext; declare const index_isUrlBasedPlugin: typeof isUrlBasedPlugin; declare namespace index { export { index_ACTIONS as ACTIONS, index_Action as Action, index_ActivityTrackingConfiguration as ActivityTrackingConfiguration, type index_AnonymousTrackingConfig as AnonymousTrackingConfig, type index_BasisForProcessing as BasisForProcessing, index_BrowserPlugin as BrowserPlugin, index_CONSENT_SCHEMAS as CONSENT_SCHEMAS, index_Cart as Cart, index_CheckoutStep as CheckoutStep, type index_CodeBasedPlugin as CodeBasedPlugin, index_CommonEventProperties as CommonEventProperties, type index_Config as Config, type index_ConsentConfig as ConsentConfig, type index_ContextEntity as ContextEntity, type index_Destination as Destination, type index_Env as Env, type index_GlobalContext as GlobalContext, type index_GlobalContextGenerator as GlobalContextGenerator, index_MEDIA_ACTIONS as MEDIA_ACTIONS, index_MEDIA_SCHEMAS as MEDIA_SCHEMAS, type index_MappedGlobalContext as MappedGlobalContext, type index_Mapping as Mapping, index_Page as Page, type index_PageSettings as PageSettings, type index_Param as Param, index_Product as Product, index_Refund as Refund, type index_Rule as Rule, type index_Rules as Rules, type index_RuntimeState as RuntimeState, index_SCHEMAS as SCHEMAS, index_SPPromotion as SPPromotion, index_SPTransaction as SPTransaction, type index_SelfDescribingEvent as SelfDescribingEvent, index_SelfDescribingJson as SelfDescribingJson, type index_Settings as Settings, type index_SnowplowAdapter as SnowplowAdapter, type index_SnowplowFunction as SnowplowFunction, type index_SnowplowMappingSettings as SnowplowMappingSettings, type index_SnowplowPlugin as SnowplowPlugin, type index_SnowplowSettings as SnowplowSettings, type index_StaticGlobalContext as StaticGlobalContext, type index_StructuredEventMapping as StructuredEventMapping, type index_TrackerContexts as TrackerContexts, type index_TrackerFactory as TrackerFactory, type index_TrackerFunctions as TrackerFunctions, index_TransactionError as TransactionError, type index_Types as Types, type index_UrlBasedPlugin as UrlBasedPlugin, index_User as User, index_WEB_SCHEMAS as WEB_SCHEMAS, index_deriveEnableMethod as deriveEnableMethod, index_isCodeBasedPlugin as isCodeBasedPlugin, index_isMappedGlobalContext as isMappedGlobalContext, index_isUrlBasedPlugin as isUrlBasedPlugin }; } /** * Clear all user data (cookies and local storage) * * Call this when a user withdraws consent or logs out to remove * all Snowplow identifiers (domain_userid, session cookies, etc.). * * @param env - Optional environment override for testing * * @example * ```typescript * import { clearUserData } from '@walkeros/web-destination-snowplow'; * * // When user withdraws consent * clearUserData(); * ``` */ declare function clearUserData(env?: Env): void; /** * Enable anonymous tracking mode * * Call this to start anonymous tracking after initialization. * Useful when consent state changes during the session. * * @param options - Optional configuration for anonymous tracking * @param env - Optional environment override for testing * * @example * ```typescript * import { enableAnonymousTracking } from '@walkeros/web-destination-snowplow'; * * // Enable with server anonymisation * enableAnonymousTracking({ withServerAnonymisation: true }); * ``` */ declare function enableAnonymousTracking(options?: { withServerAnonymisation?: boolean; withSessionTracking?: boolean; }, env?: Env): void; /** * Disable anonymous tracking mode * * Call this to resume normal tracking after anonymous mode. * Useful when a user grants consent during the session. * * @param stateStorageStrategy - Optional storage strategy for state * @param env - Optional environment override for testing * * @example * ```typescript * import { disableAnonymousTracking } from '@walkeros/web-destination-snowplow'; * * // Resume normal tracking * disableAnonymousTracking(); * ``` */ declare function disableAnonymousTracking(stateStorageStrategy?: 'cookieAndLocalStorage' | 'cookie' | 'localStorage' | 'none', env?: Env): void; /** * Snowplow destination for walkerOS * * Sends events to Snowplow Analytics using the browser tracker. * * @example * Basic usage * ```typescript * import { destinationSnowplow } from '@walkeros/web-destination-snowplow'; * * elb('walker destination', destinationSnowplow, { * settings: { * collectorUrl: 'https://collector.example.com', * appId: 'my-app' * } * }); * ``` * * @example * With custom tracker name * ```typescript * elb('walker destination', destinationSnowplow, { * settings: { * collectorUrl: 'https://collector.example.com', * appId: 'my-app', * trackerName: 'myTracker' * } * }); * ``` */ declare const destinationSnowplow: Destination; export { ACTIONS, CONSENT_SCHEMAS, index as DestinationSnowplow, MEDIA_ACTIONS, MEDIA_SCHEMAS, SCHEMAS, WEB_SCHEMAS, clearUserData, destinationSnowplow as default, destinationSnowplow, disableAnonymousTracking, enableAnonymousTracking };