Media Library Introduction
Learn about Media Library, how to incorporate it into your workflow, and how to get started.
Media Library is a Sanity app for managing your organization's assets.
Media Library allows you to:
- Centrally store assets for use across multiple applications and datasets.
- Create custom groupings, called aspects, to make managing assets easier.
Requirements
- Dashboard
- Studio v3.82.0 or later is required to incorporate Media Library assets in the Studio.
- API v2024-06-24 or later is required for any Media Library API requests.
Core Concepts
The Media Library introduces a few new concepts in addition to the image and asset workflows in the rest of the Sanity ecosystem.
Assets
An asset is a digital file that your apps and Studio can use, like an image, video, or document.
Common examples include product photos, marketing videos, and downloadable PDFs. For now, all non-image assets are considered file
types. We may provide additional support for audio and video-specific formats in the future. For now, Media Library treats these like other files.
Outside of Media Library, these assets live alongside your dataset. In Media Library, they live in a special dataset your organization shares.
Your Sanity project still supplies the assets to your applications
With Media Library, you can treat it as the source of truth for your assets, but your project is still the access point for rendering images and creating download links. All requests for Media Library assets should go through your project datasets.
Enable library access in your studios, then continue presenting images as if they were coming straight from the same dataset as the rest of your content. This could be by passing asset
into a URL builder, or expanding the asset reference with asset -> {...}
and building the URL yourself.
The library
The library is the interface that your content teams use to manage assets. Users can upload, search, manage, and assign aspects to assets.
Aspects
Aspects are schema-style fields that apply to assets. They include additional, identifying information that helps asset managers search and organize assets. Some examples are usage licenses, references to products in your organization, and copyright details. This extra level of information is specific to the Media Library. For local metadata, you should create schemas in your Studio projects.
Developers define aspects that users can then apply to an asset. Depending on your plan, there are limits to the number of aspects each asset can have.
Collections
This is a paid feature
This feature is available as an addon for the Enterprise plan
Collections allow teams to group assets for better organization and sharing.
Global document references
Media Library assets exist outside your projects and datasets, so you need a way to connect them. Global document references are a new reference type that allows you to target a reference in a different resource. Resources are currently limited to datasets and media libraries, and at this time you can only reference dataset documents from Media Library aspects. See the common aspect patterns guide for details on referencing documents from within aspects.
Limitations
- Media Library is only available within Dashboard.
- For additional usage limits, see the limits and usage document.
Was this page helpful?