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

# Migrate legacy React Native SDK packages to v5

> Rename @dynamic-labs/* packages to their legacy-* equivalents when upgrading the legacy React Native SDK from v4 to v5.

The legacy React Native SDK packages have been renamed with a `legacy-` prefix in v5 to avoid conflicts with the new JavaScript SDK (`@dynamic-labs-sdk/*`). If you are upgrading from v4, update every Dynamic package name in your `package.json`, import statements, and lockfile.

<Info>
  Only the **package names** changed — the exported identifiers (`createClient`, `ReactNativeExtension`, `ViemExtension`, `useReactiveClient`, etc.) are unchanged.
</Info>

## What changed

| v4 package name                        | v5 package name                               |
| -------------------------------------- | --------------------------------------------- |
| `@dynamic-labs/client`                 | `@dynamic-labs/legacy-client`                 |
| `@dynamic-labs/react-hooks`            | `@dynamic-labs/legacy-react-hooks`            |
| `@dynamic-labs/react-native-extension` | `@dynamic-labs/legacy-react-native-extension` |
| `@dynamic-labs/viem-extension`         | `@dynamic-labs/legacy-viem-extension`         |
| `@dynamic-labs/solana-extension`       | `@dynamic-labs/legacy-solana-extension`       |
| `@dynamic-labs/sui-extension`          | `@dynamic-labs/legacy-sui-extension`          |
| `@dynamic-labs/zerodev-extension`      | `@dynamic-labs/legacy-zerodev-extension`      |

## Migration steps

<Steps>
  <Step title="Update package.json">
    Replace every `@dynamic-labs/*` package your app uses with the corresponding `legacy-*` name.

    ```json package.json theme={"system"}
    {
      "dependencies": {
        "@dynamic-labs/legacy-client": "^5.0.0",
        "@dynamic-labs/legacy-react-native-extension": "^5.0.0",
        "@dynamic-labs/legacy-react-hooks": "^5.0.0",
        "@dynamic-labs/legacy-viem-extension": "^5.0.0"
      }
    }
    ```

    Replace the example versions above with the latest v5 version you want to target.
  </Step>

  <Step title="Update imports">
    Keep the same import names; only the package path changes.

    ```typescript theme={"system"}
    // Before
    import { createClient } from '@dynamic-labs/client';
    import { ReactNativeExtension } from '@dynamic-labs/react-native-extension';
    import { ViemExtension } from '@dynamic-labs/viem-extension';
    import { useReactiveClient } from '@dynamic-labs/react-hooks';

    // After
    import { createClient } from '@dynamic-labs/legacy-client';
    import { ReactNativeExtension } from '@dynamic-labs/legacy-react-native-extension';
    import { ViemExtension } from '@dynamic-labs/legacy-viem-extension';
    import { useReactiveClient } from '@dynamic-labs/legacy-react-hooks';
    ```
  </Step>

  <Step title="Clean install and rebuild">
    Delete your lockfile and `node_modules`, reinstall, and rebuild the native layer.

    <Tabs>
      <Tab title="Expo">
        ```bash Shell theme={"system"}
        rm -rf node_modules package-lock.json
        npm install
        npx expo prebuild
        npx expo run:ios
        npx expo run:android
        ```
      </Tab>

      <Tab title="Bare React Native">
        ```bash Shell theme={"system"}
        rm -rf node_modules package-lock.json
        npm install
        cd ios && pod install && cd ..
        npx react-native run-ios
        npx react-native run-android
        ```
      </Tab>
    </Tabs>
  </Step>
</Steps>

## Related migration

* If you are also moving from `expo-secure-store` to `react-native-keychain`, see the [React Native secure-storage migration guide](/docs/overview/migrations/react-native-expo-secure-store-to-keychain).
