Application Blueprints reference
Field reference for defineApplication and the application view definers: window, panel, tile, asset source, and web worker.
Field reference for defineApplication and the view definers in @sanity/blueprints 0.26.0 or later. Declare views in the application's views array and web workers in its webWorkers array. For a walkthrough, see Define an application with Blueprints.
Beta
Applications as blueprint resources are in beta. Their fields can change in a future release of @sanity/blueprints.
defineApplication
Groups your app's views and web workers into one deployable resource. An application must declare at least one view, and at most one window view.
import {
defineApplication,
defineBlueprint,
defineWebWorker,
defineWindowView,
} from '@sanity/blueprints'
export default defineBlueprint({
resources: [
defineApplication({
name: 'design-retro',
title: 'Design Retro',
root: './apps/design-retro',
views: [
defineWindowView({name: 'main', title: 'Design Retro', src: './src/windows/main.tsx'}),
],
webWorkers: [
defineWebWorker({
name: 'background-refresh',
title: 'Background Worker',
src: './src/workers/background-refresh.ts',
}),
],
}),
],
})Requiredname
string
The resource name. Unique within the blueprint, and how Blueprints matches the resource between deploys. Changing it destroys the application and creates a new one.
slug
string
The application's hostname. Use lowercase letters, numbers, and hyphens, and start and end with a letter or number. Defaults to
name. Changing it destroys the application and creates a new one.Requiredtitle
string
Label shown on the Dashboard dock button.
Requiredroot
string
The application directory, relative to the blueprint file. It contains the application's
package.json, and every view and web workersrcis resolved relative to it.icon
string
Path to an SVG icon for the application.
visibility
default | unlisted | disabled
Dashboard visibility. The default is
default.views
array
The application's window, panel, tile, and asset source views, declared with the view definers. Include at least one view, and at most one window view.
webWorkers
array
Background web workers, declared with
defineWebWorker.
View definers
Declare each view in the application's views array, and each web worker in its webWorkers array. Every view definer and defineWebWorker share these fields:
Each view's src file implements the surface with the Dashboard Extension API. See the Extension API reference.
defineWindowView
The app's main, full-page view. It fills the Dashboard to the right of the dock and any open panel, and it is the surface a traditional App SDK app renders into. An application can have at most one. If you set entry in defineApplication, the CLI creates this view for you. Use dock to place it in the dock. See Customize your app's dock item for groups and ordering.
dock
object
Dock placement.
dock.groupissystem,applications, oruser, and defaults toapplications.dock.ordersorts views within the group in ascending order.
definePanelView
A view that opens beside the current app from its own dock item. See Render a panel for the panel source file.
dock
object
Dock placement.
dock.groupissystem,applications, oruser, and defaults toapplications.dock.ordersorts views within the group in ascending order.
defineTileView
A view on the Dashboard home page. See Render a tile on the homepage for the tile source file.
defineAssetSourceView
A custom asset source shown in asset pickers.
defineWebWorker
A background worker. Declare it in the application's webWorkers array, not views. See Run a background service for the worker source file.
Related
Define an application with Blueprints
Deploy an SDK app as a blueprint resource with defineApplication and its view definers.
Extension API reference
Reference for defineApplication, the view and web worker helpers, unstable_defineView, unstable_defineService, and unstable_defineMediaLibrary.
Render a panel
Render a panel surface as part of your app.
Run a background service
Run a Web Worker for your app while the Dashboard is open.