Start here
@clearedby/react: components and props, hooks, the theme schema and importers, class slots, labels, the partner proxy and recipes.
Reference
API reference
Every ClearedBy and ClearedByPartner method, verifyDispatch and receipts, every endpoint and every error code.
Must read
Security
The executor checklist, credential handling and the threat model in plain terms. Read it before go-live.
For AI agents
llms-full.txt
The whole integration as one self-contained Markdown spec. Also: /llms.txt and a .md version of every reference page.
Build it with your AI coding agent
Paste this into Claude Code, Cursor, Codex or similar, in your app's repository, and fill in your stack. The spec it points to covers every step, signature, endpoint, error code and security rule, so the agent can implement the whole integration from it alone.
Implement ClearedBy in this codebase using https://clearedby.com/docs/partners/llms-full.txt.
Read the whole spec before writing code, and follow every MUST rule in its Security section.
Our stack: [framework, e.g. Next.js App Router], [auth/session, e.g. NextAuth],
[database, e.g. Postgres with Prisma], [job queue, e.g. BullMQ], [secret store].
Build, in this order: partner settings; merchant onboarding in our signup flow; the executor
route; the embedded review UI (partner proxy + @clearedby/react, themed to our design system);
and replace our agent's direct store writes with gate() proposals.
Our partner key is in the CLEAREDBY_PARTNER_KEY environment variable (server only).Only need the look? The theme prompt turns your design system into a ClearedBy theme.
How it works
- Propose. Your agent calls
gate()with the action, the exact parameters and its case for doing it. It holds a key that can propose but never approve, and no write access to the store. - Policy. The merchant's approval rules, installed for every org and shown as plain-English sliders, clear small safe changes on their own, refuse what is never allowed and hold the rest.
- Human. A reviewer approves, declines, sends it back or escalates, inside your app: drop in
@clearedby/reactor build on the API. ClearedBy checks that person's authority itself. - Authorise. Every approval carries an Ed25519-signed receipt naming the org, the action and the exact parameters.
- Execute. ClearedBy dispatches it to your executor, which checks it with
verifyDispatchand makes exactly that change. - Report. The executor reports per-item results. ClearedBy compares them with what was approved and keeps a tamper-evident record of the whole chain.
| You build | ClearedBy does |
|---|---|
The agent, proposing with gate() | Validates it against the action catalogue and the merchant's stores, applies the merchant's rules |
| The review screens (or our components) and a small proxy route | Works out who can approve, checks every decision against that person's authority |
| The executor that holds your store write credentials | Signs every approval, delivers it, retries, and answers "has this been revoked?" |
| Nothing: no audit code | Keeps a signed, tamper-evident record of every proposal, decision, cancellation and result |
Packages and examples
| Package | Where it runs | What it's for |
|---|---|---|
@clearedby/sdk | Your servers, your agent | ClearedBy (org key: propose, follow, complete) and ClearedByPartner (partner key: orgs, reviewers, decisions, rules, erasure) |
@clearedby/sdk/dispatch | Your executor (Node) | verifyDispatch: check every approval before acting on it |
@clearedby/sdk/receipt | Any service handed a receipt (Node) | Verify Authorisation Receipts offline, check revocation online |
@clearedby/sdk/partner-proxy | Your web server | The server half of the embedded approval UI |
@clearedby/react | Your web app | Queue, review panel, decision buttons, approval rules and history; hooks for a custom UI |
Runnable examples are in the public ClearedBy/clearedby-js repository: partner-approvals-next (the embedded UI in Next.js) and dispatch-receiver (a complete executor endpoint with an offline demo).
Need a partner key, or something here doesn't match what you see? Talk to your ClearedBy contact.