/stackone-connect:stackone-connectfrom stackone-connect
Implement account linking using StackOne Connect Sessions and the StackOne Hub. 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).
Ships in stackone-connect. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Before writing code, fetch the latest documentation:
https://docs.stackone.com/embed/account-linking/overview.md for the current linking flow and the ways to embed the Hubhttps://docs.stackone.com/embed/account-linking/stackone-hub.md for the current <StackOneHub> props and themingThe Hub component changes between versions. Take props, peer dependencies and link expiry from the docs, not from this skill.
When fetching a docs.stackone.com page whose URL doesn't already end in .md, append .md to get it as markdown. llms.txt is already plain text, so fetch it as is.
If any URL in this skill returns 404, or a page doesn't cover what you need (StackOne reorganizes its docs from time to time):
https://docs.stackone.com/llms.txt, which indexes every docs page by title and description. Search the "Embed" section for the page's topic (e.g. "Connect Session", "Account Linking", "Auth Link", "Handle Account Events") and use the URL listed there.https://raw.githubusercontent.com/StackOneHQ/hub/main/README.md.| Method | When to use |
|---|---|
| Embedded Hub | In-app integration picker, users stay in your app. React apps use @stackone/hub; other frameworks use the <stackone-hub> web component |
| Auth Link | Email onboarding, sales-led onboarding or demos. A StackOne-hosted page with the Hub already embedded, no frontend work |
| Dashboard | Internal tools, or linking an account on a customer's behalf |
If unsure, recommend the Embedded Hub. It provides the best user experience.
The overview page compares the methods and links to each one's guide.
Your backend creates a session token that the frontend uses to initialize the Hub. Fetch https://docs.stackone.com/embed/connect-session.md for the required fields, filtering and connector profile targeting.
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"
}'
The response includes a token field. Pass this to the frontend.
Always set origin_owner_id on the server. Never take it from a client request, or one customer could claim another customer's linked accounts.
To control which providers appear in the Hub, pass provider (opens that connector directly) or categories (e.g. ["hris"]). The Connect Session page also covers account_id, multiple and connector_profile_id.
Fetch https://docs.stackone.com/platform/api-reference/connect-sessions/create-connect-session.md for the full request/response schema.
For React, fetch https://docs.stackone.com/embed/account-linking/stackone-hub.md and follow its quick start:
npm install @stackone/hub
import { StackOneHub } from "@stackone/hub";
import { useEffect, useState } from "react";
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")}
/>
);
}
For the full props list and theming options, use the Properties and Theming sections of that page.
For other frameworks, fetch https://docs.stackone.com/embed/account-linking/stackone-hub-web-component.md.
For an Auth Link instead of an embedded Hub, fetch https://docs.stackone.com/embed/account-linking/auth-link.md. It covers generating the link from the dashboard or from the Connect Session response, and setting its expiry.
Webhooks are required for Auth Links (no frontend callbacks) and recommended for the Embedded Hub.
Fetch https://docs.stackone.com/embed/handle-account-events.md for subscribing to the account events, verifying the signature and handling the payload, and https://docs.stackone.com/platform-api/platform-events.md for each event and its payload. For webhook management in general (retries, secret rotation), fetch https://docs.stackone.com/connect/webhooks.md.
After receiving onSuccess or the account.created webhook, fetch the account and check its status. Fetch https://docs.stackone.com/platform/api-reference/v2/accounts/get-an-account.md for the endpoint and the status values.
An active status confirms the connection is working.
User says: "I want to let my customers connect their BambooHR account"
Actions:
POST /connect_sessions with provider: "bamboohr"@stackone/hub and render <StackOneHub token={token} />onSuccess to store the account IDaccount.created as a backupResult: Working integration picker that opens straight to BambooHR.
User says: "I need to onboard customers by email, not in-app"
Actions:
origin_owner_id set to the customer, and the expiry the page describesResult: Customer clicks link, authenticates, webhook fires with account details.
Cause: Missing or mismatched peer dependencies.
@stackone/hub version with npm view @stackone/hub peerDependenciesCause: Tokens are short-lived.
Cause: Provider-side authentication succeeded but StackOne couldn't sync data.
status_reasons, or the account details in the dashboard, for the specific errorCause: Webhook endpoint configuration issue.
https://docs.stackone.com/embed/handle-account-events.md for the verification processWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub stackonehq/agent-plugins --plugin stackone-connect