This skill helps you integrate Outseta authentication, billing, and CRM features to accelerate SaaS development and streamline user management.
npx playbooks add skill outseta/agent-toolkit --skill outseta
Outseta is an all-in-one operating system for SaaS founders, combining CRM, authentication, billing, and customer support. It is designed to handle the "business logic" of a SaaS product so developers can focus on the "functional logic."
Outseta's CRM is structured to support team-based SaaS out of the box:
Uid.sub is the person Uid, and outseta:accountUid, outseta:planUid, outseta:isPrimary carry account/plan context. There are no PersonUid/AccountUid/planUid claims — for plan gating, read outseta:planUid./.well-known/jwks — that endpoint is fixed, so read the signing keys straight from it (no discovery round-trip is needed just to verify a token). Separately, when integrating Outseta as a sign-in (OIDC) provider, discover endpoints from /.well-known/openid-configuration (authorization_endpoint/token_endpoint/userinfo_endpoint/jwks_uri) rather than hardcoding them.data-o-* attributes.Use the official @outseta/react package instead of copying React templates from this toolkit.
npm install @outseta/react
Load Outseta's script in your app shell before rendering OutsetaProvider:
<script>
var o_options = {
domain: "your-company.outseta.com",
// Include the widget modules you render: auth, profile, support, emailList, leadCapture.
load: "auth,profile,support,emailList,leadCapture,nocode",
};
</script>
<script src="https://cdn.outseta.com/outseta.min.js" data-options="o_options"></script>
Use the package exports for auth state, widgets, gated routes, and add-on purchase flows:
import {
OutsetaProvider,
ProtectedRoute,
PurchaseAddonButton,
useOutseta,
} from "@outseta/react";
function Header() {
const { user, isLoading, openLogin, openSignup, openProfile, logout } = useOutseta();
if (isLoading) return null;
return user ? (
<>
<button onClick={() => openProfile({ tab: "profile" })}>Profile</button>
<button onClick={logout}>Logout</button>
</>
) : (
<>
<button onClick={() => openSignup()}>Sign up</button>
<button onClick={() => openLogin()}>Login</button>
</>
);
}
export function App() {
return (
<OutsetaProvider>
<Header />
<ProtectedRoute plans={["plan_uid"]}>
<PremiumFeature />
</ProtectedRoute>
<PurchaseAddonButton addonUid="addon_uid">Buy add-on</PurchaseAddonButton>
</OutsetaProvider>
);
}
@outseta/react exports:
OutsetaProvider and useOutseta for auth/user state.AuthEmbed, AuthButton, LoginButton, SignupButton, ProfileEmbed, ProfileButton, LogoutButton, ProtectedRoute, AuthCta, UpgradeCta, and PurchaseAddonButton.SupportEmbed, SupportButton, EmailListEmbed, EmailListButton, EmailListForm, LeadCaptureEmbed, and LeadCaptureButton.createClient plus generated vanilla-React data hooks for Outseta REST API access.The generated API hooks do not require an external data-fetching library or provider. They fetch on mount, expose refetch, and intentionally do not provide cross-component caching, request deduping, or background refetching. Create browser API clients with a user bearer accessToken, and pass the client through each hook's request option:
import { createClient, useAccountGetAllAccounts } from "@outseta/react";
const client = createClient({
subdomain: "your-company",
accessToken,
});
const { data, error, isLoading, refetch } = useAccountGetAllAccounts(undefined, {
request: client,
});
Never expose Outseta API key credentials in browser code.
o_options for your Outseta domain and include <script src="https://cdn.outseta.com/outseta.min.js" data-options="o_options"></script> in your app shell.data-o-auth="1") or the Outseta global object.Outseta.on('event', callback) to react to login, logout, or profile updates.data-o-* attributes (e.g., data-o-anonymous="1", data-o-authenticated="1"). In React apps, prefer @outseta/react state and components for more reliable SPA behavior.Use the official @outseta/node-sdk package instead of copying Node.js templates from this toolkit.
npm install @outseta/node-sdk
The package exports helpers for server-side API clients, JWT verification, webhook signature verification, Express webhook routes, generating user access tokens, and usage-based billing:
import {
createClient,
createOutsetaWebhookHandler,
generateAccessToken,
outsetaWebhookTextParserOptions,
trackUsage,
verifyJwt,
} from "@outseta/node-sdk";
import express from "express";
const adminClient = createClient({
subdomain: process.env.OUTSETA_SUBDOMAIN!,
apiKey: process.env.OUTSETA_API_KEY!,
apiSecret: process.env.OUTSETA_API_SECRET!,
});
const payload = await verifyJwt(userAccessToken, {
subdomain: process.env.OUTSETA_SUBDOMAIN!,
});
const generatedToken = await generateAccessToken(adminClient, "person@example.com");
await trackUsage(adminClient, {
accountUid: "account_uid",
addOnUid: "addon_uid",
amount: 1,
});
const app = express();
app.post(
"/outseta/webhook",
express.text(outsetaWebhookTextParserOptions),
createOutsetaWebhookHandler({
signingKey: process.env.OUTSETA_WEBHOOK_SIGNING_KEY!,
async onWebhook(payload) {
// Handle Activity Notification payload.
},
}),
);
Important backend notes:
{ subdomain, accessToken }.express.text(outsetaWebhookTextParserOptions) for the webhook route before createOutsetaWebhookHandler.@outseta/api-client and pass SDK clients via withClient(client) when needed.https://your-domain.outseta.com/api/v1/See [REST API](references/rest-api.md).
The Outseta MCP server (https://agent.outseta.com/mcp, OAuth login) grounds an integration in current documentation and lets you inspect or change live account data. It exposes three tools:
| Tool | Network | Use it for |
| --- | --- | --- |
| bash | none | Searching the knowledge base (/root/docs/kb) and REST API reference (/root/docs/api) |
| javascript_read | GET/HEAD on the account API | Reading people, accounts, subscriptions, plans, email lists; verifying a write |
| javascript_write | POST/PUT/PATCH on the account API | Creating and updating records. Requires a writeSummary. DELETE is never available. |
grep -ril "<term>" /root/docs/kb, then read the article. Cite the sourceArticleUrl from its frontmatter, not the workspace path./root/docs/api/README.md covers the Authorization: Outseta {key}:{secret} scheme, the items/metadata list envelope, offset as a zero-based page index, the limit cap (100, or 25 when child fields are requested), filtering operators, and the webhook activity list./root/docs/api/crm--person-getallpeople.md. The Client call: line gives the generated function and argument order for the JavaScript tools. /root/outseta.d.ts has the exact types; grep it rather than reading it whole.import { createClient, personGetAllPeople, personUpdatePerson } from "/root/outseta.js";
const client = createClient(); // uses the MCP session's auth
const { items, metadata } = (
await personGetAllPeople({ Email: "ada@example.com", fields: "Uid,Email,LastName" }, { client })
).data;
// javascript_write only, with a writeSummary such as "Set LastName to Hopper on person <Uid>":
await personUpdatePerson(items[0].Uid, { LastName: "Hopper" }, { client });
client("/api/v1/..."). { client } always goes in the last options argument.DELETE endpoint or the Outseta UI.These templates remain in this toolkit for non-React or low-code integrations:
login.html](templates/login.html)signup.html](templates/signup.html)profile.html](templates/profile.html)logout.html](templates/logout.html)leadcapture.html](templates/leadcapture.html)emaillist.html](templates/emaillist.html)support.html](templates/support.html)Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.