Call `window.nostr.getPublicKey()` to get the npub

Reply to this note

Please Login to reply.

Discussion

Wow, that's simple.

Is there a JavaScript SDK for other, more advanced functions?

I looked at NDK, but rust only for now.

nostr:npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft

You can look at the NIP-07 docs it has the list of functions: https://nips.be/7

I guess 'sign in' should really be backed by signing a message. Similar to WebLN.

getPublicKey() probably good enough for me as it's not a high security app.