Why Connect Sanity?
Content Search
Chatbot can search and retrieve Sanity documents
Structured Content
Works with Sanity’s powerful structured content
Project Token Auth
Secure authentication with project tokens
Prerequisites
- Sanity project with content
- Admin access to your Sanity project
- Project token (API token) generated from your Sanity dashboard
- Sanity dataset configured
Setup Steps
Get Project ID
Find your Sanity Project ID:
- Log in to your Sanity dashboard
- Navigate to your project
- Copy the Project ID from the project URL or settings
- Format:
https://www.sanity.io/contacts/project/YOUR_PROJECT_ID
Generate API Token
Create an API Token in your Sanity dashboard:
- Go to Manage → API → Tokens
- Click Add API token
- Enter a label (e.g., “BubblaV Integration”)
- Select permissions: Editor or Viewer
- Click Add
- Copy the generated token (shown only once)
Available Tools After Connection
| Tool | What It Does | Example Query |
|---|---|---|
sanity_search_content | Search Sanity documents | ”Find articles about pricing” |
Test Your Integration
Try these queries on your website:- “What do you have about [topic]?”
- “Show me articles about [subject]”
- “Find documents related to [keyword]“
Troubleshooting
Authentication fails
Authentication fails
- Verify your Project ID and API Token are correct
- Check that the token hasn’t been revoked
- Ensure the token has at least Viewer permissions
- Make sure you’re entering the dataset name correctly (case-sensitive)
Connection fails
Connection fails
- Verify your Project ID is correct
- Check that your dataset exists and has content
- Ensure your project is accessible via the API
- Try using Sanity’s API explorer to test access
Dataset not found
Dataset not found
- Ensure you’re using the correct dataset name
- Default dataset is usually “production”
- Check your dataset names in the Sanity dashboard
- Dataset names are case-sensitive
GROQ query issues
GROQ query issues
- Sanity uses GROQ (Graph-Relational Object Queries)
- The integration uses standard queries that work with most schemas
- Custom schemas may require query adjustments
- Contact support if you have complex schema requirements
Security: We use Sanity API Tokens for authentication. These tokens can be revoked or regenerated at any time from your Sanity dashboard without affecting your application.
