Skip to main content
Consent management allows users to control which conversations and contacts they interact with. This guide covers setting consent preferences, filtering conversations, and handling blocked users. LibXMTP tracks consent at three levels:
Consent can be tracked for different entity types:

For Conversations

Set consent for a specific group:
Or use the group helper:

For Inbox IDs

Block all conversations from a specific inbox:

For Addresses

Set consent by wallet address:

Batch Updates

Update multiple consent preferences at once:
Check consent for a specific entity:
Filter conversations by consent state:

Group Creation

When you create a group, consent defaults to Allowed:

Receiving Invites

When invited to a group, consent defaults to Unknown:

Filtering Streams

Consent preferences automatically filter message streams:

Stream Allowed Messages Only

Stream All Conversations

Include both allowed and unknown (new invites):
Sync only groups matching consent preferences:

Device Sync

Consent preferences sync across installations:
Consent preferences are synced between your installations via the device sync mechanism. Changes on one device will propagate to other devices.

TypeScript (Node.js) Examples

Handling Unwanted Conversations

Best Practices

DM consent works the same as groups:

Error Handling

Next Steps

Database Encryption

Secure your local data with encryption

Managing Groups

Learn more about group management