@nostr-wot/dm
Private messages, inbox state and hooks
Installation
For a new integration, use the maintained imports below. Packages imported directly belong in your dependencies. Add React only for React entry points.
Topics
Send and read private messages
Use @nostr-wot/dm for NIP-17 message construction and verified unwrapping. Both participants need NIP-44-capable signers. The example prepares a recipient gift wrap and returns readable content when the recipient decrypts it.
Session lifecycle and error handling
Initialize providers and shared relay connections once per application session. Fetch public profiles without requesting a signature. Keep signing, decryption and payments behind explicit user actions; show pending, declined and failed states separately.
Inbox, history and encrypted storage
Discover inbox relays, backfill history, track reads and encrypt local storage.
React messaging hooks
Render conversations and threads with session-aware subscriptions.
Encrypted files and private state
Encrypt attachments and wrap application state addressed to yourself.