Document API
The document configuration API enables adding actions/badges to your studio, setting defaults for new documents, and defining a URL resolver.
Properties
The following are the most commonly-used properties. For a full list, see the type reference documentation.
actions
DocumentActionComponent[] | DocumentActionsResolver
Accepts an array of document action components, or a callback function that resolves to the same. The callback function receives the existing actions array as its first argument and a context object as its second. Read more about document actions.
badges
DocumentBadgeComponent[] | DocumentBadgesResolver
Accepts an array of document badge components, or a callback function that resolves to the same. The callback function receives the existing badges array as its first argument and a context object as its second. Read more about document badges.
productionUrl
function | AsyncComposableOption
Accepts an async callback function called with the existing value as the first argument and a context object (including the current document) as the second, resolving to the production URL string (or undefined).
If specified, an "Open preview" option appears in the document context menu of your Studio.
newDocumentOptions
function | NewDocumentOptionsResolver
Accepts a callback function that returns an array of new document options templates. The callback is called with the array of existing templates and a context object as arguments. Read more about new document options.
drafts
object
Accepts an object of options. The only available option at this time is
enabled. Defaults totrue. Settingenabledtofalsedisables draft creation for the Studio. If the dataset already contains drafts, a banner will appear on each draft document in the Studio allowing users to compare, publish, or discard the draft. For example:document: { drafts: { enabled: false } }