1. Overview
Sanity connector publishes Skayle posts as Sanity documents. It requires:projectIddatasettokendocumentTypefieldMappingtaxonomyMapping
2. Prerequisites
Before connecting:- A Sanity project and dataset
- A post-like document type in your schema
- Category/tag/author taxonomy document types
- API token with write access
3. Creating API credentials
In Sanity Studio/Manage:- Go to
Manage -> API -> Tokens. - Create a token for Skayle.
- Copy the token value.
- Project ID
- Dataset
- Token
4. Required permissions
Token must allow read and write operations. In practice, use a token withEditor or Administrator level capabilities so create/update operations succeed.
5. CMS-side setup
Create/confirm these schema elements:- Main post document type (for example
post) - Fields for title, slug, excerpt, content
- Optional fields for featured image, publish date, status
- Taxonomy document types for category/tag/author
- Reference fields on post documents for taxonomy relations
- Document type discovery in Skayle depends on available content and schema visibility.
- If no content documents exist yet, you may need to create one to simplify type discovery.
6. Connecting in Skayle
- Open
Settings -> Connector. - Select
Sanity. - Enter project credentials and test connection.
- Choose your post
documentType. - Map Skayle fields to Sanity fields.
- Map taxonomy types (
category,tag,author). - Save connector.
7. Field mapping explanation
Sanity mapping is explicit. Required post field mappings:- Title
- Slug
- Excerpt
- Content
- Featured image
- Publish date
- Status
- Taxonomy reference fields (category/tags/author)
8. Publishing test article
- Create a draft in Skayle.
- Assign category/tag/author.
- Publish from Skayle.
- Confirm document appears in selected Sanity document type.
- Verify taxonomy references and mapped fields.
9. Common errors & troubleshooting
| Issue | Likely cause | Fix |
|---|---|---|
| Connection test fails | Invalid project/dataset/token | Re-check all three values |
| Permission/write errors | Token lacks create/update rights | Regenerate token with Editor/Admin privileges |
| Missing fields in mapping step | Schema type not discoverable | Confirm schema exists and create sample docs if needed |
| Taxonomy references empty | Taxonomy mapping not configured or unsynced | Complete taxonomy mapping and sync taxonomies |
| Slug/content not updating | Incorrect field mapping | Verify exact field names in Sanity schema |
10. Best practices
- Keep one canonical post document type for Skayle publishing.
- Keep taxonomy document types stable once mapped.
- Validate mapping on one test post before bulk publishing.
- Use clear naming for schema fields to reduce mapping mistakes.