[!INFO] These bindings are not intended to be used directly, use the associated SDK instead.
The Rust source code follows a modular structure organized by domain:
src/
├── lib.rs # Library entry point, ErrorWrapper utility
├── client/ # Client struct and methods (split by concern)
├── conversations/ # Conversations methods (list, create, stream)
├── conversation/ # Conversation methods (split by concern)
├── content_types/ # Content type definitions (one file per type)
│ ├── mod.rs # ContentType enum and re-exports
│ ├── text.rs, reaction.rs, reply.rs, attachment.rs, ...
├── messages/ # Message types and utilities
│
└── [root-level files] # Shared types, enums, and utils used across modules
- Client methods:
src/client/- Find the file matching the concern (signatures, consent, etc.) - Creating clients:
src/client/create_client.rsandsrc/client/options.rs - Listing/creating conversations:
src/conversations/ - Single conversation operations:
src/conversation/ - Group-specific operations:
src/conversation/group/ - Dm-specific operations:
src/conversation/dm.rs - Content type definitions:
src/content_types/ - Message types:
src/messages/ - Shared types/enums: Root-level files in
src/
- New Client method: Add to existing file in
src/client/by concern, or create new file if new concern - New Conversations method: Add to
src/conversations/mod.rsor appropriate submodule - New Conversation method: Add to
src/conversation/mod.rsor appropriate submodule - New content type: Create
src/content_types/<type_name>.rsand add tomod.rs - New shared type/enum: Create root-level file in
src/
yarn: Installs all dependencies (required before building)yarn build: Build a release version of the Node bindings for the current platformyarn lint: Run cargo clippy and fmt checksyarn test: Run the test suite on Node
Before running the test suite, a local XMTP node must be running. This can be achieved by running ./dev/up at the root of this repository. Docker and Rust are required.