Loading...
Loading...
Implement account linking using StackOne Connect Sessions and the Hub React component. Use when user asks to "connect a provider", "embed the integration picker", "add BambooHR to my app", "create a connect session", "set up auth links", or "handle account webhooks". Covers the full flow from session creation to webhook handling. Do NOT use for making API calls after linking (use stackone-platform) or building AI agents (use stackone-agents).
npx skill4agent add stackonehq/agent-plugins stackone-connecthttps://docs.stackone.com/guides/connect-tools-overviewhttps://www.npmjs.com/package/@stackone/hub| Method | When to use |
|---|---|
| Embedded Hub | In-app integration picker — users stay in your app |
| Auth Link | Email onboarding or external flows — standalone URL, valid 5 days |
| Dashboard | Internal testing only — never for production |
curl -X POST https://api.stackone.com/connect_sessions \
-H "Authorization: Basic $(echo -n 'YOUR_API_KEY:' | base64)" \
-H "Content-Type: application/json" \
-d '{
"origin_owner_id": "customer-123",
"origin_owner_name": "Acme Inc"
}'token{
"origin_owner_id": "customer-123",
"origin_owner_name": "Acme Inc",
"provider": "bamboohr",
"categories": ["hris"]
}https://docs.stackone.com/platform/api-reference/connect-sessions/create-connect-sessionnpm install @stackone/hubimport { StackOneHub } from "@stackone/hub";
function ConnectorPage() {
const [token, setToken] = useState<string>();
useEffect(() => {
fetchConnectSessionToken().then(setToken);
}, []);
if (!token) return <div>Loading...</div>;
return (
<StackOneHub
token={token}
onSuccess={(account) => {
// Store account.id — you'll need it for all subsequent API calls
console.log("Connected:", account.id, account.provider);
}}
onCancel={() => console.log("User cancelled")}
onClose={() => console.log("Hub closed")}
/>
);
}references/hub-reference.md| Event | When it fires |
|---|---|
| New account linked |
| Credentials refreshed |
| Account disconnected |
https://docs.stackone.com/guides/webhooksonSuccessaccount.createdcurl https://api.stackone.com/accounts/{account_id} \
-H "Authorization: Basic $(echo -n 'YOUR_API_KEY:' | base64)"200status: "active"POST /connect_sessionsprovider: "bamboohr"@stackone/hub<StackOneHub token={token} />onSuccessaccount.createdorigin_owner_id@stackone/hubreactreact-domreact-hook-form@hookform/resolverszodhttps://docs.stackone.com/guides/webhooks