01 — Set up NDK and connect to relays

Getting started

Install NDK:

npm i @nostr-dev-kit/ndk

Then create an instance and connect. Key points:

  • Use explicit relays for reliability
  • Add a signer before publishing
  • Subscribe with filters

See the NDK docs.


Write a comment