Publishing and CMS

Sanity integration

Sanity keeps content as structured documents in a dataset you control. The Sanity integration reads and writes those documents, so WriteWorks fits your schema instead of asking you to bend it.

What it is

What the Sanity integration is

The Sanity connection works against a project and dataset you nominate, using a token you create. WriteWorks can create documents, update existing ones and read what is already there, which matters when a brief needs to know whether the page exists.

Because Sanity schemas differ from project to project, fields are mapped explicitly. Nothing is written to a field WriteWorks was not told about.

Projects and datasets
Documents and references
Field mappings
Draft and published documents
What it does

What you can do with it

Four questions the two data sets answer together that neither answers alone.

Documents are created against the type and fields you nominate, so what lands in the dataset is valid for the front end reading it.

How it works

How the Sanity integration works

About a minute to connect, and nothing to maintain afterwards.

1

Create a Sanity API token

In your Sanity project, create a token with write access to the dataset you want WriteWorks to use.

2

Connect it in WriteWorks

Open Settings, then Integrations, and choose Sanity. Add the token, project ID and dataset.

3

Map the document type

Choose which document type new work creates, and map the draft's parts to its fields.

4

Publish and track

Approved drafts become documents in your dataset, and published URLs are tracked from then on.

Who it is for

Who uses the Sanity integration

The same connection answers a different question depending on who is asking.

No import script to write or maintain, and nothing written outside the schema.

You bring your own account. The Sanity integration authenticates with your own account at Sanity, on your own plan and your own quota. WriteWorks reads the data that account already has access to, and nothing else. Disconnect at any time and the stored credential is deleted.

Related

Works well alongside

FAQ

Sanity integration FAQs

The questions teams ask before connecting it.

What does the Sanity integration do?+
It reads and writes documents in your Sanity dataset from WriteWorks, against a document type and field mapping you choose.
What permissions does the token need?+
Write access to the dataset you nominate. Read-only tokens can be used if you only want WriteWorks to see existing content.
Does it work with custom schemas?+
Yes. Fields are mapped explicitly, so custom document types are supported without a workaround.
How do I connect Sanity to WriteWorks?+
Create a token in your Sanity project, then open Settings, Integrations, choose Sanity, add the token, project ID and dataset, and map the document type.
Can I publish to a staging dataset?+
Yes. You choose the dataset, so staging and production stay separate.
What happens if I disconnect it?+
The stored token is deleted and WriteWorks stops reading or writing. Documents already created are untouched.

Connect Sanity and see the whole picture

Measure how 10+ AI platforms answer your buyers, join it to the paid and organic data you already have, and ship the content that flips the citation.

Sanity Integration | WriteWorks