AudienceOptions
The audience half of createContentClient: everything between “this visitor” and “the right content” that an implementer should never have to know about. It asks Content
which audiences it uses, asks Audience which of them the visitor is in (once per session, using the visitor’s cookie and consent where they exist), keeps the signed answer in
memory only, hands it to every read, and renews it before it expires or when something may have changed (a Forms submission, the tab becoming visible again after a pause, a
response that says the token is stale). It never throws into a page: when Audience cannot answer, the visitor simply holds no audiences and onError hears about it.
Properties
Section titled “Properties”apiKey
Section titled “apiKey”apiKey:
string
An Audience delivery key. A key with an allowed-origins or IP restriction is browser-safe; one with neither is a server key and must never reach a browser.
baseUrl?
Section titled “baseUrl?”
optionalbaseUrl?:string
consent?
Section titled “consent?”
optionalconsent?:AudienceConsentSignals| (() =>AudienceConsentSignals|undefined)
The device’s raw consent signals (cmp, gpc, dnt, cmpString), when your site has them. Only Audience turns these into a decision.
context?
Section titled “context?”
optionalcontext?:ContextBag| (() =>ContextBag|Promise<ContextBag>)
What the page knows about this visit, sent to Audience only (never to Content), so a campaign tag can place the visitor in a “came from a campaign” audience without splitting Content’s cache. A flat object of strings, numbers, booleans and lists of those, or a function producing it each time the visitor’s audiences are asked for.
fetch?
Section titled “fetch?”
optionalfetch?: {(input,init?):Promise<Response>; (input,init?):Promise<Response>; }
Call Signature
Section titled “Call Signature”(
input,init?):Promise<Response>
Parameters
Section titled “Parameters”URL | RequestInfo
RequestInit
Returns
Section titled “Returns”Promise<Response>
Call Signature
Section titled “Call Signature”(
input,init?):Promise<Response>
Parameters
Section titled “Parameters”string | URL | Request
RequestInit
Returns
Section titled “Returns”Promise<Response>
handoff?
Section titled “handoff?”
optionalhandoff?:boolean
Whether to act on a #ebitex-verify=<code> fragment in the page’s address: the code a verification page hands to the page it continues to, so the browser that followed an emailed link is
verified too. On by default; false leaves the fragment alone.
onError?
Section titled “onError?”
optionalonError?: (error) =>void
Called when Audience or the audience list could not be read. The page still renders (the visitor holds no audiences); this is for your logs.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”void
visitor?
Section titled “visitor?”
optionalvisitor?:string| (() =>string|null|undefined) |null
visitors?
Section titled “visitors?”
optionalvisitors?:object
The visitors SDK instance (createVisitors(...)): its token is the device’s visitor token. Or pass the token yourself with visitor. In a browser with neither, the ebitex_visitor cookie is read.
readonlytoken:string|null