> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encorekit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# configure()

> Initialize the Encore SDK with your public API key

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.

<Warning>
  Call `configure()` before using any other SDK methods.
</Warning>

## Signature

```tsx theme={null}
configure(apiKey: string, options?: ConfigureOptions): Promise<{ success: boolean }>
```

## Parameters

| Name      | Type                         | Default | Description                                                  |
| --------- | ---------------------------- | ------- | ------------------------------------------------------------ |
| `apiKey`  | string                       | —       | Your Live Key or Test Key from the Encore Dashboard settings |
| `options` | [ConfigureOptions](#options) | `{}`    | Optional configuration                                       |

### Options

| Option     | Type                                               | Default  | Description             |
| ---------- | -------------------------------------------------- | -------- | ----------------------- |
| `logLevel` | `'none' \| 'error' \| 'warn' \| 'info' \| 'debug'` | `'none'` | Logging verbosity level |

### API keys

| Key Type     | Format        | Description                                                                    |
| ------------ | ------------- | ------------------------------------------------------------------------------ |
| **Live Key** | `pk_live_...` | Production key with standard geo-filtering based on offers' configured regions |
| **Test Key** | `pk_test_...` | Testing key that bypasses geo-filtering for development                        |

<Info>
  Use the test key (`pk_test_...`) during development to test offers from any location without geo-filtering restrictions.
</Info>

<Warning>
  Always use your live key (`pk_live_...`) in production builds.
</Warning>

## Usage

### EncoreProvider (Recommended)

```tsx theme={null}
import { EncoreProvider } from '@tryencorekit/react-native';

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

### Manual Configuration

```tsx theme={null}
import Encore from '@tryencorekit/react-native';

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

### With Debug Logging

```tsx theme={null}
await Encore.configure('pk_your_api_key', {
  logLevel: __DEV__ ? 'debug' : 'none',
});
```

<Tip>
  Use `logLevel: 'debug'` during development to see detailed SDK logs, then use `'none'` for production builds.
</Tip>
