Skip to main content
Configures the shared Encore instance for use throughout your app. This must be called once, typically at app startup, before using any other SDK methods.
Call configure() before using any other SDK methods.

Signature

configure(apiKey: string, options?: ConfigureOptions): Promise<{ success: boolean }>

Parameters

NameTypeDefaultDescription
apiKeystringYour Live Key or Test Key from the Encore Dashboard settings
optionsConfigureOptions{}Optional configuration

Options

OptionTypeDefaultDescription
logLevel'none' | 'error' | 'warn' | 'info' | 'debug''none'Logging verbosity level

API keys

Key TypeFormatDescription
Live Keypk_live_...Production key with standard geo-filtering based on offers’ configured regions
Test Keypk_test_...Testing key that bypasses geo-filtering for development
Use the test key (pk_test_...) during development to test offers from any location without geo-filtering restrictions.
Always use your live key (pk_live_...) in production builds.

Usage

import { EncoreProvider } from '@tryencorekit/react-native';

export default function App() {
  return (
    <EncoreProvider apiKey="pk_your_api_key">
      <YourApp />
    </EncoreProvider>
  );
}

Manual Configuration

import Encore from '@tryencorekit/react-native';

await Encore.configure('pk_your_api_key');
await Encore.registerCallbacks();

With Debug Logging

await Encore.configure('pk_your_api_key', {
  logLevel: __DEV__ ? 'debug' : 'none',
});
Use logLevel: 'debug' during development to see detailed SDK logs, then use 'none' for production builds.