This repo provides a package you can use to build with XMTP in a React Native or Expo app.
Is there a feature you need that's currently supported? Please open an issue.
Or better yet, open a PR and we'll get it reviewed and merged as soon as possible. If you contribute a PR that gets merged into this repo, you'll be eligible to claim this XMTP contributor POAP.
To learn how to use the XMTP React Native SDK and get answers to frequently asked questions, see the XMTP documentation.
Access the XMTP React Native SDK reference documentation.
Use the XMTP React Native example app as a tool to start building an app with XMTP. This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with. See example/README.md for more instructions.
Follow the React Native guide to set up a CLI environment.
yarn
cd example
yarn
yarn run [ios or android]
npx expo prebuild
-
Install and configure the expo package.
-
Add the required babel plugin.
yarn add @babel/plugin-proposal-export-namespace-from -D
-
Add the plugin to your
babel.config.js
.module.exports = { presets: ['module:@react-native/babel-preset'], plugins: [ '@babel/plugin-proposal-export-namespace-from', // ... other plugins ], };
yarn add @xmtp/react-native-sdk
-
In the
ios
directory, update yourPodfile
file to set this value:platform :ios, '16.0'
. This is required by XMTP. -
Run:
npx pod-install
If you get the error The SQLCipher Sqlite extension is not present, but an encryption key is given
, at the project configuration level in XCode, ensure that xmtpV3
is loaded before all other packages by setting Other Linker Flags
first item to -l"xmtpv3"
.
Your app must use Android minSdkVersion = 22
to work with the xmtp-react-native
SDK.
Because xmtp-react-native
is in active development, you should expect breaking revisions that might require you to adopt the latest SDK release to enable your app to continue working as expected.
XMTP communicates about breaking revisions in the XMTP Discord community, providing as much advance notice as possible. Additionally, breaking revisions in an xmtp-react-native
release are described on the Releases page.
Older versions of the SDK will eventually be deprecated, which means:
- The network will not support and eventually actively reject connections from clients using deprecated versions.
- Bugs will not be fixed in deprecated versions.
The following table provides the deprecation schedule.
Announced | Effective | Minimum Version | Rationale |
---|---|---|---|
No more support for V2 | March 1, 2025 | 3.0.0 | In a move towards better security with MLS and the ability to decentralize we will be shutting down V2 and moving entirely to V3 MLS. You can see the legacy branch here: https://github.com/xmtp/xmtp-react-native/tree/xmtp-legacy |
Issues and PRs are welcome in accordance with our contribution guidelines.