Skip to content

Install the XMTP SDK

Install the SDK for your platform. All SDKs use a backend URL. See Create a client for client options and Run the backend if you operate the backend.

Choose your package manager. These commands install the Browser package. Replace @xmtp/browser-sdk with @xmtp/node-sdk for a Node application.

Terminal window
npm install @xmtp/browser-sdk

Use the package for your platform:

PlatformPackage or dependency
Browser@xmtp/browser-sdk
Node@xmtp/node-sdk
Kotlinorg.xmtp:android
SwiftSwift package product XMTPiOS

The Browser and Node package commands above are the JavaScript package examples. For Android, add the XMTP Maven artifact to your app module:

dependencies {
implementation("org.xmtp:android:<version>")
}

Replace <version> with the version you built or a released version that supports ClientOptions.Api.backendUrl. Do not assume that an older hosted-network SDK can connect to this backend.

For Swift, the package manifest is at the root of libxmtp. Add the XMTPiOS product to your app. When using the self-hosted source branch, build its matching native bindings before adding the local package in Xcode:

Terminal window
git clone --branch self-hosted https://github.com/xmtp/libxmtp.git
cd libxmtp
just ios build

These repository commands require the Nix development environment. In a Swift package next to that checkout, add these dependency and target entries:

// In Package.dependencies:
.package(path: "../libxmtp")
// In your app target's dependencies:
.product(name: "XMTPiOS", package: "libxmtp")

Use a matching published SDK and native binary after the self-hosted release is available. A remote branch dependency alone does not build the native bindings.

Use Node.js 22 or later for package tooling and a bundler that supports WebAssembly. The Browser SDK stores its database in browser storage and does not encrypt it. dbEncryptionKey is ignored by the Browser SDK.