Sanity Library Reference Docs
    Preparing search index...
    • Read a local blueprint and its deployed Stack

      Adds each deployed resource's externalId and live values to the declared resource with the same type and name.

      Parameters

      Returns Promise<StackInfo>

      import {readStack} from '@sanity/blueprints/resolve'

      const {values, resourcesByName} = await readStack({token: process.env.SANITY_AUTH_TOKEN})
      values['production-dataset']?.['name'] // the deployed dataset's name
      resourcesByName['my-function']?.externalId

      When readBlueprint throws, the Stack id or scope is unknown, or the API responds with an error