Nostr WoT

nostr-wot-sdk

Profiles, notes, relay connections, signer clients, uploads and storage.

Installation

terminal
$npm install nostr-wot-sdk@3.0.0 nostr-tools

For a new integration, use the maintained imports below. Packages imported directly belong in your dependencies. Add React only for React entry points.

Topics

Provider setup

NostrSdkProvider composes data configuration, session state, and optional WoT context. Supply myPubkey explicitly for Oracle queries; signing in does not set the WoT query root automatically.

Data layer

Standalone fetchers retrieve profiles, notes, threads, follows, and engagement. React hooks add a cache with stale-while-revalidate behavior. Data fetchers share their own connection pool.

Relay management

RelayPool wraps a compatible PoolLike transport supplied by your app. Configure urls, use subscribe with onEvent/onEose, and close subscriptions when finished. A separately created relay wrapper is not automatically connected to the data provider.

Sign with an extension or remote account

Use nostr-wot-sdk/signers when your app needs an identity and signatures. Nip07Signer uses the installed extension; Nip46Signer connects to a remote signer. Keep one signer for the active session and pass it to other SDK tools.

Upload files with Blossom

Use nostr-wot-sdk/blossom to upload a user-selected file to an explicitly chosen server. The helper signs the upload authorization and returns the validated URL, hash and size. Use that URL in a separately signed profile or note.

Storage adapters

Implement KeyValueStore, separate namespaces and choose a durable backend.

Data cache and collections

Refresh cached profiles, invalidate state and work with event collections.

React data hooks

Read live data and share the active signer through React context.

Shared relay connections

Reuse sockets with RelayHub and manage subscription pressure.

Relay queries and health

Batch queries, inspect relay health and release subscriptions.

Encrypted uploads and blob management

Upload ciphertext, cancel work, mirror files and delete stored blobs.