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
| Field | Type | Required | Default | Description |
|---|
apiKey | string | Yes | - | Publishable key (pk_...) from the Dashboard. Safe in client-side code. |
logLevel | string | No | 'none' | 'debug' for verbose console logging during integration. Changeable later with Encore.setLogLevel(level). |
redemptionMode | string | No | 'deferred' | The app-wide default claim↔redeem coupling; a placement’s own redemptionMode option overrides it per surface. 'deferred': show() records the claim, redeem() fires the redirect later. 'immediate': claiming opens the advertiser tab in one step. See Redemption Modes. |
Offer-surface copy is not configured here: per-surface heading copy is set via a
placement’s header option (see
placement()); 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().