Skip to main content

Composite Content Type

Status

If you want your app to be able to send multiple content types; such as any combination of plain text, images, audio, and video; in a single message, you must set up your app to use the CompositeCodec standard content type.

Import and register

Import the CompositeCodec content type from the xmtp-js client SDK to make it available in your app. For example:

import { CompositeCodec } from "@xmtp/xmtp-js";
// Create the XMTP client
const xmtp = await Client.create(signer, { env: "dev" });
// Register the codecs, AttachmentCodec is for handling local attachments under 1MB
xmtp.registerCodec(new CompositeCodec());

Was the information on this page helpful?
powered by XMTP