<stackone-hub> custom element from @stackone/hub directly in Svelte markup. Svelte treats unknown tags as custom elements automatically — no extra config required.
1
Install the package
2
Register the element at app entry
The import is side-effecting — it registers
<stackone-hub> on customElements.3
Get a session token from your backend
4
Add the element and listen for events
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:
Svelte’s
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.