Socket
Socket
Sign inDemoInstall

@gearbox-built/sanity-multi-reference

Package Overview
Dependencies
2
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @gearbox-built/sanity-multi-reference

A sortable array of reference


Version published
Weekly downloads
33
decreased by-10.81%
Maintainers
4
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 25 Apr 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc