Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sanity-plugin-media

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sanity-plugin-media

Alternative media management for [Sanity](https://www.sanity.io/).

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39K
decreased by-6.85%
Maintainers
1
Weekly downloads
 
Created
Source

Sanity Media

Alternative media management for Sanity.

⚠ This plugin is currently in alpha. Use at your own risk! ⚠

example

Background

This plugin provides a dedicated media browser for managing images within Sanity.

Out of the box, it provides a link in the menu where you can view all dataset images from anywhere within your studio.

It can also be used as a custom asset source for image fields.

Features

  • Easily access media from the menu
  • View file metadata
  • Select and delete multiple assets
  • Grid / table views
  • Display currently selected assets
  • Basic filename / date sorting
  • Display unused assets
  • Integration with Sanity's snackbar notifications

When sanity-plugin-media is accessed via a custom asset source, you'll have the option to insert assets as well as view the currently selected image for that field.

Install

In your Sanity project folder:

sanity install media

This will add the Media button to your studio menu. If this is all you're after – that's all you need to do!

Enabling it as a global custom asset source

This plugin exposes part:sanity-plugin-media/asset-source as a part you can import when defining custom asset sources.

In sanity.json, add the following snippet the parts array:

{
  "implements": "part:@sanity/form-builder/input/image/asset-sources",
  "path": "./parts/assetSources.js"
}

./parts/assetSources.js:

import MediaAssetSource from 'part:sanity-plugin-media/asset-source'

export default [MediaAssetSource]

Now clicking 'select' on every image field will invoke sanity-plugin-media.

Read more about Sanity's custom asset sources.

Good to know

  • Batch deleting assets invokes multiple API requests - this is because Sanity's transactions are atomic. In other words, deleting 10 selected assets will use 10 API requests.

Known issues

  • GROQ queries for total sanity.imageAssets count is really, really slow.

Roadmap

  • Filter images by the current document
  • More keyboard shortcuts
  • Delete confirmation dialog
  • Display current document info
  • Image uploads
  • Multiple selection / insertion
  • More detailed metadata views
  • Folder management

Contributing

Contributions, issues and feature requests are welcome!

Keywords

FAQs

Package last updated on 21 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc