Introducing: Pluggable asset sources for Sanity Studio!

Written by Even Westvang

A couple of months ago Robin Pyon got in touch. Robin uses Sanity to publish Love Magazine for Condé Nast in London and he wanted us to create a few extension points so he could replace our rather minimal asset selector with something that better fits the needs of the authors he works with.

When we designed Sanity this was exactly the situation we hoped for – keep defaults simple, but allow people with more complex use cases extend the UI as they saw fit.

So today we’re releasing asset sources. Asset sources allow you to:

On the back of this new extensible image selector, we’re also announcing a small spread of asset source plugins!

The Unsplash asset source

Unsplash is everyone’s favorite source for free and exactingly color corrected photos, and it is now very much available from right inside Sanity Studio. The selector lets you search and insert photos directly from Unsplash’ rich selection of photos, and store the photo credits on the asset documents, so you can use them in your frontend.

PortableText [components.type] is missing "muxVideo"

Go to the plugin and follow the installation instructions.

The Cloudinary asset source plugin

Already using Cloudinary and would like to access your media there within your Sanity Studio? This plugin opens up Cloudinary, lets you select an image and then uploads it to the Sanity API so you can use it with our tooling and image transformation pipeline.

PortableText [components.type] is missing "muxVideo"

Go to the plugin and follow the installation instructions.

Build your own!

The whole point of releasing extension points is to make it possible for you to build your own asset source selector for whatever you need to integrate with. Check out our documentation, and the source code for the aforementioned plugins for some inspiration. In many cases, you can repurpose exciting libraries and hook into their selection handlers to get the asset.

We thought it would be fun to celebrate this feature with a small competition. On December 9nd, 2019, we’ll give some premium swag to the most useful and most interesting asset source plugins:

At us on Twitter (@sanity_io) with your submissions on December 8th the latest.