Socket
Socket
Sign inDemoInstall

@sanity/vision

Package Overview
Dependencies
Maintainers
35
Versions
1327
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/vision

Sanity plugin for running/debugging GROQ-queries against Sanity datasets


Version published
Maintainers
35
Created
Source

sanity-vision

Vision is a plugin for Sanity Studio for testing GROQ queries. It features:

  • GROQ syntax highlighting so that the query is easier to read.
  • Parsed response that's more convenient to navigate and explore.
  • Switch between datasets
  • Listening for real-time updates

Screenshot

Installation

npm install --save-exact @sanity/vision@dev-preview

Configuring

// `sanity.config.ts` / `sanity.config.js`:
import {defineConfig} from 'sanity'
import {visionTool} from '@sanity/vision'

export default defineConfig({
  // ...
  plugins: [
    visionTool({
      // Note: These are both optional
      defaultApiVersion: 'v2021-10-21',
      defaultDataset: 'some-dataset',
    }),
  ],
})

Only enabling it for development

If you only want the tool available in development (eg not in deployed studios), you can import and use the isDev constant from the sanity package:

// `sanity.config.ts` / `sanity.config.js`:
import {defineConfig, isDev} from 'sanity'
import {visionTool} from '@sanity/vision'

const devOnlyPlugins = [visionTool()]

export default defineConfig({
  // ...
  plugins: [
    // ... your other plugins here ...
    ...(isDev ? devOnlyPlugins : []),
  ],
})

License

MIT-licensed. See LICENSE.

Keywords

FAQs

Package last updated on 03 Jan 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

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