Forms & Data Collection8 min read

How to Integrate Typeform with Your Headless CMS

Connect Typeform to structured content so your team can publish surveys, lead forms, quizzes, and event registrations from one source without copying questions by hand.

Published April 29, 2026
01 โ€” Overview

What is Typeform?

Typeform is a form and survey platform used to build conversational forms, quizzes, lead capture flows, event registrations, and customer feedback surveys. Teams use it when the form experience matters, especially when they need conditional logic, branded layouts, integrations, and response collection without building every input screen from scratch. Typeform provides REST APIs, webhooks, and an official JavaScript SDK for creating forms, reading responses, and automating form operations.


02 โ€” The case for integration

Why integrate Typeform with a headless CMS?

Form content changes more often than people expect. A product marketing team updates qualification questions before a launch. An events team changes registration options when a workshop sells out. A research team adds two screening questions after the first 50 responses. If those questions live only inside Typeform, your website, campaign pages, translations, and internal docs can drift out of sync within a week.


03 โ€” Architecture

Architecture overview

A typical Sanity and Typeform integration starts with a form definition in Sanity Studio: title, slug, questions, field types, choices, required flags, consent text, and campaign metadata. When that document is published, a Sanity webhook fires with the document ID, or a Sanity Function runs on the content mutation. The handler uses @sanity/client and GROQ to fetch exactly the fields Typeform needs, including referenced options such as products, event sessions, or audience segments. The handler then calls Typeform's Create API through @typeform/api-client to create or update the Typeform form with fields such as short_text, email, multiple_choice, yes_no, opinion_scale, and statement. The frontend can render the Typeform embed URL on a landing page, send users to the hosted Typeform URL, or show the form inside a campaign page. Typeform collects responses, and if you need response data back in your content operations, Typeform webhooks can send submission events to a separate endpoint for analysis, routing, or enrichment.


04 โ€” Use cases

Common use cases

๐Ÿงฒ

Lead qualification forms

Publish Typeform lead forms from Sanity fields, including industry, company size, product interest, and routing metadata used by sales.

๐ŸŽŸ๏ธ

Event registration flows

Keep session choices, speaker names, waitlist copy, and confirmation text in Sanity, then sync the latest version to Typeform before launch.

๐Ÿงช

Research screeners

Build Typeform screeners from structured question sets so research teams can update eligibility criteria without editing the live form by hand.

๐ŸŒ

Localized feedback surveys

Model survey copy by locale in Sanity, then create language-specific Typeform forms with matching questions, labels, and consent text.


05 โ€” Implementation

Step-by-step integration

  1. 1

    Create your Typeform workspace and token

    Create or open a Typeform account, choose the workspace that will own the forms, then create a personal access token from your Typeform account settings. Install the official SDK with npm install @typeform/api-client.

  2. 2

    Model form definitions in Sanity Studio

    Create a schema with fields such as title, slug, typeformId, questions, question type, label, required, helper text, and choices. If choices come from other content, use references so GROQ can join them at sync time.

  3. 3

    Add a webhook or Sanity Function

    Trigger the sync when documents of type typeformDefinition are created, updated, or published. Use a GROQ-powered webhook filter so edits to unrelated content don't call Typeform.

  4. 4

    Fetch the exact content Typeform needs

    In the handler, use @sanity/client with a GROQ query that returns only the title, question labels, field types, validation flags, and choice labels. This keeps the Typeform payload small and predictable.

  5. 5

    Create or update the Typeform form

    Call Typeform's Create API through @typeform/api-client. Map Sanity question types to Typeform field types such as short_text, email, multiple_choice, yes_no, and opinion_scale. Store the returned Typeform form ID or public URL back on the Sanity document if your frontend needs it.

  6. 6

    Test the frontend and response flow

    Open the published page, confirm the embedded Typeform loads, submit a test response, and verify that the response appears in Typeform. If responses need to trigger follow-up work, add a Typeform webhook for submission events.



07 โ€” Why Sanity

How Sanity + Typeform works

Build your Typeform integration on Sanity

Sanity gives you the structured content foundation, real-time event system, and flexible APIs to connect Typeform with your publishing workflow.

Start building free โ†’

08 โ€” Comparison

CMS approaches to Typeform

CapabilityTraditional CMSSanity
Form question sourceQuestions often live inside pages or plugins, so teams may copy them into Typeform manually.Questions, choices, consent copy, and references live as typed JSON in the Content Lake.
Sync triggerSync usually depends on plugin support, scheduled jobs, or a custom server.GROQ-powered webhooks and Functions can run only when relevant form documents change.
Payload controlThe integration may need to strip markup or extract content from page fields.GROQ can return exactly the Typeform payload, including referenced options and localized labels.
Editorial workflowEditors may publish page copy and then update Typeform in a separate tool.Sanity Studio supports schema-as-code, review workflows, Content Releases, and scheduled publishing for form definitions.
Response handlingResponses usually stay in the form plugin or get emailed to a shared inbox.Typeform can remain the response system, while Sanity handles form definitions, routing metadata, and AI content workflows around follow-up content.

09 โ€” Next steps

Keep building

Explore related integrations to complete your content stack.

Ready to try Sanity?

See how Sanity's Content Operating System powers integrations with Typeform and 200+ other tools.