@booga/bsanity
v0.1.0
Published
Sanity v3 plugin embedding the b-suite discipline runtime into the Studio authoring UI.
Downloads
111
Readme
@booga/bsanity
Sanity v3 plugin embedding the b-suite discipline runtime into the Studio authoring UI.
Install
pnpm add @booga/bsanity sanity react react-domStudio usage
// sanity.config.ts
import { defineConfig } from 'sanity'
import { bSanity } from '@booga/bsanity'
export default defineConfig({
name: 'default',
title: 'Studio',
projectId: 'project-id',
dataset: 'production',
plugins: [
bSanity({
documentTypes: ['article'],
binaries: { bground: true, banchor: true, bsmell: true },
proxyEndpoint: 'https://example.com/b-sanity-binary-proxy',
cycleToken: process.env.SANITY_STUDIO_BSANITY_CYCLE_TOKEN
})
],
schema: { types: [] }
})Function deployment
Current Sanity Function projects use a blueprint file for deployment resources.
// sanity.blueprint.ts
import { defineBlueprint, defineDocumentFunction } from '@sanity/blueprints'
export default defineBlueprint({
resources: [
defineDocumentFunction({
name: 'b-sanity-binary-proxy',
src: './functions/b-sanity-binary-proxy.ts',
event: { on: ['publish'] }
})
]
})The exported proxy handler also works in another Node HTTP runtime when the request body matches this shape:
{
"documentJson": "{\"_type\":\"article\"}",
"cycleId": "01J00000000000000000000000",
"enabledBinaries": ["bground", "banchor"]
}License
MIT
