Skip to content

Releases: xmtp/xmtp-js

@xmtp/[email protected]

06 Jan 23:15
3e99355

Choose a tag to compare

This release introduces breaking changes and new features to replace previous functionality. If you've been building on a previous release, this one will require an update to your existing code.

BREAKING CHANGES

  • Updated ContentTypeId export
  • Updated EncodedContent export
  • Updated ContentCodec export
  • Removed CodecMap and CodecRegistry exports

New features

  • Added contentTypesAreEqual to replace ContentTypeId.sameAs
  • Added contentTypeToString to replace ContentTypeId.toString
  • Added contentTypeFromString to replace ContentTypeId.fromString

@xmtp/[email protected]

05 Jan 19:57
8b5d56c

Choose a tag to compare

Patch Changes

  • 1f7e6ed: Exposed command list in CommandRouter middleware

@xmtp/[email protected]

18 Dec 18:42
27a5b3c

Choose a tag to compare

Patch Changes

  • d655457: Added support for encrypted file attachments

@xmtp/[email protected]

17 Dec 15:21
877e984

Choose a tag to compare

This release introduces new features. If you've been building on a previous release, this one should be a drop-in replacement. Update as soon as possible to take advantage of these enhancements.

Self-removal from group chats

This feature enables a member to leave a group chat on their own. Previously, a member could be removed only by other members with appropriate permissions. This update addresses user privacy concerns and reduces the need for manual member removal by admins.

To see if a user has requested removal, check the new isPendingRemoval property.

// request removal from group
await group.requestRemoval();

console.log(group.isPendingRemoval); // true

To learn more, see Leave a group and XIP-75: Self-removal support for XMTP/MLS groups.

New appData metadata for groups

Groups now support an appData metadata field for storing custom application-specific data. This field enables developers to attach arbitrary data to groups, such as configuration settings.

The appData field can store up to 8,192 bytes of string data.

// access app data
const appData = group.appData;

// update app data with custom JSON
await group.updateAppData(
  JSON.stringify({
    muted: false,
    pinned: true,
  }),
);

// retrieve and parse the updated data
const appData = JSON.parse(group.appData);
console.log(appData.pinned); // true

@xmtp/[email protected]

17 Dec 03:16
78a20c7

Choose a tag to compare

Patch Changes

  • cf4337e: Added error handling for fetching remote attachments

@xmtp/[email protected]

17 Dec 15:21
877e984

Choose a tag to compare

This release introduces new features. If you've been building on a previous release, this one should be a drop-in replacement. Update as soon as possible to take advantage of these enhancements.

Self-removal from group chats

This feature enables a member to leave a group chat on their own. Previously, a member could be removed only by other members with appropriate permissions. This update addresses user privacy concerns and reduces the need for manual member removal by admins.

To see if a user has requested removal, check the new isPendingRemoval property.

// request removal from group
await group.requestRemoval();

console.log(group.isPendingRemoval); // true

To learn more, see Leave a group and XIP-75: Self-removal support for XMTP/MLS groups.

New appData metadata for groups

Groups now support an appData metadata field for storing custom application-specific data. This field enables developers to attach arbitrary data to groups, such as configuration settings.

The appData field can store up to 8,192 bytes of string data.

// access app data
const appData = group.appData;

// update app data with custom JSON
await group.updateAppData(
  JSON.stringify({
    muted: false,
    pinned: true,
  }),
);

// retrieve and parse the updated data
const appData = JSON.parse(group.appData);
console.log(appData.pinned); // true

@xmtp/[email protected]

17 Dec 15:42
8f3b587

Choose a tag to compare

Upgraded Node SDK to 4.6.0

@xmtp/[email protected]

11 Dec 18:11
6fd53b3

Choose a tag to compare

Patch Changes

  • 1f737c5: Fixed LibXMTP version reporting

@xmtp/[email protected]

09 Dec 17:43
505dca5

Choose a tag to compare

Patch Changes

  • fe6a04f: Added GroupSyncSummary export

@xmtp/[email protected]

09 Dec 17:43
505dca5

Choose a tag to compare

This release introduces new features, performance optimizations, and bug fixes. If you've been building on a previous release, this one should be a drop-in replacement. Update as soon as possible to take advantage of these enhancements and fixes.

Stream message deletions

Call streamMessageDeletions to return a stream of message IDs that have been deleted. This new stream works in tandem with disappearing messages so that developers can be notified when messages have been removed. This is a local stream that doesn't require network sync and will not fail like other streams.

To learn more, see Support disappearing messages.

Paginate the conversation list

For most pagination use cases, use the createdBeforeNs parameter for filtering and set orderBy to createdAt. This enables you to paginate against a stably sorted list. You can then perform a final sort of conversations in your app.

To learn more, see Paginate the conversation list.

Total ordered sort for message pagination

Provides the ability to filter queries for the message list by insertion time rather than by time sent. Filtering by insertion time provides a totally ordered list, which is more reliable for pagination.

To learn more, see Paginate messages by insertion time.

More details on sync

The return value of conversations.syncAllConversations is now an object that includes both the number of conversations, and the number that needed to be synced.

Use countMessages to build an unread messages badge

Call countMessages to return a count of messages without retrieving the full message list. This is more efficient when you only need the number, such as for unread message badges.

To learn more, see Count messages in a conversation.

New version properties on the client

  • libxmtpVersion: Returns the version of libxmtp used in the bindings
  • appVersion: Returns the app version configured for the client

The libxmtpVersion property can be useful for debugging or ensuring compatibility with the underlying XMTP APIs.

Note: The static Client.version property is now deprecated, use libxmtpVersion instead.

syncAll performance improvements

The syncAll method now performs the same function as before, but with significantly improved performance. It achieves this by syncing only group chat and DM conversations with a consent state of allowed or unknown that contain unread messages, rather than syncing all conversations.

The method continues to sync new welcomes and preference updates.

To learn more, see Sync new welcomes, conversations with unread messages, and preferences.

Streaming now includes catch-up messages

Streaming messages now includes all messages sent after the last sync, including those missed while the client was offline. To only stream new messages, be sure to sync with the network before starting the stream.

To learn more, see Stream new group chat and DM messages.

Welcome pointers

OpenMLS supports sending welcomes to multiple installations in a single commit. This is currently used, but each welcome is sent individually to each installation. Some of the welcomes can be very large, and the data is duplicated for every installation.

Welcome pointers introduce a new welcome message that provides a pointer to the location where the welcome data can be found. The large welcome pointer data can be sent to the server only once, and each installation can fetch that message. This is achieved using symmetric key encryption for the welcome data, with each installation receiving a message that includes these keys.

This provides a performance and scalability improvement that makes both developer implementations and user experiences smoother and faster, without requiring changes to how developers write client code.

To learn more, see XIP-74: Welcome pointers.

revokeAllOtherInstallations no longer crashes with a single installation

Calling revokeAllOtherInstallations() on an inbox with only one active installation no longer crashes with an "Unknown signer" error.

Because the method’s purpose is to keep only the current installation active, having just one installation already meets this condition. The operation now completes successfully without trying to revoke non-existent installations.

To learn more, see Revoke all other installations.

Total ordered sort for message pagination

Provides the ability to filter queries for the message list by insertion time rather than by time sent. Filtering by insertion time provides a totally ordered list, which is more reliable for pagination.

To learn more, see Paginate messages by insertion time.

More details on sync

The return value of conversations.syncAllConversations is now an object that includes both the number of conversations, and the number that needed to be synced.

Updates for disappearing messages

The disappearing messages feature has been updated to exclude expired (already disappeared) messages from queries.

To learn more, see Support disappearing messages.