<stackone-hub> custom element from @stackone/hub directly in Svelte markup. Svelte treats unknown tags as custom elements automatically — no extra config required.
Register the element at app entry
The import is side-effecting — it registers
<stackone-hub> on customElements.Attribute reference
Svelte passes attribute bindings through directly. All scalarStackOneHub props map to kebab-case HTML attributes — see the vanilla guide for the full table.
Events
Native DOMCustomEvents on the element:
| Event | event.detail |
|---|---|
success | { id: string; provider: string } |
close | undefined |
on:event shorthand does fire on native DOM CustomEvents, so <stackone-hub on:success={...} on:close={...}> works. We use addEventListener via bind:this here to keep the typing explicit.
Next steps
Backend setup
Generate session tokens from your backend.
Filter connectors
Restrict the Hub to a single provider or category.