Skip to main content

Overview

As soon as your app launches, configure the SDK with your API Key. You’ll receive your public API key from the Encore team.
Wrap your app with EncoreProvider to automatically configure the SDK and register callbacks:
import { EncoreProvider } from '@tryencorekit/react-native';

export default function App() {
  return (
    <EncoreProvider apiKey="pk_your_api_key_here">
      <YourApp />
    </EncoreProvider>
  );
}
EncoreProvider calls configure() and registerCallbacks() automatically on mount.

Option B: Manual Configuration

If you need more control, configure manually:
import Encore from '@tryencorekit/react-native';

// At app startup
await Encore.configure('pk_your_api_key_here');
await Encore.registerCallbacks();
You must call registerCallbacks() after configure() to enable purchase and passthrough event handling.

Configuration Options

await Encore.configure('pk_your_api_key_here', {
  logLevel: 'debug', // 'none' | 'error' | 'warn' | 'info' | 'debug'
});
OptionTypeDefaultDescription
logLevelstring'none'Logging verbosity level
Use logLevel: 'debug' during development, then remove it for production builds.
If you don’t have access to your API key, please contact your Encore representative.

Next Steps

Now that Encore is configured, you’re ready to: