New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gearbox-built/sanity-multi-reference

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gearbox-built/sanity-multi-reference

A sortable array of reference

0.1.0
latest
Source
npm
Version published
Weekly downloads
71
-11.25%
Maintainers
4
Weekly downloads
 
Created
Source

@gearbox-built/sanity-multi-reference

This is a Sanity Studio v3 plugin.

Installation

npm install @gearbox-built/sanity-multi-reference

or

yarn add @gearbox-built/sanity-multi-reference

Usage

Add it as a plugin in sanity.config.ts (or .js):

import {defineConfig} from 'sanity'
import MultiReferencePlugin from '@gearbox-built/sanity-multi-reference'

export default defineConfig({
  //...
  plugins: [
    MultiReferencePlugin({
      apiVersion: import.meta.env.SANITY_STUDIO_API_VERSION, // Defaults to 2021-10-21
    }),
  ],
})

Schema

import {defineField} from 'sanity'


defineField({
  type: 'multiReference',
  name: 'multiReference',
  title: 'Multi Reference',
  options: {
    types: 'movie',
  },
}),

## Args

#### types

Accepts a single string or array of strings. This is the type of document you wish to reference.
eg:

options: { types: ['movie', 'castMember', 'post'], },


## License

[MIT](LICENSE) © Gearbox Built

## Develop & test

This plugin uses [@sanity/plugin-kit](https://github.com/sanity-io/plugin-kit)
with default configuration for build & watch scripts.

See [Testing a plugin in Sanity Studio](https://github.com/sanity-io/plugin-kit#testing-a-plugin-in-sanity-studio)
on how to run this plugin with hotreload in the studio.

Keywords

sanity

FAQs

Package last updated on 25 Apr 2023

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