Connect Sanity
Connect Sanity to Thig with your project ID, dataset and an Editor API token so the Writer Agent can create article documents.
Connect Sanity so the Writer Agent can write finished articles straight into your dataset as documents. You need your project ID, dataset name and an API token with Editor permission.
Step 1: Find your project ID and dataset
- Open sanity.io/manage and select your project.
- Copy the Project ID, for example
abc123xy. - Note the dataset you publish from, usually
production.
Step 2: Create an API token
- In the same project, go to API, then Tokens.
- Click Add API token.
- Name it
Thigand choose Editor permission. - Copy the token. Sanity shows it only once.
Step 3: Connect in Thig
- Open Account from the dock, or Settings, Integrations.
- Find Sanity and click Connect.
- Fill in:
- Project ID: from step 1.
- Dataset: for example
production. - Document type: optional. Defaults to
post. - Site URL: optional, for example
https://example.com/blog. Used to build the published link. - API token (editor): from step 2.
- Click Connect.
What Thig writes
Each article becomes a document of your chosen type with:
| Field | Value |
|---|---|
_type | Your document type, post by default |
title | The article title |
slug | A slug object built from the article slug |
body | The article as an HTML string |
If your schema expects Portable Text in the body, add a string field for the HTML or convert it when rendering.
Publish an article
- Approve an article in the Writer Agent.
- Click Publish to Sanity.
- Open your Studio, review the document and publish.
Only one article destination can be connected at a time.
Troubleshooting
- Permission denied: the token needs Editor permission, not Viewer.
- Document does not show in Studio: check the document type matches a type in your schema.
Questions about this page
How is the article body stored?
As HTML in a body string field on the document. If your schema uses Portable Text, convert it in your Studio or frontend.
Which document type does Thig create?
post by default. Enter a different name in Document type to match your schema.
Last updated
