Skip to main content
Use the <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 scalar StackOneHub props map to kebab-case HTML attributes — see the vanilla guide for the full table.

Events

Native DOM CustomEvents 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.