AudienceHandle
Properties
Section titled “Properties”audiences
Section titled “audiences”
readonlyaudiences: readonlystring[]
The ids of the audiences the visitor holds that Content uses (a hint for your own UI: the server already decided what to deliver).
revision
Section titled “revision”
readonlyrevision:number
Increments each time the visitor’s audiences change.
Methods
Section titled “Methods”dispose()
Section titled “dispose()”dispose():
void
Stops the listeners and the renewal timer this session holds.
Returns
Section titled “Returns”void
onChange()
Section titled “onChange()”onChange(
listener): () =>void
Called whenever the visitor’s audiences change. Returns the function that stops listening.
Parameters
Section titled “Parameters”listener
Section titled “listener”() => void
Returns
Section titled “Returns”() => void
redeemHandoff()
Section titled “redeemHandoff()”redeemHandoff(
code):Promise<void>
Proves this device with the one-time code a verification page handed to the page you continued to (#ebitex-verify=<code> in the address), then re-reads the audiences. The client does this
itself on load unless handoff: false; call it yourself when you read the code some other way. Needs the device’s visitor token, like signIn.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
refresh()
Section titled “refresh()”refresh():
Promise<void>
Renews the visitor’s audiences now, re-reading what changed. Needed only to force it: a Forms submission, a sign-in link followed in another tab, an expiring token and a stale-token response each do it by themselves.
Returns
Section titled “Returns”Promise<void>
signIn()
Section titled “signIn()”signIn(
options?):Promise<{message:string; }>
Asks for a one-time sign-in link to be emailed, for the device’s visitor. The answer never depends on the address.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”audienceId?
Section titled “audienceId?”string
returnUrl?
Section titled “returnUrl?”string
Returns
Section titled “Returns”Promise<{ message: string; }>
watch()
Section titled “watch()”watch(
options?): () =>void
Re-reads the visitor’s audiences every few seconds while a tab is visible, until the returned function is called or maxSeconds (default 900, the life of a sign-in link) has passed.
For the wait after a link was emailed, when it may be followed on another device and this tab, which never goes hidden, would otherwise show nothing until it is reloaded.
Parameters
Section titled “Parameters”options?
Section titled “options?”maxSeconds?
Section titled “maxSeconds?”number
Returns
Section titled “Returns”() => void