This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@nostrgg/client
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@nostrgg/client

Nostr client written in TypeScript

Installation

npm install @nostrgg/client

Example usage:

import {
  initNostr,
  SendMsgType,
  Kind,
} from "@nostrgg/client"

initNostr({
  relayUrls: [
    "wss://nostr-pub.wellorder.net",
    "wss://nostr-relay.untethr.me",
  ],
  onConnect: (relayUrl, sendEvent) => {
    console.log("Nostr connected to:", relayUrl)

    // Send a REQ event to start listening to events from that relayer:
    sendEvent([SendMsgType.REQ, {
      filter: {
        kinds: [Kind.TextNote],
        since: 0, // All events since the dawn of time
      },
    }], relayUrl)
  },
  onEvent: (relayUrl, event) => {
    console.log("Nostr received event:", event)
  },
  debug: true, // Enable logs
});

/@nostrgg/client/

    Package Sidebar

    Install

    npm i @nostrgg/client

    Weekly Downloads

    0

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    102 kB

    Total Files

    21

    Last publish

    Collaborators

    • t4t5