JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14
  • Score
    100M100P100Q50796F
  • License MIT

Web-of-Trust scoring + extension bridge for Nostr. WoT class, distance/scoring, browser extension integration, React + Solid hooks.

Package Exports

  • @nostr-wot/wot
  • @nostr-wot/wot/react
  • @nostr-wot/wot/solid

Readme

@nostr-wot/wot

Web-of-Trust scoring + browser-extension bridge for Nostr. Computes hop distance between npubs, derives trust scores, and integrates with the Nostr WoT browser extension for client-side WoT queries.

Install

npm i @nostr-wot/wot

React: import { ... } from '@nostr-wot/wot/react' (provides <WoTProvider> + <NostrSdkProvider> + hooks). Solid: import { ... } from '@nostr-wot/wot/solid'.

Use

import { WoT } from '@nostr-wot/wot';

const wot = new WoT({ /* options */ });
const result = await wot.getDistance('hex-pubkey');
// → { hops, paths, score } | null

React, with the unified provider:

import { NostrSdkProvider, useTrustScore } from '@nostr-wot/wot/react';

<NostrSdkProvider
  relays={['wss://relay.damus.io', 'wss://nos.lol']}
  wot={{ enabled: true, options: { extensionId: 'abc' } }}
>
  <App />
</NostrSdkProvider>

<NostrSdkProvider> is the recommended top-level provider for any app using the SDK. It configures the data layer (relays, profile aggregators, cache) and optionally enables WoT context. WoT hooks (useWoT, useTrustScore, useIsInWoT, useBatchWoT) require either wot.enabled: true here or a separate <WoTProvider>.

License

MIT