Use an asynchronous list item in the structure builder to display a random document
Drop this into your Studio to let editors know when there's a more recent version of your Studio available, making sure they have the latest fields and validations.
Schemas for creating an event directory on Sanity
GROQ query that finds duplicate data in a given field.
A query to pull the rich color data associated with an image from the Sanity Asset Pipeline
How to add different types of “breaks” for Portable Text that can be translated to horizontal rules, “read more”, sections, chapters, and so on.
Choose a file from a searchable select
Add lists of image assets based on information in the asset document using the Structure Builder API
Get details of the currently logged in Sanity user
Migration script to normalize Portable Text blocks across your whole dataset
This migration scripts lets you migrate documents to a new type.
Use data for the current logged in user as initial values in a new document
Do something with a uploaded file and populate a field in the document based on that
Show different document lists based on a user's role
How to group documents by their publishedAt year using the Structure Builder API
Find new connections in a dataset by filtering a second time on dereferenced data
Script to find and delete unused assets in a dataset
Automate your content workflows with functions that trigger on document events. From AI-powered automatic tagging and content enrichment to translation and optimization, these pre-built functions save time and improve content quality across your Sanity projects.
Write once in Studio. Post everywhere. No copy-paste, no platform hopping.
Automatically format code blocks using Prettier to enforce consistency across all documents.
Automatically generate accessible, multilingual alt text for images in your Sanity Media Library using Agent Actions and Sanity Functions
AI-powered automatic tagging for Sanity blog posts that analyzes content to generate 3 relevant tags, maintaining consistency by reusing existing tags from your content library.
Automatically track when content was first published with a timestamp that sets once and never overwrites, providing reliable publication history for analytics and editorial workflows.
Automatically update your Algolia index
Create, preview, and send Klaviyo campaigns without ever leaving Sanity Studio"
A Sanity function that tracks slug changes and creates redirects automatically.
Stop manually linking products. Let this function map relationships for you
Surface product age to help editors choose the freshest inventory
Automatically analyze and categorize the emotional tone of user comments
On document publish, send a Slack notification so your team is informed
AI-Powered Content Summary from Long Form Content
Get instant Telegram notifications when new comments are posted, with direct links to your Sanity Studio.
AI-Powered Tone Analysis for Consistent Brand Voice
Generate content changes for a piece of content
Inform your the Bluesky crowd when you publish a post
Spread the word on Mastodon when publishing a blog post