Skip to content

Nostrify with NDK ​

Nostrify provides an adapter for NDK with @nostrify/ndk. This enables you to use NDK as a storage backend for Nostrify.

Installation ​

sh
npx jsr add @nostrify/ndk
sh
deno add @nostrify/ndk
sh
yarn dlx jsr add @nostrify/ndk
sh
pnpm dlx jsr add @nostrify/ndk
sh
bunx jsr add @nostrify/ndk

Usage ​

Set up NDK as normal, and then pass your NDK instance into NDKStore to make it available as a Nostrify relay.

ts
import NDK from '@nostr-dev-kit/ndk';
import { NDKStore } from '@nostrify/ndk';

const ndk = new NDK(/* set up NDK */);
await ndk.connect();

const relay = new NDKStore(ndk); // Now it works like a Nostrify relay!
Soapbox