Skip to content
SleekSite AI Docs
On this page

Headless CMS (Integrate)

Pull your content into any frontend with the content API and SDKs.

Admins
  • Use SleekSite as a headless CMS: pull your content into any frontend
Site token + envEditors & AISleekSite contentContent APINode / Next.jsReact appAny HTTP client

Site token & the content API#

  • Site token (pub-…): reveal and copy at the top of Integrate
  • Send it as the Authorization header
curl -H "Authorization: SITE_TOKEN" "https://<content-api-host>/<site>/latest"
  • Copy the exact URL from the Playground.

Playground#

  • Search (JMESPath): query the content, e.g. pages[?featured==`true`]
  • Meta data: each record carries extra info (schema name, record id, updated_at…); filter to fetch only what you need
  • Environment picker (latest by default), Reload
  • Live JSON response: entries, pages, images, options
Integrate: playground Content Integration Site Token: pub-acme42-… Playground Node React Next Search (JMESPath) Meta data all Environment 1 2 3 4 5 6 7
  1. Site token: reveal and copy
  2. Playground · Node · React · Next
  3. Query with JMESPath
  4. Meta data: fetch only what you need
  5. Environment (latest by default)
  6. The request, ready to copy
  7. Live JSON: entries, pages, images, options

Node: @sleekcms/client#

  • Works with any Node.js framework (Express, Fastify, Hono, serverless)
npm install @sleekcms/client
  • createSyncClient(opts): fetches all content up front; methods are synchronous (best for static site generation)
  • createAsyncClient(opts): fetches on demand; methods are async (best for server rendering)
  • Methods: getPage, getPages, getEntry, getSlugs, getImage, getOptions, getContent(jmespath?)
Option Description
siteToken Your site token (required)
env Environment name (default latest)
lang Language code for translated content
cache Custom cache adapter (default in-memory)
cacheMinutes Cache expiry
resolveEnv Resolve the environment alias to a version tag
Integrate: Node Content Integration Site Token: pub-acme42-… Playground Node React Next @sleekcms/client API REFERENCE GITHUB NPM Installation API Methods 1 2 3
  1. Any Node.js framework
  2. Install
  3. Sync (static sites) or async (server rendering) client, same methods

React: @sleekcms/react#

  • Hooks for client-side rendering (React 18+)
import { SleekCMSProvider } from '@sleekcms/react';
<SleekCMSProvider siteToken="your-site-token"><App /></SleekCMSProvider>
Integrate: React Content Integration Site Token: pub-acme42-… Playground Node React Next @sleekcms/react REACT 18+ VIEW ON GITHUB Install the package Wrap your app with the provider 1 2
  1. Install
  2. Provider at the root, with your site token

Next.js#

  • Use the sync client in App Router server components
import { createSyncClient } from '@sleekcms/client';
const client = await createSyncClient({ siteToken: process.env.SLEEKCMS_SITE_TOKEN! });
const posts = client.getPages('/blog'); // no await needed
Integrate: Next.js Content Integration Site Token: pub-acme42-… Playground Node React Next @sleekcms/client SSG / SSR VIEW ON GITHUB Install the package Create a sync client 1
  1. Fetch everything once, then read synchronously

Environments#

  • An environment is a named pointer to a saved version of your content (e.g. staging, production)
  • Anything reading through it gets exactly that version, even while you keep editing
  • Deploy content to environment to move it to a newer version
  • Add a webhook so your app or build is told each time
  • The built-in latest environment always serves the newest content
  • Add environment: enter a name, then Create
Deploy contentwebhookVersion 41Version 42Version 43 · latestproductionstaginglatestYour build
Integrate: environments Environments ADD ENVIRONMENT 1
  1. Add environment
Add environment Add Environment Environment name CREATE 1
  1. e.g. staging, production
Was this page helpful?

Last updated October 26, 2026