Your content,
ready for your code.
Deliver structured content to your applications through REST, GraphQL or a TypeScript SDK. Query the content you need, work with typed responses, and keep your content in your own PostgreSQL database.
s-maxage=60
Cache directives
100% Typed
CLI generated
Direct Postgres
Customer owned
import { createClient } from "@schmadev/client";
import type { Article } from "@/types/schma";
tenantSlug: "editorial",
apiKey: process.env.SCHMA_DELIVERY_KEY!,
});
const { data: articles } = await schma.delivery.listEntries<Article>({
type: "article",
limit: 10,
populate: ["author"],
});
A slower kind of Sunday
{
"data": [{ "id": "ent_94a2", "fields": { "title": "A slower Sunday", ... } }],
"meta": { "total": 38, "limit": 10, "offset": 0, "hasMore": true }
}articleCollection(limit: 5) {
title
author { ... on Author { name } }
}
}
Query content.
Get the shape you need.
Retrieve entries by content type, paginate through results, sort records, request localized content and populate referenced entries. Start with a straightforward HTTP request, then add the parameters your application needs.
1-Hop Batch Reference Expansion
REST reference population expands references one level deep. For more complex nested relationships, explore GraphQL below.Content Model Filtering
Query entries belonging to a specific content model slug (e.g. ?type=article).
1-Hop Reference Expansion
Expand reference IDs into complete objects in a single batch query (e.g. ?populate=author,tags).
Zero-Based Pagination
Control page sizes up to 100 entries per request. Responses include total count and hasMore indicator.
Deterministic Sorting
Order records by publishedAt, createdAt, updatedAt, or id in ascending or descending sequence.
Field-Level Localization
Request localized fields with automatic fallback to base language content.
Customer Database Execution
Queries run directly against your own pooled PostgreSQL instance via connectionManager, avoiding opaque multi-tenant queues.
Ask for the content
your interface needs.
Work with a GraphQL schema generated from your content models. Select the fields your application needs and follow relationships between content types, without relying on a fixed, hand-written schema for every model.
EntryUnion Polymorphic Resolution
Reference fields automatically resolve against heterogeneous content types through GraphQL unions and inline fragments.Production Complexity Safeguards
Active Query GuardrailsAST depth traversal verification automatically rejects recursive queries deeper than 6 levels with a 400 Bad Request.
Prevents query-alias inflation attacks by enforcing a maximum of 5 root fields per request payload.
Payload array batches are limited to 5 operations to prevent worker thread saturation and denial-of-service.
From content models
to typed application code.
Use @schmadev/client to retrieve content with a native-fetch, zero-runtime-dependency TypeScript client. Generate TypeScript interfaces from your SCHMA content models with the CLI, then use those types throughout your application code.
Define structured schemas and relationships in your PostgreSQL workspace.
Introspect workspace models and output clean declaration interfaces.
✔ Introspected 4 models
✔ Generated TypeScript interfaces
title: string;
slug: string;
author?: Author;
}
Pass generated types directly into the isomorphic SDK client.
type: "article",
limit: 10,
populate: ["author"],
});
data[0].fields.title // string
data[0].fields.author?.fields.name
@schmadev/client runs on native fetch. Dual-published ESM & CommonJS for Node 18+, Bun, Next.js, Remix, Astro, and Cloudflare Workers.
Dedicated client.delivery methods: getEntry, listEntries, and searchSimilar. Completely separated from management mutations.
CLI-generated interfaces provide complete compile-time developer confidence without bundling heavy runtime validation schemas into your production edge bundle.
Fast published content.
Fresh editorial previews.
Published entries can be served with cache-friendly HTTP headers. When you need to inspect draft content, a valid preview token switches delivery to the working draft and disables caching, so an old cached response does not stand between you and your latest edits.
Requests from production users are served from frozen published snapshots with cache-friendly HTTP headers.
→ Reads published_data_json
Preview tokens allow content editors and staging frontends (e.g. Next.js Draft Mode) to view working drafts instantly.
→ Reads live working data_json
Retrieve related articles and power semantic search with native PostgreSQL cosine similarity (<=>). Backed by 768-dimensional embeddings via your configured AI provider key (BYOK).
Put your content to work.
Connect your application to structured content with the delivery method that fits your stack.