Skip to content

NDK Cookbook

Discover self-contained recipes for building with NDK

Recent Recipes โ€‹

Multi-Session Management with Account Switcher

Learn how to manage multiple Nostr accounts simultaneously in a Svelte 5 application. Includes session switching, profile management, and a complete UI for handling multiple logged-in users.

#svelte#authentication#multi-session#session-management
๐Ÿ“ฆ svelteโญโญโญ Advancedโฑ 20 min
๐Ÿ‘ 47๐Ÿ’ฌ 12๐Ÿ“– 1.2k

Complete Authentication Flow with NIP-07, nsec, and NIP-46

Implement a complete authentication system supporting browser extensions (NIP-07), private keys (nsec), and remote signers (NIP-46) with bunker:// and nostrconnect:// flows. Includes QR code generation and error handling.

#svelte#authentication#nip-07#nip-46#sessions
๐Ÿ“ฆ svelteโญโญ Intermediateโฑ 15 min
๐Ÿ‘ 234๐Ÿ’ฌ 23๐Ÿ“– 3.4k

Testing with Mock Relays

Create and use mock relays for testing NDK applications without connecting to real Nostr relays. Perfect for unit tests, integration tests, and development environments.

#ndk-core#testing#mock#relays
๐Ÿ“ฆ ndk-coreโญ Beginnerโฑ 8 min
๐Ÿ‘ 189๐Ÿ’ฌ 15๐Ÿ“– 2.8k

Connect to Nostr Wallet Connect (NWC)

Set up a connection to an NWC wallet and configure it for zapping. Learn how to handle wallet events, request permissions, and send Lightning payments through Nostr.

#ndk-wallet#nwc#zaps#payments#lightning
๐Ÿ“ฆ ndk-walletโญโญ Intermediateโฑ 12 min
๐Ÿ‘ 156๐Ÿ’ฌ 8๐Ÿ“– 1.9k

Using Cashu Wallet for E-Cash

Create and use a Cashu wallet for managing e-cash tokens. Includes minting, melting, sending, and receiving Cashu tokens with complete error handling and balance management.

#ndk-wallet#cashu#e-cash#nutzaps#nip-60
๐Ÿ“ฆ ndk-walletโญโญโญ Advancedโฑ 25 min
๐Ÿ‘ 98๐Ÿ’ฌ 19๐Ÿ“– 876

Publishing Your First Nostr Event

Learn the fundamentals of creating and publishing Nostr events with NDK. Covers event structure, signing, and publishing to relays with proper error handling.

#ndk-core#events#publishing#beginner
๐Ÿ“ฆ ndk-coreโญ Beginnerโฑ 5 min
๐Ÿ‘ 445๐Ÿ’ฌ 34๐Ÿ“– 8.2k

Browse by Category โ€‹

๐Ÿ” Authentication

8 recipes

๐Ÿ“ Events

12 recipes

๐ŸŒ Relays

6 recipes

๐Ÿ’ฐ Payments

10 recipes

๐Ÿงช Testing

8 recipes

๐Ÿ“ฑ Mobile

7 recipes