Delivery API
Krios exposes content over both GraphQL and REST. They are projections of the same underlying delivery layer (src/lib/delivery/index.ts); the only differences are the wire format and the field-projection ergonomics.
Choosing GraphQL vs REST
| GraphQL | REST |
|---|---|
| Tighter projection — only fetch what you list | Whole field map per entry |
| Per-field DataLoader batching | One-query-per-route |
| Auto-generated schema per content type | Same routes for every type |
| Best for app frontends with custom selections | Best for static-site builds, sitemap crawlers, simple integrations |
Both share the same auth model, cache headers, and surrogate-key contract.
Auth
Authorization: Bearer <api-key>
Three key types:
| Type | What it gets |
|---|---|
delivery | Public published content. Same as no auth. |
preview | Published + drafts. Pass to a frontend in preview mode. |
management | Full read + write. Required for the REST /api/v1/* mutation routes. |
No auth = delivery mode for read endpoints. The auth helper is shared between GraphQL and REST: src/lib/delivery/auth.ts.