Empower your content management through Sanity - a customizable all-code backend for content-driven websites and apps.
View Sanity's documentation.
Supported syncing
Type | Description | Supported Sync Modes | API Reference |
---|---|---|---|
Documents | Sync data from any source to Sanity | Upsert, Update, Insert | Documents docs |
For more information about sync modes, refer to the sync modes docs.
Connect to Sanity
Go to the Destinations overview page and click the Add destination button. Select Sanity and click Continue. You can then authenticate Hightouch to Sanity.
Enter the following fields into Hightouch:
- Project ID: Find your Project ID on the project's main dashboard.
- API token: Generate or find your API token for your project under the API tab.
Sync configuration
Once you've set up your Sanity destination and have a model to pull data from, you can set up your sync configuration to begin syncing data. Go to the Syncs overview page and click the Add sync button to begin. Then, select the relevant model and the Sanity destination you want to sync to.
Syncing documents
Sync data from any source to Sanity documents. Define document schemas and types
in your Sanity project, and sync document properties and fields to Sanity using Hightouch.
Record matching
To match rows from your model to documents in Sanity, you need to select the model column that contains values that match the ID field. You can match on any of the following Sanity fields:
- ID
- custom matching field (recommended unique)
Refer to the record matching docs for more information.
In Insert mode, Sanity automatically generates an identifier for every new record synced.
Field mapping
Hightouch lets you sync document fields via field mapping. You can map data from any of your model columns to default and custom document schema fields. Ensure your model's columns have the same data types as the fields you want to sync to.
Prior to syncing, define your document type's schema in your Sanity project. To write to Sanity documents, map your source fields to your defined custom document schema fields.
Update mode and Upsert mode
Hightouch leverages Sanity's patch mutation API to support both Update and Upsert modes. The integration currently uses the set
operation, which replaces the values of the fields mapped in your configuration.
We recommend maintaining a clear separation between fields managed by Hightouch and those edited manually in Sanity. Any field mapped to Hightouch will be overwritten during updates and upserts. To preserve human-managed content, exclude those fields from your Hightouch mappings.
Tips and troubleshooting
Common errors
To date, our customers haven't experienced any errors while using this destination. If you run into any issues, please don't hesitate to . We're here to help.
Live debugger
Hightouch provides complete visibility into the API calls made during each of your sync runs. We recommend reading our article on debugging tips and tricks to learn more.
Sync alerts
Hightouch can alert you of sync issues via Slack, PagerDuty, SMS, or email. For details, please visit our article on alerting.