Skip to main content
Configures the SDK. Must be called once, before any other SDK method.

Signature

Returns true on success. On invalid input it logs the validation error and returns false; it does not throw.
Configure-once: only the first successful call is honored. Subsequent calls log a warning and are ignored; reload the page to reconfigure.

Structure

configure() carries connection and behavior settings only; there is no user id in it. The SDK generates an anonymous UUID on first load and persists it in localStorage (the same visitor keeps the same id across reloads); attach your real user id with identify() once you know it.

Field Reference

configure() carries connection and behavior settings only. Offer-surface copy is not set here: per-presentation copy is set via a placement’s headline / subheadline options (see placement()), and campaign copy is managed remotely per campaign.

Examples

React apps can use the provider instead (same options as props); see the React guide:

Inspecting the live configuration

getConfiguration() returns a read-only snapshot of what the SDK is actually using (including the resolved endpoint URLs), or null before a successful configure().

Unlock mode

unlockMode decides when the SDK treats a claim as confirmed. It is set once for the session, matching the UnlockMode axis on the native SDKs. Four things change in strict mode:
  • Offers are pre-filtered to campaigns whose postback latency can plausibly land inside the verification window, so the SDK does not serve an offer it already knows it cannot confirm in time. Such a fetch also bypasses the offer cache.
  • The entitlement grant is held. Optimistic mode signals a provisional grant at handoff. Strict mode signals nothing then, and a final grant once the postback verifies.
  • An unverified claim is retried on later page loads and on every return to the tab, for up to seven days.
  • Verification is reported through a callback, since it usually lands after show() has resolved. See onStrictUnlockVerified().
show() resolves 'claimed' at handoff in both modes, and ShowResult carries no verified flag. On the web the advertiser opens in a separate tab and the SDK renders nothing after a claim, so strict mode reports verification through the callback instead. Treat 'claimed' as a presentation fact in either mode, never as proof of conversion: access is server-authoritative.
An unrecognized unlockMode fails configure() rather than falling back, so a typo surfaces immediately.