Skip to main content
Configures the shared Encore instance for use throughout your app. Call it once, at app startup, before any other SDK method. If your Encore flows include an in-app purchase, pass your purchase controller here. Binding it is part of configuring, so the SDK is never configured without the purchase path it was meant to have.

Signature

Parameters

Options

Unlock mode

'optimistic' records the claim and finishes. 'strict' verifies the claim server-side, persisting unverified claims and re-checking them across launches; those settle later as a strict_unlock_verified event on Encore.onOutcome. Set once, at configure. It selects how a claim flow runs, never how a result is read: the presentation record is written identically in both modes.

API keys

Use the test key (pk_test_...) during development to exercise the entire entitlement lifecycle end to end. It serves a demo catalog, so the claim, the advertiser page, and the unlock all work without a live campaign or a real payout.Your own offers do not appear under a test key. For that, use the live key and accept that the traffic is recorded. See what a test key serves.
Always use your live key (pk_live_...) in production builds.

Usage

The provider forwards the purchaseController prop into configure, which it calls once, on mount. Only the value from the first render is bound; swap it later with Encore.setPurchaseController() if it genuinely needs to change at runtime.

Direct configuration

Configuring without a purchase controller

If your Encore flows include no in-app purchase, omit the option. The SDK then never attempts a purchase, logs its own sdk_iap_no_purchase_controller diagnostic, and every presentation records publisher: 'not_attempted'. That is a supported configuration and a more accurate record than a failure your app never caused.
Use logLevel: 'debug' during development to see detailed SDK logs, then 'none' for production builds.