Documentation Index
Fetch the complete documentation index at: https://mintlify.com/xmtp/libxmtp/llms.txt
Use this file to discover all available pages before exploring further.
Installation
LibXMTP is available for multiple platforms. Choose your platform to get started.
Node.js Installation
LibXMTP provides native Node.js bindings via NAPI-RS.Requirements
- Node.js 22 or later
- npm, yarn, or pnpm
Install via npm
npm install @xmtp/node-bindings
Install via yarn
yarn add @xmtp/node-bindings
Install via pnpm
pnpm add @xmtp/node-bindings
Import in your project
import { createClient } from '@xmtp/node-bindings'
The Node.js bindings include pre-built native modules for common platforms. No compilation required.
iOS Installation
The XMTP iOS SDK is distributed via Swift Package Manager.Requirements
- iOS 14.0+
- macOS 11.0+
- Xcode 13.0+
- Swift 6.1+
Swift Package Manager
Add LibXMTP to your Package.swift file:dependencies: [
.package(
url: "https://github.com/xmtp/libxmtp",
from: "1.9.0"
)
]
Then add it to your target dependencies:targets: [
.target(
name: "YourApp",
dependencies: [
.product(name: "XMTPiOS", package: "libxmtp")
]
)
]
Xcode Integration
Open your project in Xcode
Launch Xcode and open your project.
Add Package Dependency
- Select File → Add Package Dependencies
- Enter the repository URL:
https://github.com/xmtp/libxmtp
- Choose version 1.9.0 or later
Select Package Product
Select XMTPiOS from the package products list.
Binary Targets
The iOS SDK includes pre-built binary targets:
LibXMTPSwiftFFI - Static framework (default)
LibXMTPSwiftFFIDynamic - Dynamic framework (optional)
Binary frameworks are hosted on GitHub Releases and downloaded automatically by Swift Package Manager.
Android Installation
The XMTP Android SDK is distributed via Maven Central.Requirements
- Android SDK 23 (Marshmallow) or later
- Kotlin 1.8.0+
- Java 17
Gradle (Kotlin DSL)
Add to your build.gradle.kts:dependencies {
implementation("org.xmtp:android:1.9.0")
}
Gradle (Groovy)
Add to your build.gradle:dependencies {
implementation 'org.xmtp:android:1.9.0'
}
Check Latest Version
Find the latest version on Maven Central.Import in your code
import org.xmtp.android.library.Client
import org.xmtp.android.library.ClientOptions
Proguard
The library includes consumer ProGuard rules automatically. No additional configuration needed.The Android SDK includes native .so libraries for all ABIs:
- arm64-v8a
- armeabi-v7a
- x86_64
- x86
WebAssembly Installation
WASM bindings are not intended for direct use. Use the associated browser SDK instead.
Requirements
- Modern browser with WebAssembly support
- Build tools: emscripten, LLVM
Development Setup
If you’re contributing to WASM bindings:Install LLVM
Follow the instructions to add LLVM to your PATH. Install dependencies
cd bindings/wasm
yarn install
Browser SDK
For browser applications, use the higher-level browser SDK (coming soon) which wraps these WASM bindings.
Verify Installation
After installing, verify your setup:
import { createClient } from '@xmtp/node-bindings'
console.log('LibXMTP Node.js bindings installed successfully!')
Troubleshooting
Node.js Issues
Error: Cannot find module ‘@xmtp/node-bindings’
- Ensure you’re using Node.js 22 or later
- Try clearing node_modules and reinstalling:
rm -rf node_modules && npm install
Native module loading errors
- The package includes pre-built binaries for common platforms
- If your platform isn’t supported, you may need to build from source
iOS Issues
Binary framework download fails
- Check your internet connection
- Verify the GitHub release exists for your version
- Try clearing Swift Package Manager cache:
rm -rf ~/Library/Caches/org.swift.swiftpm
Build errors with “Cannot find ‘XMTPiOS’ in scope”
- Clean build folder: Product → Clean Build Folder
- Reset package caches: File → Packages → Reset Package Caches
Android Issues
Dependency resolution fails
- Check that Maven Central is in your repositories list
- Sync Gradle files: File → Sync Project with Gradle Files
Native library not found errors
- The SDK includes .so files for all ABIs
- Check that you haven’t excluded ABIs in your gradle configuration
Next Steps
Quickstart Guide
Build your first XMTP application
API Reference
Explore the complete API documentation