> For the complete documentation index, see [llms.txt](https://docs.sentiance.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sentiance.com/getting-started/sdk-integration/3.-sdk-initialization/react-native/expo.md).

# Expo

If you are using Expo to build your app.

Initialization allows the SDK to perform detections in the background. You must always initialize the SDK before interacting with it. Only a limited set of SDK methods are safe to invoke on an uninitialized SDK.

## Steps

{% stepper %}
{% step %}

### Setup the Sentiance Core Expo config plugin

The Sentiance Core config plugin is responsible for initializing the SDK during app startup. Make sure it is configured in your `app.json` before proceeding.\
\
Refer to the [Core integration guide](/getting-started/sdk-integration/2.-including-the-sdk/react-native/expo.md#configure-the-sentiance-expo-config-plugin) if you haven't set it up yet.
{% endstep %}

{% step %}

### Ensure the SDK is initialized from JS/TS code

The Sentiance Core config plugin initializes the SDK asynchronously, so make sure to <mark style="color:$success;">`await ensureInitialized()`</mark> before your first SDK call to make sure the SDK is ready. It resolves once the SDK is initialized, and throws an <mark style="color:$primary;">`SdkInitializationError`</mark> if initialization failed or was never triggered.

```tsx
import SentianceCore, {
  SdkInitializationError,
} from "@sentiance-react-native/core";

try {
  // Resolves once native async init completes (immediately if already initialized).
  await SentianceCore.ensureInitialized();
  console.log("Sentiance SDK is initialized");

  // Safe to interact with the SDK from here on.
  const userExists = await SentianceCore.userExists();
  console.log("Sentiance user exists:", userExists);
} catch (err) {
  if (!(err instanceof SdkInitializationError)) {
    console.error("Unexpected error while awaiting Sentiance SDK init", err);
  } else {
    switch (err.reason) {
      case "NOT_TRIGGERED":
        // The native initializer was never called from Application.onCreate / AppDelegate.
        console.error("Sentiance SDK init was never triggered natively");
        break;
      case "EXCEPTION_OR_ERROR":
        console.error("Sentiance SDK init hit an exception or error:", err.message);
        break;
        
      // Handle the other cases here  
    }
  }
}
```

{% endstep %}

{% step %}

### Next: User Creation

After having successfully initialized the Sentiance SDK, you must now create a user. To do so, follow the instructions on [this page](/getting-started/sdk-integration/4.-user-creation.md).
{% endstep %}
{% endstepper %}
