Specifications

Blueprint configuration reference

Functions new document change events and filtering options!

v2025-08-20

We are excited to give developers more document change events to trigger their Functions! The new events are:

  • create: Emitted when a document is created.
  • delete: Emitted when a document is deleted.
  • update: Emitted when a document is updated.

Additionally, two new boolean toggles are available when defining the triggering event for your Functions:

  • includeDrafts: Whether the event should be emitted with respect to draft documents. Defaults to false.
  • includeAllVersions: Whether the event should be emitted with respect to version documents (documents part of a Content Release). Defaults to false.

Keep in mind that combining update with includeDrafts and/or includeAllVersions may result in many, rapid, invocations whenever changes are synced. See the rate limits and use with caution.

Note that these new events and options have significant overlap with the existing publish event. In fact, publish can be defined as:

  • on: ['create', 'update'], and
  • includeAllVersions: true

The publish event was an early beta attempt at encapsulating a useful, initial first-pass at a Functions source event.

These new additions set up a deprecation of the publish event, so keep an eye out for that to officially land sometime in the near future. If you want to get ahead of things, you can update any existing function events that use on: ['publish'] to instead use the on and includeAllVersions values mentioned above—or make them more specific for your needs.

Support for these new events and filters landed in the following tools under the specified versions. Upgrade to at least these versions to take advantage of the changes:

Functions `projection` breaking change

v2025-08-06

Why we're making the change

⚠️ Previously, we accepted GROQ projections in function event definitions that were not wrapped in curly braces ({}). Behind the scenes, we would transparently wrap your projection with curly braces.

📣 In order to better support the full GROQ specification, as of now, if you wish to receive an object as a projection in your function invocation, you are required to wrap your projection in curly braces.

Before

❌ Previously, you could provide the following projection that expressed "give me an object with _id and type properties":

{
  "on": ["publish"],
  "filter": "_type == 'post'",
  "projection": "_id, type"
}

Now, trying to create or update a function with the above projection will yield an error like:

Failed to manage function subscription: Failed to validate document change event rule: projection is invalid: parse error at position 3: unable to parse entire expression"

After

✅ Instead, wrap the projection with curly braces:

{
  "on": ["publish"],
  "filter": "_type == 'post'",
  "projection": "{_id, type}"
}

This explicitly says that you want an object.

Existing functions

If you have an existing function deployed to Sanity, we've migrated the deployed code to the new syntax. Your function will continue to work as it has without any intervention.

Prior to your next deployment, you will need to update any projections to use the new syntax. In short, wrap your projection in curly braces as shown above and then deploy the changes.

Faster dev server, Portable Text plugins, new Blueprints syntax, and more improvements

v3.92.0

✨ Highlights

Faster dev server

Improves cold starts on sanity dev by eliminating optimized dependencies changed. reloading cycles in vite. We now use server.warmup to ensure cold starts are much less cold and jarring. 🫡

Improved timezone UX for datetime fields

Adds the ability to control the display of datetime fields with regard to timezones. Use the new displayTimeZone field option to specify the time zone used for displaying and interacting with the timestamp in Studio. Each user may personalize the time zone they see (this can be prevented by setting the allowTimeZoneSwitch field option to false).

A Studio datetime field that displays its value in the Europe/Oslo time zone
A Studio datetime field that displays its value in the Europe/Oslo time zone

It's now possible to deprecate Portable Text blocks

Custom Portable Text block objects may now be marked as deprecated. When a block is deprecated in the schema, its corresponding toolbar button will be inactive and display a tooltip with the provided deprecated.reason.

Custom Portable Text plugins come to Studio

The Portable Text Editor's Behavior API is now compatible with Studio in a format that is familiar to creators of custom components. Create your own plugins, or add an existing one to your block content. Follow our guide for creating a new Portable Text Editor plugin to get started.

Blueprints now supports TS/JS configuration formats

When you initialize a new Blueprint with sanity blueprints init, you're now able to select TypeScript or JavaScript—in addition to JSON—for the configuration format. You can update existing blueprint configurations to this format by adding the @sanity/blueprints package and updating your configuration file.

Other features

  • Bumps version of React to 19 for studios created using sanity init or npm create sanity.
  • Clicking to edit the visual editing overlay for slugs now focuses the slug input, rather than doing nothing. It's amazing what modern technology can do. 🤯
  • When using Studio inside Dashboard, it's now possible to switch Studio workspaces again.
  • If the first document action is custom, it will now be displayed as the primary document action when viewing document versions. Previously, it was only available by opening the document actions menu.

🐛 Notable bugfixes

  • Fixes an issue that caused the history cleared event to show in between edit events.
  • Fixes an issue that caused comments created in version documents to sometimes contain the title of the draft or published version in the notification email.
  • Fixes a bug that caused React's maximum render depth to be exceeded if a custom component used lazy loading. In production builds, this was reported as minified React error #185. This caused the @sanity/color-input plugin to crash when used inside a Portable Text annotation.
  • Fixes an issue that caused comments created in arrays of objects to sometimes not be displayed.
  • Fixes an issue that caused restoration of deleted documents to restore the first revision, rather than the most recent revision prior to deletion.
  • Fixes an issue that caused users of next@canary, or react@canary, to see a getAttribute is not a function error when attempting to edit a link in a Portable Text input field. You shouldn't have to choose between being able to fully use Sanity Studio's Portable Text Editor, or fun new React versions and features, and you no longer have to!
  • Fixes incorrect filtering results in timezone modal.
  • Fixes an issue where running sanity init in unattended mode or with --create-project sometimes created a new organization.
  • Skips auto-update-prompts during sanity build and sanity deploy for non-interactive sessions.
  • Restores the Continue anyway option to sanity deploy and sanity build.
  • Sometimes a confusing Duplicate instances of context "sanity/_singletons/context/media-library" warning was logged to the console. It's confusing because it implies that the user did something wrong. This time it was us, not you. ❤

Install or upgrade Sanity Studio

To initiate a new Sanity Studio project or upgrade an existing one, please refer to our comprehensive guide on Installing and Upgrading Sanity Studio.

If you are updating from a version earlier than 3.37.0, you should also check out this article to ensure your dependencies are up to date.