Skip to main content

XMTP JavaScript SDK

The XMTP JavaScript SDK is a TypeScript implementation of an XMTP client for use with JavaScript and React apps.

Explore the XMTP JavaScript SDK on GitHub.

For XMTP JavaScript SDK TypeDocs, see https://xmtp-js.pages.dev/.

Overview of functions

FunctionDescription
Wallet-based authenticationConnect to a user's wallet to get the wallet address, sign keys used for message signing and encryption, and authenticate incoming messages.
Wallet connection managementManage changes in wallet addresses or chain IDs. Manage connection issues.
Key pair generationCreate keys used for message signing and encryption and advertising public keys to the network.
Key storageStore keys securely.
Key signingSign keys with a connected wallet.
Relationship initiationCreate a secure messaging relationship between two wallets.
Conversation initiationCreate a container of messages between two wallets.
Message sendingCapture plaintext and submit it to the network.
Message history retrievalRetrieve the history of messages between two wallets, filterable by date range.
Message streamingReceive new messages in real-time.
Message content validationEnsure message security using this middleware.
Message format validationEnsure messages are properly formatted for the XMTP network using this middleware.

Example apps

  • Explore the example-chat-react repo on GitHub. This example React app demonstrates the core capabilities of the XMTP JavaScript SDK. You can customize and deploy the app if you want to.
  • XMTP Labs hosts deployments of the example-chat-react app to provide people with a way to try out a basic app built with XMTP.

Support

Have questions? Get help from the XMTP Discord community.