Skip to content

Errors and fixes ​

5. Errors and fixes ​

Signer errors are also logged with console.error in the host page as nostr-bridge: signer error CODE: message, followed by a hint. Non-fatal problems are logged with console.warn as nostr-bridge: signer warning CODE: message.

In the errors below that turn off Google/Apple/X sign-in, an extension or bunker still works through the Sign in button.

Code / messageCauseFix
CLIENT_ID_NOT_FOUNDWeb3Auth has no Sapphire Mainnet project with this clientIdCopy the right client ID, or leave clientId out for shared sign-in
DOMAIN_NOT_REGISTEREDThe origin is neither in the NIP-33 registry nor in the Web3Auth allowlistRegister the exact origin (scheme + host + port) in the portal, or add it to the Web3Auth Allowlist URLs. The registry lookup is cached per browser tab, so test in a new tab
NESTED_FRAMEThe page using the signer is itself inside another site's frame; that site could hide or cover the signer's promptsOpen the app in its own tab (top-level window)
NO_SIGN_IN_METHODNo Google/Apple/X for the page (nostrOnly, or a signer without shared sign-in), and window.nostr.js failed to load or forceIframe skipped itCheck that cdn.jsdelivr.net is reachable, or pass a clientId
NOT_IN_REGISTRY (warning)The origin is allowlisted in Web3Auth but not registered in the portalRegister it in the portal so sign-in keeps working when the allowlist can't be read
SHARED_BLOCKED (warning)The hosted signer's operator blocked this site from shared sign-in; extension and bunker sign-in still workPass your own Web3Auth clientId for Google/Apple/X
NOT_ALLOWLISTED (warning)The origin is registered in the portal but not in the Web3Auth allowlistAdd it to the Web3Auth Allowlist URLs
WEB3AUTH_INIT_FAILEDWrong clientId, or the signer origin is not allowlistedCheck the clientId; add https://signer.shardsigner.com to the Web3Auth Allowlist URLs
MISSING_ROOT_PUBKEYThe signer was built without a registry root key, and the origin isn't in the Web3Auth allowlistOmit bunkerOrigin to use the hosted signer; if self-hosting, build it with VITE_ROOT_PUBKEY_HEX
NOT_EMBEDDEDsigner.html was opened directly, or (Firefox) the page that embeds it didn't confirm it: a copied or pinned nostr-bridge.js from before that checkOnly load it through nostr-bridge.js, from <bunkerOrigin>/nostr-bridge.js or the npm package's loadNostrBridge()
PROTOCOL_UNSUPPORTEDnostr-bridge.js and the signer at bunkerOrigin are different versions (e.g. a copied or CDN-pinned bridge with a newer or self-hosted signer)Load nostr-bridge.js from <bunkerOrigin>/nostr-bridge.js, or use the npm package's loadNostrBridge(), which does that
LOGIN_FAILEDThe OAuth login failed (not cancelled)Usually transient; the user can retry
KEY_EXPORT_OFFThe page's own Web3Auth project has key export turned off, so it can't give Nostr keysTurn key export on in the Web3Auth dashboard, or leave clientId out for shared sign-in
SHARED_SIGN_IN_PAUSEDShared sign-in only: the hosted signer's shared Web3Auth project changed unexpectedly (a site added to its allowlist, or key export off), so the signer starts no new shared sign-in. Users already signed in keep workingNothing to fix on the page; the operator is alerted. Pass your own clientId to avoid depending on the shared project
"nostr-bridge: no clientId, so Google/Apple/X sign-in goes through the signer's shared project…" (info)init() without clientIdExpected: shared sign-in. Pass a clientId for keys of your own project, or nostrOnly: true to turn it off
"nostr-bridge: no clientId, so Google/Apple/X sign-in is off…" (warning)init() without clientId, with a self-hosted signer that has no shared sign-inPass a clientId to add Google/Apple/X, or nostrOnly: true if that's intended
"nostr-bridge: bunkerOrigin must be an absolute URL…"Bad bunkerOriginOmit it, or pass a full https URL
"nostr-bridge: user is not logged in…"Call made before sign-inWait for onAuthChange with loggedIn: true, or call NostrBridge.login() from a button
"nostr-bridge: RPC timeout…"No answer from the signer within 30 sThe signer iframe is stuck or was removed; reload
"User rejected"The user clicked Reject on the confirmationDon't retry automatically
"Refused: the event is for another identity"signEvent with a pubkey that isn't the active identity (the user switched identities on this site)Leave pubkey empty, or use the one from onAuthChange
"Refused: the event is dated in the future"created_at more than 5 minutes aheadUse the current time
"Refused: the signer never deletes its own records or vaults for a site"A kind-5 deletion aimed at an Evolustr vault or at another key's addressDon't delete those
"nostr-bridge: already initialized …" (warning)init() called again with a different clientIdThe first config stays in effect; reload the page to switch

6. Don'ts ​

  • Don't import or bundle nostr-bridge.js itself. Load it with the script tag above, or with loadNostrBridge() from the nostr-shard-signer npm package, which loads that same script.
  • Don't assign window.nostr yourself after init(). The bridge keeps its own object there.
  • Don't ask the user for their nsec or build a key-import UI. Users who have a key use an extension or a bunker through the widget.
  • Don't expect npub values. Pubkeys are hex. Use nostr-tools nip19.npubEncode for display.
  • Don't expect the bridge to publish events or talk to relays for the app.
  • Don't hide or cover the widget container #nostr-signer-container. The sign-in modal and signing confirmations open in it, also after NostrBridge.login().

MIT licensed. The signer runs at signer.shardsigner.com; this site never holds keys.