/** * This is AmperWave's cookie sync script. It bundles cookie syncs for several other platforms under a single function call. * Individual DSP implementations are not guaranteed from version-to-version and the syncs are only suitable for use with AmperWave's ad platform. * * This script is provided as an ES Module and a Universal Module definition. * * @example * * To use the ES module, the calling script also needs to be a module. Some modern bundlers (eg: Vite and Webpack >=5) support this include directly. * * ``` * * * * * * * * ```` * * @example * * To use the Universal Module Definition, include the script in the page. This will define a global `AmperWave` that includes the function. * This method works well in situations where a module isn't easy to implement. * * ``` * * * * * * * * * ```` * * @packageDocumentation * @author AmperWave */ /** * Identifiers for the supported DSPs. * * The strings allowed here reflect the currently supported DSPs. Acceptable values may be added or removed, but the script will continue to accept old values. **/ declare type DSPKeys = 'AWZ' | 'TAP' | 'MAG' | 'TTD'; /** * Sync cookies performs various DSP cookie syncs and returns a mapping of query parameters that are expected on calls to get AmperWave ads. * * @returns An object of key/value pairs that should be attached as query parameters on stream and gateway URLs */ export declare function syncCookies(params: SyncParams): Promise; /** * Input parameters for performing a cookie sync. All of these properties are optional, * but most cookie syncs will not function unless they are set. * For best results, include as many fields as available. */ declare type SyncParams = { /** * List of DSP identifiers to enable cookie syncs for. * If listed explicitly, some fields will be become required. Such cases are documented individually. * If omitted, all available cookie syncs will be attempted. Integrations that are missing required fields, will be skipped. */ enabledDSPS?: DSPKeys[]; /** * Timeout in milliseconds from the start of the syncCookies call until the returned Promise resolves. * If timeout is omitted, the Promise will remain unresolved until they are done. It's recommended to pass a value here. * If all cookie syncs are completed before the timeout, the Promise will resolve early. * Any cookie syncs that are incomplete when the timeout is reached will continue in the background and the result will be cached. */ timeout?: number; /** * If true, the internal caching in cookieSync will be disabled. * Recommended to use only for debugging. */ skipCache?: boolean; /** * Some unique identifier for the listener. This should be unique for a given listener, but somewhat consistent between calls to the syncCookies. * Internal caches will be keyed off of this ID, so changing it will invalidate those caches. * * If the field is omitted or left blank, an internally maintained key will be generated and persisted. This is appropriate for listeners who are not logged in. */ userId?: string; /** * AmperWave-specific identifier for the current station/podcast playing. */ amperwaveStationId?: string; /** * Flag indicating if GDPR regulations apply. If 1 or true, a gdprConsent string must be provided. */ gdpr?: boolean | 0 | 1; /** * Base64URL-encoded IAB GDPR Transparency & Consent consent string. * * See https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/Consent%20string%20and%20vendor%20list%20formats%20v1.1%20Final.md */ gdprConsent?: string; /** * Global Privacy Platform String; encodes privacy preferences and requirements for the listener. Encapsulates multiple privacy standards including us_privacy and ggp_consent. * * See https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Core/Consent%20String%20Specification.md * Required for AWZ integration. */ gpp?: string; /** * IAB US Privacy String * * See https://github.com/InteractiveAdvertisingBureau/USPrivacy/blob/master/CCPA/US%20Privacy%20String.md * Required for AWZ integration. */ usPrivacy?: string; /** TAP-specific identifier the current station/podcast playing. * Required for TAP integration, but if unset, the amperwaveStationId may be used to populate this value instead. */ tapStationId?: number | string; /** * Partner ID provided by Magnite. * Required for MAG integration. */ magnitePartnerKey?: number; /** * Endpoint for Magnite. * Required for MAG integration. */ magniteEndpoint?: 'us-east' | 'us-west' | 'eu' | 'apac'; /** * Partner ID provided by The Trade Desk for your organization. * Required for TTD integration. * See https://partner.thetradedesk.com/v3/portal/data/doc/CookieSyncing#setup */ ttdPId?: string; /* Excluded from this release type: ttdId */ }; /** * A sync result contains the values that should be appended to a stream or gateway URL before calling AmperWave. * Keys in the object are query parameter names and the values are the values. The exact values in the object should not * be relied upon by callers. values may be added/removed without warning. * * @example * If given the result `{"foo": "1", "bar": "2", "baz: "3"}`, it should be transformed into query parameters `foo=1&bar=2&baz=3` */ declare type SyncResult = { [param: string]: string; }; export { }