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

@sanity/preview-url-secret

Package Overview
Dependencies
Maintainers
41
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/preview-url-secret

[![npm stat](https://img.shields.io/npm/dm/@sanity/preview-url-secret.svg?style=flat-square)](https://npm-stat.com/charts.html?package=@sanity/preview-url-secret) [![npm version](https://img.shields.io/npm/v/@sanity/preview-url-secret/pink-lizard.svg?styl

  • 0.3.0-pink-lizard
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
112K
decreased by-16.5%
Maintainers
41
Weekly downloads
 
Created
Source

@sanity/preview-url-secret

npm stat npm version gzip size size

Warning

This is an experimental package. Breaking changes may be introduced at any time. It's not production ready.

npm i --save-exact @sanity/preview-url-secret@pink-lizard @sanity/client

Usage

TODO how to verify the secret in an API handler that enables Draft Mode

Presentation Tool

@TODO move to presentation tool docs

import { presentationTool } from '@sanity/presentation'
import { definePreviewUrl } from '@sanity/preview-url-secret/presentation'
import { visionTool } from '@sanity/vision'
import { defineConfig } from 'sanity'
import { deskTool } from 'sanity/desk'

export default defineConfig({
  projectId,
  dataset,
  schema,
  plugins: [
    presentationTool({
      // The URL you usually would pass into `previewUrl`:
      // previewUrl: 'http://localhost:3000/en/home',
      // You now pass into `definePreviewUrl`, slightly modified:
      previewUrl: definePreviewUrl({
        // You first specify the shared baseUrl:
        origin: 'http://localhost:3000',
        preview: '/en/home', // Optional, it's '/' by default
        // The API route that securely puts the app in a "Draft Mode"
        // Next.js docs: https://nextjs.org/docs/app/building-your-application/configuring/draft-mode
        draftMode: {
          enable: '/api/draft',
        },
      }),
    }),
    deskTool(),
    visionTool(),
  ],
})

FAQs

Package last updated on 10 Nov 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