Consent States
LibXMTP tracks consent at three levels:Consent Types
Consent can be tracked for different entity types:Setting Consent
For Conversations
Set consent for a specific group: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:Querying Consent
Get Consent State
Check consent for a specific entity:Query Groups by Consent
Filter conversations by consent state:Default Consent Behavior
Group Creation
When you create a group, consent defaults toAllowed:
Receiving Invites
When invited to a group, consent defaults toUnknown:
Filtering Streams
Consent preferences automatically filter message streams:Stream Allowed Messages Only
Stream All Conversations
Include both allowed and unknown (new invites):Sync with Consent Filtering
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
Consent and Direct Messages
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
