Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@sanity/vision
Advanced tools
Sanity plugin for running/debugging GROQ-queries against Sanity datasets
Vision is a plugin for Sanity Studio for testing GROQ queries. It features:
npm install --save-exact @sanity/vision
// `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',
}),
],
})
If you only want the Vision tool available in development (e.g., 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 : []),
],
})
If you only want the Vision tool available to administrators, you can use the Tool API to filter out the tool based on role:
// `sanity.config.ts` / `sanity.config.js`:
import {defineConfig} from 'sanity'
import {visionTool} from '@sanity/vision'
export default defineConfig({
// ... name, title, projectId, dataset, etc.
plugins: [
// ... your other plugins here ...
visionTool(),
],
tools: (prev, {currentUser}) => {
const isAdmin = currentUser?.roles.some((role) => role.name === 'administrator')
// If the user has the administrator role, return all tools.
// If the user does not have the administrator role, filter out the vision tool.
return isAdmin ? prev : prev.filter((tool) => tool.name !== 'vision')
},
})
MIT-licensed. See LICENSE.
FAQs
Sanity plugin for running/debugging GROQ-queries against Sanity datasets
The npm package @sanity/vision receives a total of 19,187 weekly downloads. As such, @sanity/vision popularity was classified as popular.
We found that @sanity/vision demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 64 open source maintainers collaborating on the project.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.