> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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.

> [!NOTE]
>
> Only the **package names** changed — the exported identifiers (`createClient`, `ReactNativeExtension`, `ViemExtension`, `useReactiveClient`, etc.) are unchanged.

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

**1. 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",
    "react-native-keychain": "^10.0.0"
  }
}
```

Replace the example versions above with the latest v5 version you want to target.

If you have `expo-secure-store` installed, remove it — the v5 SDK uses `react-native-keychain` for secure storage, so `expo-secure-store` is redundant.

**2. 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';
```

**3. Clean install and rebuild**

Delete your lockfile and `node_modules`, reinstall, and rebuild the native layer.

> [tab] Expo
>
> > [!NOTE]
> >
> > You must run `npx expo prebuild` so the new `react-native-keychain` native module is linked. Skipping this step causes a native-module error.
>
> ```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] 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
> ```

## Related migration

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.