Skip to content

AudienceHandle

readonly audiences: readonly string[]

The ids of the audiences the visitor holds that Content uses (a hint for your own UI: the server already decided what to deliver).


readonly revision: number

Increments each time the visitor’s audiences change.

dispose(): void

Stops the listeners and the renewal timer this session holds.

void


onChange(listener): () => void

Called whenever the visitor’s audiences change. Returns the function that stops listening.

() => void

() => void


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.

string

Promise<void>


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.

Promise<void>


signIn(email, 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.

string

string

string

Promise<{ message: string; }>


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.

number

() => void