nostr is (mostly) client side, so you'd instantiate it always on the client side (you can't really instantiate something like NDK on the server and "pass" it to the end client)

It might make sense to have a look at the work nostr:npub18c556t7n8xa3df2q82rwxejfglw5przds7sqvefylzjh8tjne28qld0we7 is doing packaging NDK in a ready-made skeleton or have a look at production code in one of the multiple real-world reference implementations using NDK 😉

https://github.com/nostr-dev-kit/ndk/blob/master/REFERENCES.md

Reply to this note

Please Login to reply.

Discussion

correct link:

https://github.com/nostr-dev-kit/ndk/blob/master/ndk/REFERENCES.md

and thank you dear Pablo.

nostr:npub1manlnflyzyjhgh970t8mmngrdytcp3jrmaa66u846ggg7t20cgqqvyn9tn you can also take a look at Nostr-Hooks (yes, it's a React lib, but you may still get some inspiration about how it's dealing with NDK)

https://github.com/ostyjs/nostr-hooks

Thank you all for your guidance. I’ll have more questions as I progress fwd on this social onboarding client for Nostr. So far … just a “follow me” QR code that opens in an exiting local client. Soon to be also “invite” QR codes (of course using nostr-ignition 😍 nostr:npub1zuuajd7u3sx8xu92yav9jwxpr839cs0kc3q6t56vd5u9q033xmhsk6c2uc ) for onboarding your fiends to nostr.

nostrmeet.me

https://github.com/nostrmeetme/nostrmeetme