Changelog
Changes to nostr-bridge.js and the signer reach every page that loads them from the hosted signer, without a release on the page's side. Behaviour changes are listed first. Each npm release copies its entry into the GitHub release notes.
0.2.0: shared sign-in
The hosted signer moved to its own origin, https://signer.shardsigner.com (#60). It was https://saintego.github.io/nostr-shard-signer, which it shared with the portal, the examples and other sites. The bridge's default bunkerOrigin follows; load the bridge from https://signer.shardsigner.com/nostr-bridge.js. With your own clientId, add https://signer.shardsigner.com to the project's Web3Auth allowlist, or sign-in fails with WEB3AUTH_INIT_FAILED. Users' keys don't change (they depend on the clientId), but passkeys made for the old address don't carry over, and neither do Evolustr app keys set up there: the signer's Evolustr vault is now bound to a fixed name instead of the address (#154), and nothing is migrated from the old one (nobody used it there but tests). https://saintego.github.io/nostr-shard-signer/nostr-bridge.js, jsDelivr @main and the npm package already load the new bridge; a copy of an old bridge, or bunkerOrigin set to the old address, gets SIGNER_MOVED in the console.
"Use my own signer" (#72): a user who runs their own signer can choose it in the widget, under the sign-in panel; the bridge then frames it on that site instead of bunkerOrigin, without the site's clientId (see Users with a signer of their own).
Changed behaviour, for pages that pass no clientId:
NostrBridge.init()without aclientIdnow gets Google/Apple/X sign-in through the hosted signer's own Web3Auth project (shared sign-in). Before, it meant extension and bunker sign-in only. For such a page this means:- it offers a sign-in whose keys the signer's operator can obtain;
- its OAuth users get one npub shared with every other shared-mode site;
- its users count on the shared project's bill, which donations cover for now; it may be limited, become paid or be turned off.
- To keep Nostr-only sign-in, add
nostrOnly: true(ordata-nostr-only="true"on the script tag). Pages that loaded the hosted bridge for extension and bunker users only should do this before shared sign-in goes live. - The console says which sign-in a page got (
console.infofor shared sign-in). - A page that is itself inside another site's frame can't use the signer anymore (
NESTED_FRAME): that site could hide or cover the signer's prompts. - Shared sign-in starts in the widget (Web3Auth's panel) and continues in a small window on the signer's origin only for the account's screens;
NostrBridge.login()opens the sign-in sheet. The user's npub is derived from the login, not the login key itself, and each site keeps it on the device until the user signs out there.
Added:
nostrOnlyoption anddata-nostr-onlyattribute (npm types in 0.2.0).localeoption anddata-localeattribute: the widget's language, if the signer has it. The signer's text is bundled with it; pages can't change it.themeoption anddata-themeattribute (#168): the widget light or dark."auto"(default) follows the system setting,"light"and"dark"are the page's choice;NostrBridge.setTheme()changes it later, for a page with its own dark-mode toggle. Only the widget's colours change (the frame keepscolor-scheme: normal, so Chrome paints no backdrop behind it), and Web3Auth's panel follows. The signer's own windows (sign-in, prompts, its tab,/restore) follow the system setting. A page can't pass colours.signInUioption anddata-sign-in-uiattribute: Web3Auth's own panel in the widget ("panel", the default: every provider the project offers, wallets hidden, in Web3Auth's languages) or the signer's own Google, Apple, Facebook and X buttons in the sign-in window ("buttons", in the signer's languages and design).SIGNER_HELLOcarriesoauth: "own" | "shared" | "none".- Prompts can't be clicked through by the host page: approve buttons react after a short delay, and, in Chromium, only while nothing covers them. In shared sign-in, sensitive requests (decrypts, profile, follow-list and relay-list replacements, deletions, Evolustr app keys, key export) are confirmed in a popup on the signer's origin. Self-hosters can turn that on for every page (
POPUP_CONFIRM=always). - The operator can block a single site from shared sign-in, with a list signed by the registry root key (
scripts/publish-blocklist.mjs) or built into the signer. A blocked page gets theSHARED_BLOCKEDwarning and keeps extension and bunker sign-in. - The decrypt prompt warns when a site asks for data the user encrypted to themselves, which can be the key to another app's private data, and otherwise shows whose message it is.
SIGNER_ERRORcodeSHARED_SIGN_IN_PAUSED: the hosted signer paused new shared sign-ins because its shared project changed unexpectedly (#91). Signed-in users and extensions keep working.- Firefox: the signer sends the page
{ type: "SIGNER_PING", nonce }and starts only afternostr-bridge.jsanswersSIGNER_PONG(#67). Load the bridge from the signer's own origin; a copied or pinned old bridge getsNOT_EMBEDDEDthere. - Safari and every iPhone/iPad browser keep the widget's stored data only until the browser quits. Users sign in again and get the same identities; the widget tells them once, and its button then says "Sign in again" (the bridge passes
returning=1when the page remembers a sign-in through the signer). In these browsers only, the widget also tells the page which provider the user signed in with (Google, Apple, Facebook or X); the bridge keeps it in the page'slocalStorage(nostr-bridge:provider, cleared on log out) and the widget then offers "Continue with Google" with one tap, and "⋯" for the other ways. Your page can read that value, so a site can learn which provider a user signs in with in Safari and on iOS (#158). A site already in use signs in again from the relays' list copy, without waiting for Evolu. - The account's list (names, which sites each identity is used on) also has an encrypted copy on the relays, without keys, and backups keep signed copies of the account's Nostr events, which
/restorecan publish again. The copy stays on relays and in their archives: whoever gets the account's root later (a stolen backup or master key) can read the account's site history in it, and its size and update times show roughly how many identities and sites an account has (#158). - Self-hosting on Vercel with one click (
vercel.json), the signer only.
Changed for registrar API users: POST /register now takes two steps like /update (a nonce, then a signed event), and answers 503 while Web3Auth's settings can't be read (#68). The portal does both steps for you.