> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-v6-beta2-flutter-uikit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrading From V3

> Learn how to upgrade your React Native app from CometChat SDK v3 to v4, including dependency changes and updated import statements.

<Info>
  **Quick Reference**

  ```bash theme={null}
  # Install v4 Chat SDK
  npm i @cometchat/chat-sdk-react-native

  # Install v4 Calls SDK
  npm i @cometchat/calls-sdk-react-native
  ```

  ```javascript theme={null}
  // Updated imports
  import { CometChat } from '@cometchat/chat-sdk-react-native';
  import { CometChatCalls } from '@cometchat/calls-sdk-react-native';
  ```
</Info>

Upgrading from v3.x to v4 is fairly simple. Below are the major changes that are released as a part of CometChat v4:

Please follow the [setup](/sdk/react-native/setup-sdk) instructions to upgrade to the latest V4 version.

## Dependency Change

### Chat SDK

<Tabs>
  <Tab title="JavaScript">
    ```bash theme={null}
    npm i @cometchat/chat-sdk-react-native
    ```
  </Tab>
</Tabs>

### Calls SDK

<Tabs>
  <Tab title="JavaScript">
    ```bash theme={null}
    npm i @cometchat/calls-sdk-react-native
    ```
  </Tab>
</Tabs>

## Change The Import Statements

Change the import statements all around the project.

### Chat SDK

<Tabs>
  <Tab title="JavaScript">
    ```javascript theme={null}
    import {CometChat} from '@cometchat/chat-sdk-react-native'; 
    ```
  </Tab>
</Tabs>

### Calls SDK

<Tabs>
  <Tab title="JavaScript">
    ```javascript theme={null}
    import {CometChatCalls} from '@cometchat/calls-sdk-react-native';
    ```
  </Tab>
</Tabs>

<AccordionGroup>
  <Accordion title="Best Practices">
    * Update both the Chat SDK and Calls SDK together to avoid version incompatibilities
    * After updating dependencies, do a clean build (`npx react-native start --reset-cache`) to clear any cached modules
    * Search your entire project for old import paths (`@cometchat-pro/react-native-chat`) and replace them with the new v4 paths
    * Test all listeners and callbacks after upgrading — some callback signatures may have changed between v3 and v4
  </Accordion>

  <Accordion title="Troubleshooting">
    * **Module not found errors**: Ensure you've removed the old v3 packages (`@cometchat-pro/react-native-chat`) and installed the new v4 packages.
    * **Duplicate module errors**: Run `npm dedupe` or delete `node_modules` and reinstall to resolve conflicting versions.
    * **iOS build fails after upgrade**: Run `pod install --repo-update` in the `ios/` directory to update native dependencies.
    * **Android build fails**: Clean the build with `./gradlew clean` in the `android/` directory and rebuild.
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Setup SDK" icon="gear" href="/sdk/react-native/setup-sdk">
    Complete the v4 SDK setup
  </Card>

  <Card title="Authentication" icon="lock" href="/sdk/react-native/authentication-overview">
    Set up user authentication with v4
  </Card>
</CardGroup>
