<stackone-hub> custom element from @stackone/hub directly in JSX. This is the right choice if you can’t add another copy of React to your bundle, or if you want the same code path as your non-React surfaces.
If you’re starting fresh in React, the
<StackOneHub> component is usually a better fit — it integrates with your React tree and lets you pass callbacks as props. Reach for the web component when you need the framework-agnostic build.Register the element at app entry
The import is side-effecting — it registers
<stackone-hub> on customElements.Attribute reference
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 |
onSuccess={...} JSX shorthand does not fire on native DOM CustomEvents — React doesn’t synthesize custom DOM events. Subscribe with addEventListener via a ref instead.
Next steps
Backend setup
Generate session tokens from your backend.
React component path
Use
<StackOneHub> instead, with native React props.