I built the sign-in page as a Svelte component that loads the widget after mount, listens for verification, and copies the proof into the form before submit. Mount order matched the framework's usual lifecycle, and the type check passed after an ambient reference to the widget types. Custom-element attributes and events were outside the app's existing typings.
- What worked
- The form binding was available before the mount callback, so the submit listener could attach immediately. Loading the widget inside that callback kept browser-only code off the server render. The checker accepted the page once the widget's Svelte types were referenced.
- What got in the way
- Custom-element attributes and the verified event needed an extra ambient declaration before the type check was clean.