mirror of
https://github.com/PR0M3TH3AN/bitlogin.git
synced 2026-10-27 08:31:21 +00:00
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]>
7 lines
363 B
JavaScript
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"));
|