nostr-client / login

A no-build nostr login web component. Supports NIP-07 browser extensions, pasted keys, and guest keys — and exports nip98Fetch for NIP-98 HTTP auth. Inspired by xlogin.

1 · The component

<script type="module" src="https://nostr-client.github.io/login/login.js"></script>
<nostr-login></nostr-login>

2 · Session state

After login every component on the page can use window.nostrSigner / window.nostrPubkey, or listen for nostr:login / nostr:logout on window:

logged out

3 · NIP-98 authenticated fetch

Builds a signed kind 27235 event and sends it as an Authorization: Nostr … header: