tuqo
Headless CMS

Tuqo + Sanity

Sanity is a headless CMS: content is edited in a convenient studio, and the site gets it through an API. With a static site on Tuqo there are two paths: fetch the content at build time and get fully static pages, or query it in the browser with the public projectId. Tuqo serves the finished static site over HTTPS; no server code is needed.

Static front end on Tuqo + Sanity straight from the browser · free SSL

What Tuqo + Sanity gives you

  • A convenient content editing studio (Sanity Studio)
  • Content over an API (GROQ), at build time or in the browser
  • Structured content and media in one place
  • Plain static output: fast and backend-free
1

Create a Sanity project

Set up the project and content schemas in Sanity, and note the projectId and the dataset (usually production).

2

Allow read access

For public content, make the dataset public (read), or use a read token only at build time, never in the browser.

3

Fetch the content

At build time (Astro, Vite, any SSG), query the data with GROQ and generate the pages; or fetch content in the browser with the public projectId.

4

Deploy to Tuqo

Build the site and publish the static files: Tuqo builds a project with a build step on Node, and a ready static site deploys instantly.

import { createClient } from '@sanity/client'

// projectId and dataset are public; a read token (if needed) is for build time ONLY
const client = createClient({
  projectId: 'xxxx',
  dataset: 'production',
  apiVersion: '2024-01-01',
  useCdn: true,
})

const posts = await client.fetch('*[_type == "post"]{ title, slug }')

Security

projectId and dataset are public by design, so they can live in the code. If you read content in the browser, the dataset must be publicly readable. Write tokens and private read tokens are secrets: use them ONLY at build time or on a server, never in a static site. The safest path is to fetch content at build time and serve finished static pages.

Tuqo serves the front end over HTTPS and never touches your data or the service's secrets.

Tuqo + Sanity — frequently asked questions

Is content fetched at build time or in the browser? +

Either. At build time you get fully static pages (faster, and the tokens stay private). In the browser it is more dynamic, but the dataset must be publicly readable.

Do I need a backend of my own? +

No. Sanity is the content backend. Tuqo serves the built static site: it builds a project with a build step itself, and publishes a ready static site instantly.

Where do I keep Sanity tokens? +

Write tokens and private read tokens only at build time or on a server, never in a static site. Public content needs no token at all.

Other integrations