Storyblok integration

Generate PDFs from Storyblok

Connect Quaterio to your Storyblok space, bind story fields to block-based templates and render paginated PDFs at generation time. Public and Preview tokens both work. Pick the right regional host and the connector handles the rest.

The problem

Storyblok ships first-class web and mobile output but no PDF channel. Teams end up exporting stories to HTML, hand-styling them in a separate tool and losing the visual editor connection on every publish. Custom Tiptap renderers plus Puppeteer work once, then need maintenance every time the content schema shifts.

How Quaterio handles it

Quaterio's Storyblok connector hits /v2/cdn/stories with your token in the URL and drops story content into a Remote Content block. EU, US, AU, CA and China hosts are all supported. Filter, sort and version parameters pass through unchanged. Publish in Storyblok, your PDFs reflect the change on the next generation.

How it works

  1. 1

    Find your regional host

    In Storyblok, go to Settings → Space Settings. The region (EU, US, AU, CA, China) is shown there. EU uses api.storyblok.com; US uses api-us; AU/Asia uses api-ap; CA uses api-ca; China uses app.storyblokchina.cn. Pick the matching host for your URL.

  2. 2

    Generate a Public access token

    Settings → Access Tokens → New Token. Pick "Public" as the token type (Preview is for draft content). Copy the token and paste it into ?token= on the connection URL.

  3. 3

    Pick the Storyblok preset in Connections

    Settings → Connections → New Connection → pick "Storyblok" from the type dropdown. Adjust the host to your region, paste the token and hit Detect Fields to see the JSON paths available.

  4. 4

    Generate the PDF via the editor or API

    Export from the editor for one-offs. For batch jobs hit POST /api/v1/generate/template with the template ID. The connector re-fetches at generation time so every PDF reflects the latest published story.

What the connector handles

  • Content Delivery API v2 via Public or Preview token in the URL
  • Five regional hosts: EU, US, AU/Asia, Canada and China
  • Published or draft content via version=published / version=draft
  • Single-story (/stories/{slug}) and list (/stories) endpoints both supported
  • Filter, sort, per_page and starts_with parameters pass through on the URL
  • Edge-cached CDN with 1000 cached requests per second
  • Cache-version override (?cv=) for immediate freshness after publish
  • Detect Fields walks the response so you can pick paths in the editor
  • Honest about Richtext: returned as Tiptap-style JSON tree, not HTML
  • 15 second fetch timeout, cached on the block when the API is slow or unreachable

Generate via API

# 1. Create the connection via the dashboard (one-time setup). # 2. Bind a template's Remote Content block to it. # 3. Generate a PDF that pulls live Storyblok content: curl -X POST https://quaterio.com/api/v1/generate/template \ -H "Authorization: Bearer q_your_token" \ -H "Content-Type: application/json" \ -d '{ "templateId": "storyblok_story_export" }' # → { # "ok": true, # "data": { "downloadUrl": ".../story_en_a7f3b2c1.pdf" } # } # The connector hits /v2/cdn/stories at generation time and # renders the bound story field into the template block.

Available on Business plan and above.

Storyblok and PDF: the real questions

The Storyblok preset queries /v2/cdn/stories with a Public or Preview token in the URL. Stories flow into Quaterio templates as JSON. Regions matter, EU, US, AU, CA and China each have their own API host. The sections below cover region routing, the Richtext gotcha, token choice and rate limits.

Pick the right regional host (this trips up most teams)

Storyblok spaces are pinned to a region. EU spaces hit api.storyblok.com, US spaces hit api-us.storyblok.com, AU/Asia spaces hit api-ap.storyblok.com, Canadian spaces hit api-ca.storyblok.com and China spaces hit app.storyblokchina.cn. Using the wrong host returns "Space could not be found" even with a valid token.

You can check your region in Storyblok under Settings → Space Settings. The preset URL defaults to the EU host because that is the most common; swap the host on the URL if your space lives elsewhere.

Public vs Preview token: when to use which

Public tokens read published stories only. Preview tokens read both published and draft. For PDF generation you almost always want a Public token, the PDF should reflect what readers see, not unfinished edits. Generate one under Settings → Access Tokens; choose "Public" as the token type and copy the value into ?token= on the URL.

Use a Preview token only when generating proofs of in-progress content for an internal review. Pair it with ?version=draft on the URL so the API returns the draft tree. The connector handles both modes; the difference is which token you paste.

Richtext fields come back as a JSON tree, not HTML

Storyblok's Richtext field is built on the same Tiptap engine Quaterio uses internally. The API returns it as a JSON document tree ({ type: "doc", content: [{ type: "paragraph", ... }] }), not as rendered HTML. Binding a Richtext field straight to a Remote Content block puts the JSON in your PDF.

Two workable paths today. First, model long-form prose as a Markdown field rather than Richtext. Quaterio renders Markdown into HTML at generation time. Second, render the Richtext to HTML in your own service (using @storyblok/richtext-resolver or similar) and store the result as a separate string field. Native Tiptap-tree to HTML conversion inside the connector is on the roadmap.

Stories endpoint vs Story endpoint, lists vs single

GET /v2/cdn/stories returns a list: { stories: [...], cv: ..., links, rels }. The default Response Field stories.0.content.body picks the body field of the first story. GET /v2/cdn/stories/{slug} returns a single story wrapped as { story: {...}, cv: ... }; for that endpoint the path becomes story.content.body.

For PDF templates that always render one specific story (the about page, a particular landing page) the single-endpoint URL is cleaner, no array index, no risk of order shifts. For collections (blog posts, product brochures) use the list endpoint and pass an index in the URL filter to pick a specific story per PDF.

Filtering and search parameters

Storyblok supports filter_query, per_page, page, starts_with, with_tag and sort_by as query parameters. Example: ?token=...&filter_query[component][in]=hero&per_page=10&sort_by=published_at:desc. Append them straight onto the connection URL.

Per page caps at 100 entries. For PDF batch jobs that need more, paginate via page= and combine into one request per row. Filter expressions follow Storyblok's documented operators; the connector passes the full URL through unchanged.

Rate limits and CDN behavior

The Storyblok CDN allows 1000 cached requests per second. Single-entry reads are limited to 50 per second; listing reads scale down from 50 per second for small lists to about 6 per second for 100-entry lists. PDF generation almost never hits these in practice.

Storyblok's CDN is edge-cached. After publishing changes in Storyblok the CDN takes a few seconds to invalidate. If your PDF needs immediate freshness, use ?cv=timestamp on the URL with the timestamp from the latest publish, that forces a cache bypass. Quaterio passes the parameter through.

Pricing and plan tier

CMS connections are part of the Business plan and above ($30/mo). Pro plans get the editor and basic templates but not the Remote Content block. Free and Pro users who try to add a Remote Content block see an upgrade prompt.

Storyblok has a generous free Community plan (one user, unlimited stories). Paid plans start at €99/mo for additional features and seats. The Content Delivery API is included on every Storyblok tier; there is no per-call cost from Quaterio.

Try the Storyblok connector free

Set up the connection in two minutes. No credit card required to start.