configure() once, as early as possible in your application lifecycle, before any other
SDK method. Only the API key is required:
pk_ and is safe to ship in client-side code.
The options
configure() reference.
Two choices worth making up front:
- User identity is not configured here. The SDK auto-generates an anonymous UUID and
persists it in
localStorage; attach your own stable id withidentify()once you know it. redemptionModesets the app-wide default claim flow:'deferred'(default; your code callsredeem()later) vs'immediate'(one step). Placements can override it per surface. See Redemption Modes.
Full example
configure() returns true on success and false on invalid input (it logs the reason;
it does not throw). Verify the live values at any time:
Supported Web Development Frameworks
The SDK works with every major web framework. Each guide shows where to callconfigure()
and the full integration pattern, end to end:
React
EncoreProvider wraps your app; same options as configure(), passed as propsVue
Call
configure() in the root component’s onMounted hookSvelte
Call
configure() in the root component’s onMount hookAngular
Wrap the SDK in a root-provided service that configures on construction
Vanilla JS
No bundler: load the UMD build from a script tag and use the
EncoreSDK globalNext steps
- User Management: anonymous ids,
identify(), attributes,reset() - Present Offers: show offers and handle the result