Skip to main content
The Client is the primary interface for interacting with the XMTP network. This guide shows you how to create and configure clients using the ClientBuilder pattern.

Overview

Each client instance is bound to:
  • A single Inbox ID (user identity)
  • A single Installation ID (device/app instance)
  • A local SQLite database for storage
If you need to operate with a different Inbox ID or Installation ID, create a new client with a new database.

Basic Client Creation

ClientBuilder Configuration

The ClientBuilder supports extensive configuration:

Storage Configuration

See Database Encryption for encryption details.

Device Sync Configuration

Version Information

Offline Mode

Smart Contract Verifier

Client Properties

Identity States

A client’s identity can be in one of three states:
  1. Not Registered - Installation keys generated but not associated with an inbox
  2. Registered but Not Ready - Identity update created but not published to network
  3. Ready - Fully registered and operational
Operations like creating groups or sending messages will fail if the identity is not ready. Always call register_identity() before performing group operations.

Multi-Device Support

Multiple installations can share the same inbox:

Best Practices

Error Handling

Common errors when building clients:

Next Steps

Managing Groups

Create and manage group conversations

Database Encryption

Secure your local database with SQLCipher