
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@kaliber/sanity-plugin-preview
Advanced tools
Adds (p)review document actions to Sanity.
> cd admin
> yarn add @kaliber/sanity-plugin-preview
admin/sanity.json
{
"plugins": [
"@kaliber/sanity-plugin-preview",
...
],
...
}
This plugin expects your project to:
/${documentPath}?preview=${previewSecret} route at the front office using @kaliber/sanity-preview.part:@kaliber/resolve-production-url part at the back office.part:@sanity/base/document-actions/resolver part.Check kaliber-sanity-template for a concrete example.
part:@kaliber/resolve-production-url partCreate a file called resolveProductionUrl.js in your sanity folder. It should export an async function resolveProductionUrl, that returns the url to the given document tacking on the queryString given:
import qs from 'query-string'
export async function resolveProductionUrl(document, { queryString = undefined } = {}) {
// ... fetch path based on document
return [
path,
queryString && qs.stringify(queryString)
].filter(Boolean).join('?')
}
Next, add it to the parts array in your sanity.json file:
{
"implements": "part:@kaliber/resolve-production-url",
"path": "./resolveProductionUrl.js"
}
To add the actual document actions, you have to add them to the default document actions. To do this, in your sanity folder create a file called resolveDocumentActions.js and add the following:
import defaultResolve from 'part:@sanity/base/document-actions'
import { DocumentActionProductionPreview, DocumentActionProductionReview } from '@kaliber/sanity-plugin-preview'
export default function resolveDocumentActions(props) {
return [...defaultResolve(props), DocumentActionProductionPreview, DocumentActionProductionReview]
}
Then add the part:@sanity/base/document-actions/resolver part to the parts array in sanity.json:
{
"implements": "part:@sanity/base/document-actions/resolver",
"path": "./resolveDocumentActions.js"
}
> yarn
> yarn link
> yarn watch
project/admin/> yarn link @kaliber/sanity-plugin-preview
yarn publish
git push
git push --tags

This library is intended for internal use, we provide no support, use at your own risk.
FAQs
Adds a (p)review document action to Sanity
We found that @kaliber/sanity-plugin-preview demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.