Recipes

Sanity Functions Recipes

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.

Automatically tag blog posts

Featured contribution
Official(made by Sanity team)

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.

Go to Automatically tag blog posts

First Published Timestamp Function

Featured contribution
Official(made by Sanity team)

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.

Knut Melvær
Go to First Published Timestamp Function

Auto Summary Function

Official(made by Sanity team)

AI-Powered Content Summary from Long Form Content

Kevin Green
Go to Auto Summary Function

Latest recipes

Podcast

Schemas for running a podcast backend on Sanity.io

Knut Melvær
Go to Podcast

Horizontal bar chart

This is a schema we've used to create accessbile bar charts, with human-readable text for each bar.

Jayne Mast
Go to Horizontal bar chart

Portable Text Validator

Generate a custom validator function for Portable Text fields using built-in routines

Corey Ward
Go to Portable Text Validator