> ## 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.

# Updating the SDK

> How to update the Encore React Native SDK to the latest version.

## Overview

The Encore React Native SDK is published as the public **`@encorekit/react-native`** package on [npm](https://www.npmjs.com/package/@encorekit/react-native). The package includes native bridges for both iOS and Android, so updating is a two-part flow: bump the npm package, then refresh the native iOS pods so the updated iOS SDK is picked up. Android is resolved automatically on the next build.

***

## Check the Current and Latest Version

Your installed version is recorded in `package.json` and locked in your lockfile (`package-lock.json` or `yarn.lock`). The latest published version is listed on the package's [npm page](https://www.npmjs.com/package/@encorekit/react-native).

You can also check from the command line:

```bash theme={null}
npm view @encorekit/react-native version
```

To see whether your project is behind:

```bash theme={null}
npm outdated @encorekit/react-native
```

***

## Update the Package

<Steps>
  <Step title="Update to the latest version">
    Install the latest release with your package manager:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @encorekit/react-native@latest
      ```

      ```bash yarn theme={null}
      yarn add @encorekit/react-native@latest
      ```
    </CodeGroup>
  </Step>

  <Step title="Refresh the native iOS pods">
    Run `pod install` with `--repo-update` so CocoaPods fetches the newest spec and installs the updated native iOS dependency:

    ```bash theme={null}
    cd ios && pod install --repo-update && cd ..
    ```

    <Note>
      Android requires no separate step — React Native auto-links the updated native module, and Gradle resolves it automatically on your next build.
    </Note>
  </Step>

  <Step title="Rebuild both platforms">
    Build fresh so the updated JavaScript and native layers are compiled in:

    <CodeGroup>
      ```bash iOS theme={null}
      npx react-native run-ios
      ```

      ```bash Android theme={null}
      npx react-native run-android
      ```
    </CodeGroup>
  </Step>
</Steps>

***

## Verify the Update

Confirm the installed version matches the latest release:

```bash theme={null}
npm outdated @encorekit/react-native
```

`@encorekit/react-native` should no longer appear as outdated.

***

## Updating to 1.1.42 or Later — Signal the Purchase Outcome

<Warning>
  **One-time migration check for subscription managers.** If you use a subscription manager (RevenueCat, react-native-iap, or your own billing), your `onPurchaseRequest` handler must call `Encore.completePurchaseRequest(success)` with a **boolean** in *every* code path — both success and failure. If you don't, the SDK stays locked and cannot present future offers until the app restarts. Integrations created on 1.1.42 or later already do this, so this check only applies when migrating an older integration.
</Warning>

Pass `true` when the purchase succeeds and `false` when it fails or is cancelled — always inside a `try/catch` so both paths are covered. For example, with RevenueCat:

```tsx theme={null}
const unsubscribe = Encore.onPurchaseRequest(async ({ productId }) => {
  try {
    const { customerInfo } = await Purchases.purchaseProduct(productId);
    await Encore.completePurchaseRequest(true);
  } catch (error) {
    await Encore.completePurchaseRequest(false);
  }
});
```

See [onPurchaseRequest()](../reference/on-purchase-request) and [completePurchaseRequest()](../reference/complete-purchase-request) for react-native-iap and custom examples.

***

If you encounter issues after updating, reach out to [admin@joinyaw.com](mailto:admin@joinyaw.com).
