Developers
Your site stays yours. Citron is the back end it reads from.
Use any framework. Read published content over REST or GraphQL, send forms and bookings to the public endpoints, and rebuild only the pages an editor changed.
The SDK is not on npm yet. Until it is, we send it as a package tarball; ask us and we will share it with your team.
Quick start#
Three steps from an empty project to a page that updates itself when an editor publishes.
Create an API key#
In the console, open Settings → Developers → API keys and create a published key. It starts with
ck_pub_and is shown once: put it straight into your server’s environment..env.local # .env.local (server only) CITRON_BASE_URL=https://api.console.citronos.com CITRON_API_KEY=ck_pub_… CITRON_WEBHOOK_SECRET=whsec_…Fetch content#
Ask for a collection by its slug.
localeflattens translated fields to one language. The REST reference covers filters, sorting, paging and relations.curl "https://api.console.citronos.com/v1/content/products?locale=en&pageSize=20" \ -H "Authorization: Bearer $CITRON_API_KEY"import { createClient } from '@citron/sdk'; const citron = createClient({ baseUrl: 'https://api.console.citronos.com', apiKey: process.env.CITRON_API_KEY, // ck_pub_… locale: 'en', }); const { data: products, meta } = await citron.collection('products').list({ limit: 20 }); console.log(meta.total, products.map((p) => p.slug));Revalidate with webhooks#
Add a route that checks the signature and revalidates the changed pages, then register its address under Settings → Developers → Webhooks and copy the secret into
CITRON_WEBHOOK_SECRET. More on webhooks.app/api/citron-webhook/route.ts // app/api/citron-webhook/route.ts import { revalidateTag } from 'next/cache'; import { citronTags, createRevalidateHandler } from '@citron/sdk/next'; export const POST = createRevalidateHandler({ secret: process.env.CITRON_WEBHOOK_SECRET, onEvent: (e) => citronTags(e.collection, e.entry.slug).forEach((tag) => revalidateTag(tag)), });
Reference#
REST delivery API
Two read-only routes for every collection: locales, filters, sorting, paging, relations, ETags and signed draft previews.
GraphQL
A schema built from your collections, with filters, relations, drafts, persisted queries and query limits.
AI connectors (coming soon)
Coming soon: connect Claude, ChatGPT, Cursor and other AI tools to a workspace over MCP, with OAuth or a personal token and the member’s own permissions.
Webhooks
Publish, unpublish and delete events, HMAC signatures, retries and Next.js revalidation.
Forms, contact and booking
Public contact, form and booking endpoints with Turnstile, idempotency keys and spam protection.
TypeScript SDK
A typed client with no dependencies, type generation from your collections and Next.js helpers.
Errors and rate limits
The error body, status and error codes, request ids and every rate limit.
Keys and environments#
ck_pub_…- Reads published content. Rate-limited per key. Keep it on a server or at the edge.
ck_prev_…- Reads drafts for previews. Keep it on the server; never ship it to a browser.
Where- Settings → Developers → API keys and Webhooks, in the console.
Base URL- https://api.console.citronos.com
Try it on a real workspace
Request access, then create a collection and a public key and read it from your site.