Skip to content

Text

With XMTP, text is represented as objects with the following keys:

Text object

The text type contains the following

{
  content: string, // The content of the message
}

Receive a text message

Here's an example of how you can receive a text message in your app:

const { content, typeId } = context.message;
 
if (typeId === "text") {
  const { content: text } = content;
  // Use text
}