Skip to main content
Use the <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.
1

Install the package

2

Register the element at app entry

The import is side-effecting — it registers <stackone-hub> on customElements.
3

Type the element for JSX

Tell TypeScript that <stackone-hub> is a valid JSX tag:
4

Get a session token from your backend

5

Add the element and listen for events

React 19 passes unknown props through as attributes, but events still need to be wired with addEventListener via a ref — React doesn’t synthesize custom DOM events.

Attribute reference

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: React’s 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.