Publish Once, Post Everywhere
Write once in Studio. Post everywhere. No copy-paste, no platform hopping.
Go to Publish Once, Post EverywhereAutomate 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.
Go to Publish Once, Post EverywhereAutomatically format code blocks using Prettier to enforce consistency across all documents.
Go to Format code blocks with PrettierAI-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 postsAutomatically track when content was first published with a timestamp that sets once and never overwrites, providing reliable publication history for analytics and editorial workflows.
Go to First Published Timestamp FunctionAutomatically update your Algolia index
Go to Algolia Sync FunctionCreate, preview, and send Klaviyo campaigns without ever leaving Sanity Studio"
Go to Klaviyo campaigns without leaving your StudioA Sanity function that tracks slug changes and creates redirects automatically.
Go to Auto-generating Redirects on Slugs ChangeStop manually linking products. Let this function map relationships for you
Go to Automatic product relationship mappingSurface product age to help editors choose the freshest inventory
Go to Keep Authors Aware of Product FreshnessAutomatically analyze and categorize the emotional tone of user comments
Go to Sentiment AnalysisOn document publish, send a Slack notification so your team is informed
Go to Notify your team via Slack on publishAI-Powered Content Summary from Long Form Content
Go to Auto Summary FunctionGet instant Telegram notifications when new comments are posted, with direct links to your Sanity Studio.
Go to Telegram alerts for new commentsAI-Powered Tone Analysis for Consistent Brand Voice
Go to Capture Tone of Voice FunctionGenerate content changes for a piece of content
Go to Brand Voice Validator FunctionInform your the Bluesky crowd when you publish a post
Go to Post to BlueskySpread the word on Mastodon when publishing a blog post
Go to Post to MastodonPopulate your list options in a string schema using an external API
Go to Asynchronous List Options ComponentUse the renderDefault function to easily control your available array options.
Go to Filter Array Options Based on the Current User RoleThis is a quick tip on how to truncate a Sanity block field to create an excerpt using GROQ.
Go to Using GROQ to create an excerpt for a Sanity blockOrder by last name
Go to Use GROQ to order by last name in where name is stored as full nameSimple custom validation that force array length according to another field.
Go to Custom validation on array lengthUses @sanity/asset-utils to validate an uploaded image by its ID
Go to Schema validation rules to enforce image size or file typePrevent references to large files to reduce the chances of high bandwidth usage
Go to Schema validation rules to enforce maximum file sizeSuppose you have an Array Reference to Category and you want to get all posts with one of the categories listed in the current post. This is usually when you need to get related items.
Go to Get related items of a post in sanity by comparing category array reference with another arrayA short snippet to filter category, tags or other document based on total referenced count.
Go to Sanity GROQ Filter category by highest reference count in other documentsSometimes you want to validate items in an array, here is how
Go to Validation of Array ItemsManage Meta tags, openGraph, and locale Data for your site within Sanity Studio
Go to Website Meta DocumentAfter the approval (switch to true), the date of this operation is stored in a hidden field.
Go to Custom Input Component: Save the date of document approvalSnippet for `internalLInk` Reference in GROQ and rendering it in React/Next.js frontend using Portabletext.
Go to Sanity internalLink render in React with Portable TextFetch content from the base locale regardless of whether the current document is the base or translation document
Go to Query for slugs for all available locales of this documentUsing webhooks and the Sanity API, you can merge content changes and user information
Go to Getting user information with webhooksWe can turn off validation for fields using the same logic we use to hide them
Go to Optional validation for hidden fieldsCustom input component with a DIY webhook for connecting to APIs beyond publish, update, and delete events.
Go to Custom Input Component with WebhookInternal/External link based on the conditional field example with Next.js component starters
Go to Internal/External Next.js Link