Skip to content
This repository was archived by the owner on Feb 27, 2025. It is now read-only.

xmtp/xmtp-react-native-quickstart

Repository files navigation

Status

Caution

This repo is no longer maintained.

The documentation below is provided for historical reference only.


XMTP Quickstart React Native

xmtp

Prerequisites

  • Node.js
  • npm or Yarn
  • React Native CLI
  • Xcode (for iOS)

1. Initialize React Native Project

If you haven't already created a React Native project, start by initializing one:

npx react-native init your-project-name

2. Install Expo Modules

Install the latest Expo modules:

npx install-expo-modules@latest

3. Install XMTP React Native SDKs

Install the XMTP React Native SDK using npm:

npm install @xmtp/react-native-sdk

4. Update Podfile for iOS

Update the Podfile to set the minimum iOS platform. Open the Podfile in your iOS directory and modify the platform line:

platform :ios, '16.0'

5. Update Xcode Target

Ensure your Xcode project's target is updated to iOS 16.0 or higher.

6. Add Babel Plugin

Install the Babel plugin required for the XMTP SDK:

npm add @babel/plugin-proposal-export-namespace-from

7. Configure Babel

Update your Babel configuration. Open your babel.config.js and add the plugin:

module.exports = {
  presets: ['module:@react-native/babel-preset'],
  plugins: ['@babel/plugin-proposal-export-namespace-from'],
};

8. Install iOS Pods

Navigate to the iOS directory and install the necessary pods:

cd ios && pod install && cd ..

9. Start the Application

Finally, start your React Native application:

npm run ios

Concepts

Head to our docs to understand XMTP's concepts

Troubleshooting

If you get into issues with Buffer and polyfills check out the fix below: