Skip to main content
This guide will walk you through the essential steps to integrate LibXMTP into your application and send your first encrypted message.

Prerequisites

Before you begin, make sure you have:
  • A supported development environment (Node.js 22+, iOS/macOS, Android, or modern browser)
  • An Ethereum wallet address for identity authentication
  • Basic familiarity with async/await patterns

Quick start steps

1

Install the library

Choose your platform and install LibXMTP using your package manager.
2

Create a client

Initialize an XMTP client with your wallet credentials.
The client manages your local database, identity state, and network connections. Each client is bound to a single Inbox ID and Installation ID.
On first run, the client will register your installation with the XMTP network. This requires a wallet signature to prove ownership.
3

Create or join a group

Start a new conversation or sync existing groups from the network.
4

Send and receive messages

Exchange end-to-end encrypted messages with group members.

Next steps

Now that you have LibXMTP running, explore more advanced features:

Managing groups

Add members, update metadata, and configure permissions

Content types

Send reactions, replies, attachments, and custom content

Permissions & policies

Configure who can add members, send messages, and update groups

Consent management

Block unwanted conversations and manage spam

Common patterns

Creating a direct message (DM)

Direct messages are 1:1 conversations with exactly two members:

Handling errors

Always wrap LibXMTP operations in try-catch blocks:

Syncing conversations

Regularly sync to stay updated with network changes:

Troubleshooting

The first time a client is created, you need to provide a wallet signature to register your installation. Make sure your wallet is properly initialized and can sign messages.See Creating Clients for detailed registration flows.
Messages may take a few seconds to propagate through the network. Use group.sync() to manually fetch new messages, or set up a message stream for real-time updates.
Make sure the dbPath directory exists and is writable by your application. On mobile platforms, use the app’s documents directory.
Users must have an active XMTP installation to be added to groups. They need to have created a client at least once. Check that addresses are valid XMTP users with client.canMessage([address]).

Complete example

Here’s a complete Node.js example that ties everything together:

Resources