🔥 All-Access Pass — $199 USD (Regular $499) · Unlock all 2,836 Astro themes ➔
komal.nakrani
Get All-Access Pass ($199)
ThemesCategoriesDocsBlogTips & TricksPricingGet All-Access Pass ($199)
Comparisons••By Komal Nakrani

Sanity vs Storyblok for Astro: Headless CMS Compared

Sanity vs Storyblok for Astro sites: editing experience, content modeling, visual preview, querying, integration setup and team fit, with code and a clear verdict.

#Astro#Sanity#Storyblok#Headless CMS

Sanity vs Storyblok comes down to who edits the site. Storyblok is built around a visual, page-builder style editor where marketers drag components and see the page update live; Sanity is a structured content platform where developers define schemas in code and editors work in a customizable Studio. Both have official Astro integrations and both work for static and on-demand Astro sites.

Key Takeaways

  • Pick Storyblok when non-technical editors build landing pages themselves and need a live visual preview.
  • Pick Sanity when content is structured data reused across pages, apps and channels, and developers own the model.
  • Sanity queries with GROQ and stores rich text as Portable Text; Storyblok returns nested component “bloks” as JSON.
  • Both integrate with Astro in a few lines: @sanity/astro and @storyblok/astro.
  • Static builds work with both; live preview needs a dev server or an on-demand rendered preview deployment.

How each CMS thinks about content

Storyblok models a page as a tree of components, which it calls bloks. A page blok contains a body field, which holds hero, feature_grid and testimonial bloks, each with its own fields. Editors assemble pages from those bloks in a visual editor that shows your real site in an iframe. Your Astro code maps each blok name to an Astro component.

Sanity models content as documents with typed fields, defined in JavaScript or TypeScript in Sanity Studio. A post has a title, a slug, an author reference and a body of Portable Text. Documents live in Sanity’s hosted Content Lake, and you query them with GROQ, a query language that can join references, filter and project only the fields you need. Sanity Studio is an open-source React app you configure in code and can deploy to Sanity’s hosting or your own.

That difference drives almost everything else. Storyblok is page-first. Sanity is content-first.

Sanity vs Storyblok at a glance

Sanity Storyblok
Editing model Structured documents in a customizable Studio Visual editor with nested components
Who configures it Developers, in code (schemas in TS/JS) Developers define components in the UI or via CLI
Visual preview Presentation tool with click-to-edit overlays Built-in visual editor, the core of the product
Query language GROQ (and GraphQL) REST Content Delivery API (and GraphQL)
Rich text Portable Text (structured JSON) Rich text field (structured JSON)
Astro integration @sanity/astro @storyblok/astro
Studio hosting Sanity-hosted or self-hosted, can embed in your Astro app Hosted by Storyblok
Localization Field-level or document-level, you design it Built-in field-level and folder-level translation
Best for Content reused across channels, complex relations Marketing sites where editors build pages

Both offer a free tier for small projects and paid plans for teams. Plans and limits change often, so check each vendor’s pricing page before committing a client.

Setting up Sanity in Astro

Install the official integration and the React integration (Sanity Studio is a React app, so you only need React if you embed the Studio in your Astro project):

npx astro add @sanity/astro @astrojs/react

Configure the project:

// astro.config.mjs
import { defineConfig } from 'astro/config';
import sanity from '@sanity/astro';
import react from '@astrojs/react';

export default defineConfig({
  integrations: [
    sanity({
      projectId: 'your-project-id',
      dataset: 'production',
      useCdn: false, // false for static builds so you always get fresh content
      apiVersion: '2025-01-01',
      studioBasePath: '/studio', // optional: embeds Studio at /studio
    }),
    react(),
  ],
});

Query content with GROQ through the sanity:client virtual module:

---
// src/pages/blog/[slug].astro
import { sanityClient } from 'sanity:client';

export async function getStaticPaths() {
  const posts = await sanityClient.fetch(
    `*[_type == "post" && defined(slug.current)]{ title, "slug": slug.current, body }`
  );
  return posts.map((post) => ({ params: { slug: post.slug }, props: { post } }));
}

const { post } = Astro.props;
---
<h1>{post.title}</h1>

To render Portable Text, use a renderer such as astro-portabletext and map custom block types to your own Astro components. That gives you full control over the HTML, which is good for accessibility and SEO but means more setup than a plain HTML field.

Setting up Storyblok in Astro

Install the integration:

npx astro add @storyblok/astro

Register your bloks so the integration knows which Astro component renders each one:

// astro.config.mjs
import { defineConfig } from 'astro/config';
import { storyblok } from '@storyblok/astro';
import { loadEnv } from 'vite';

const env = loadEnv(process.env.NODE_ENV ?? 'development', process.cwd(), '');

export default defineConfig({
  integrations: [
    storyblok({
      accessToken: env.STORYBLOK_TOKEN,
      components: {
        page: 'storyblok/Page',
        hero: 'storyblok/Hero',
        feature: 'storyblok/Feature',
      },
      apiOptions: { region: 'eu' },
    }),
  ],
});

Each blok component receives its data as blok and spreads storyblokEditable so the visual editor can highlight it:

---
// src/storyblok/Hero.astro
import { storyblokEditable } from '@storyblok/astro';
const { blok } = Astro.props;
---
<section {...storyblokEditable(blok)} class="hero">
  <h1>{blok.headline}</h1>
  <p>{blok.subline}</p>
</section>

Fetch a story and hand it to StoryblokComponent, which picks the right component for each blok:

---
// src/pages/index.astro
import { useStoryblokApi } from '@storyblok/astro';
import StoryblokComponent from '@storyblok/astro/StoryblokComponent.astro';

const storyblokApi = useStoryblokApi();
const { data } = await storyblokApi.get('cdn/stories/home', {
  version: import.meta.env.DEV ? 'draft' : 'published',
});
---
<StoryblokComponent blok={data.story.content} />

Check the Storyblok guide in the Astro docs for the current option names, since the integration evolves with Storyblok’s SDK.

Editing experience

This is the deciding factor for most client projects.

Storyblok’s editor shows the real page. Editors click a section, change the headline in a side panel, and see it update. They can add, reorder and remove bloks without a developer, as long as the developer has built those bloks. For a marketing team that ships new landing pages every week, this is the main reason to choose Storyblok.

Sanity Studio is a form-based editor by default, closer to a well-designed database admin. It becomes visual when you set up the Presentation tool, which renders your site beside the editor with click-to-edit overlays. That setup takes more developer work, but the result can match Storyblok’s experience. Where Sanity shines is customization: you can add custom inputs, validation rules, document actions and desk structures in code.

Content modeling and reuse

Sanity is stronger when the same content appears in many places. An author document referenced by 200 posts, a product referenced by a landing page and a comparison table, or a set of FAQs reused on several pages all fit Sanity’s document and reference model. GROQ can pull referenced documents into one query, so your Astro page gets exactly the shape it needs in one request.

Storyblok handles reuse through references and global components, but its sweet spot is page-shaped content. If most of your content is “this page, these sections, in this order”, Storyblok’s model maps directly to it with little translation.

Both return structured rich text, not raw HTML. That is good: you control the markup and can swap in Astro components for embeds, callouts or images.

Static builds, preview and performance

Both CMSs work with Astro’s default static output. Your build fetches content once, Astro writes HTML, and the deployed site makes no CMS requests at runtime. To publish new content, trigger a rebuild with a webhook from the CMS to your host (Cloudflare Pages, Netlify and Vercel all support deploy hooks).

Live preview is where you need more than a static build. Storyblok’s visual editor loads your site in an iframe and expects it to fetch draft content on each request, so you either point it at astro dev or deploy a separate preview build with on-demand rendering. Sanity’s Presentation tool has the same requirement. The Astro SSR guide explains how to add an adapter for a preview deployment while keeping production static.

Runtime performance is identical once the site is built, because visitors only ever receive Astro’s HTML.

Choose Sanity or Storyblok

Choose Storyblok if marketers or clients will build and rearrange pages themselves, the live visual editor is a selling point in your proposal, the site is mostly marketing and landing pages, and you want built-in translation workflows.

Choose Sanity if developers own the content model, content is reused across pages or channels, you need custom editorial workflows or validation, or you want the editing interface itself to be part of your codebase.

Choose neither if the site is a blog or docs site edited by developers. Markdown or MDX in Content Collections is simpler, free and version-controlled. Our Markdown or CMS guide walks through that decision, and the headless CMS guide covers other options.

Komal themes use Content Collections with local Markdown, so they run with no CMS account at all. Because the collections are defined in src/content.config.ts, you can swap a collection’s loader for Sanity or Storyblok data later. See the Content Collections docs for how the themes structure content, or browse the blog and editorial themes for content-heavy starting points.

FAQ

Is Sanity or Storyblok better for Astro?

Both have official, maintained Astro integrations and work with static and on-demand rendering. Storyblok is better when editors need a visual page builder. Sanity is better when content is structured, relational and reused, and developers want to define the model in code.

Is Storyblok easier to use than Sanity?

For non-technical editors, usually yes, because Storyblok’s visual editor shows the real page and lets them add and reorder components. Sanity can offer a similar experience through its Presentation tool, but that requires more developer setup.

Can I use Sanity or Storyblok with a static Astro site?

Yes. Astro fetches content at build time and writes static HTML, so the deployed site never calls the CMS. Set up a webhook from the CMS to your host’s deploy hook so publishing content triggers a rebuild.

Do Sanity and Storyblok have free plans?

Both offer a free tier suited to small projects and personal sites, with paid plans for larger teams, more users and higher usage. Limits change, so check each vendor’s current pricing page before choosing one for a client.

What is GROQ in Sanity?

GROQ is Sanity’s query language. It filters documents, follows references and projects only the fields you need in a single query, for example *[_type == "post"]{ title, "slug": slug.current }. Sanity also offers a GraphQL API.