Overview
As soon as your app launches, you need to configure the SDK with your API Key. Retrieve your publishable Live key yourself from the Dashboard under Settings → Project API Keys (use the Test key for staging and local development).Initialize Encore in Your App
Edit your mainApp struct to configure Encore at launch:
Encore, the primary class for interacting with the SDK’s API. Make sure to replace pk_live_your_key with your publishable API key.
Can’t find your API key? Open your project’s Settings → Project API Keys in the Encore Dashboard and copy the Live key
pk_live_… (or the Test key pk_test_… for non-production builds).Options: Logging and Unlock Mode
configure(apiKey:options:) accepts an Options value for runtime behavior:
logLevel— verbosity of SDK logs. Use.debugduring development; leave it.nonein production.unlock— when entitlements are granted after an offer flow:.optimistic(default) grants immediately when the user returns from the offer (a provisional grant, later verified by the backend)..strictwaits for advertiser postback verification before granting.
configure() reference → Unlock mode and EntitlementScope for the two-phase model.
Next Steps
Now that Encore is configured, you’re ready to:- User Management - Identify users for entitlement tracking
- Present Offers - Show promotional offers and handle purchase results