Sanity CMS Setup

Connect Sanity CMS to Kreo Now for seamless AI content creation and publishing.

Last updated: 2026-07-22

Overview

Kreo Now's Sanity integration goes beyond simple API connectivity. It auto-detects your Sanity schema, maps fields intelligently, handles Portable Text conversion, and manages image uploads to your Sanity asset pipeline.

This guide walks you through connecting Kreo Now to your Sanity project and configuring the integration for optimal performance.

Prerequisites

  • A Sanity project (create one at sanity.io/manage)
  • Your Sanity Project ID and Dataset name
  • A Sanity API token with appropriate permissions

Step-by-Step Guide

  1. Create a Sanity API Token:
    Go to sanity.io/manage → Select your project → Settings → API → Tokens → Add API Token
    Name your token (e.g., "Kreo Now Integration") and select the following permissions:
    • Read — Schemas, documents, datasets
    • Write — Documents, assets
  2. Connect in Kreo Now:
    Go to Integrations → Add Connection → Sanity
  3. Enter your Project ID, Dataset name, and API Token
  4. Click Test Connection to verify everything works
  5. Click Save to complete the setup

Schema Detection

Once connected, Kreo Now automatically scans your Sanity project and detects your document schemas. Here's what happens:

  • Kreo Now lists all your schema types
  • You select which document type to publish to (e.g., post, article)
  • Kreo Now automatically maps fields based on naming conventions:
    • title → Kreo Now post title
    • slug → Auto-generated from title
    • body or content → Main content (Portable Text)
    • excerpt or description → Meta description
    • mainImage or image → Featured image
Tip: You can manually override any field mapping during setup if your schema uses non-standard field names.

Field Mapping Configuration

Kreo Now supports mapping to these Sanity field types:

Sanity TypeKreo Now SourceAuto-map Support
stringTitle, meta descriptionYes
textExcerpt, summaryYes
block (Portable Text)Full post contentYes
imageFeatured/generated imagesYes
slugAuto-generated from titleYes
arrayTags, categoriesPartial

To customize field mappings, click Configure Field Mapping after connecting. You can map any Kreo Now field to any compatible Sanity field.

Publishing Behavior

Kreo Now gives you full control over the publishing workflow:

  • Create Draft — Content is saved as a Sanity draft. You can review and publish from Sanity Studio later
  • Publish Immediately — Content is published directly to your Sanity dataset
  • Image Handling — Images generated by Kreo Now are uploaded to your Sanity assets pipeline automatically
  • Draft Status — Kreo Now respects Sanity's draft/published status system

Troubleshooting

IssueCauseSolution
Token permissions insufficientAPI token missing read/write scopesRegenerate the token with both read and write permissions
Schema not detectedNo published schemas or incorrect project IDEnsure at least one document type is published in Sanity. Verify project ID
Field mapping errorsField names don't match conventionsUse the field mapping editor to manually map fields
Portable Text issuesUnsupported block types in contentKreo Now supports standard blocks. Custom block types may need manual adjustment