Go live
Build on a platform of your own, then make the one your users get, with a checklist covering origins, agents, webhooks, replacing keys and rate limits.
Make one platform to build and try things on, such as Acme Notes (dev), and another for your real users. Each has its own keys, settings and MCP address, and they never see each other's data: users, documents, agents, seals and webhook endpoints on one don't exist on the other. Everything works the same on both, from the editor to agents and seals.
Your development platform
- List where the editor loads, such as
http://localhost:5173, under Embed origins. Plainhttpis allowed only forlocalhostand127.0.0.1. - Agents connect to its own address, such as
https://mcp.undertext.sh/acme-dev, which uses its consent URL. That URL may be onlocalhost, since the person's own browser opens it. - Webhook endpoints must be
https, so point one at a tunnel to your machine, such ascloudflared tunnel --url http://localhost:3000.
Before you go live
Make your platform for real users in the console, then work through these with its key, in a staging copy of your app if you have one.
Keep the secret key on your server
Load your sk_… key from your secret store or an environment variable, on the server only. It never belongs in the browser, in a mobile app, or in your repository. The browser only ever needs session tokens, which your server starts for one user and one document at a time.
Anyone holding your secret key can start a session as any of your users. That's why seals name your platform as the one vouching for who wrote, and record which key was used.
Set your embed origins
List every origin your app serves the editor from, such as https://acme.com, under Embed origins. Leave out anything you don't control. The editor won't load anywhere else, which stops other sites from framing your users' documents.
Set your consent URL
Set its consent URL in the console, or with PATCH /v1/platform, and connect a real agent to its address, https://mcp.undertext.sh/acme, from start to finish. See Connect agents.
Add your webhook endpoint
Add its endpoint and store its whsec_… secret apart from your development platform's. Check your server answers 2xx to a real event, such as a comment in a document. See Send notifications.
Check your name, and verify your domain
Seal pages name your platform as where the text was written, which vouches for who wrote it. Make sure the platform's name in the console is the one your users know, and add your domain there: once its DNS record is found, seal pages read "Acme Notes (acme.com, Verified)" rather than "Acme Notes (Unverified)". Anyone can call a platform anything; only you can add a record to your domain.
Replace keys
To replace a key without downtime:
- In the console, create a new key.
- Deploy it.
- Once the console shows the old key's last use was before your deploy, revoke it.
If a key may have leaked, revoke it right away. Every request with it stops at once. Seals record the ids of the keys that started their writing sessions (attested_by.key_ids), so you can find every seal a leaked key had a hand in.
Stay within rate limits
The API doesn't limit requests yet. Even so, start one session per page load rather than one per action, and call users.upsert only when starting sessions or when a profile changes. When limits come, a request over them will get 429 with a Retry-After header, which the Node SDK already waits for and retries.
In the editor, people's edits always go first, and each agent request gets a short slice of work at a time per document, so one busy agent never slows anyone's typing.
Handle errors
Every error has a type and a code, so your code can branch on them:
try {
await undertext.sessions.create({ user: "usr_9Tb3Wc1X", document: "doc_8Hq2Lm4R" });
} catch (error) {
if (error.type === "permission" && error.code === "no_access") showNoAccess();
else throw error;
}The API overview lists every type.
Next
- Platforms and keys: settings and keys in detail.
- Trust model: what your key vouches for.