Files
bitlogin/packages/demo/public/assets/account.js
T
Cursor AgentandthePR0M3TH3AN f5b2f78da1 Add pubkey identity alias and colon-style DOM event aliases
Host identity surfaces now always expose pubkey (lowercase hex), with
publicKey kept as a deprecated alias of the same value. Every existing
hyphenated widget event also fires a bubbling, composed bitlogin:<verb>
equivalent immediately after, without changing old dispatch so a listener
on the hyphen name cannot fire twice.

Co-authored-by: thePR0M3TH3AN <[email protected]>
2026-10-08 19:14:25 +00:00

7 lines
363 B
JavaScript

const element = document.getElementById("bitlogin-widget");
element?.addEventListener("bitlogin:login", (event) => {
const detail = event instanceof CustomEvent ? event.detail : undefined;
console.info("[bitlogin] signed in", detail?.pubkey ?? detail?.publicKey);
});
element?.addEventListener("bitlogin:logout", () => console.info("[bitlogin] signed out"));