Sanity Library Reference Docs
    Preparing search index...
    • Read a local blueprint and the ids of the Stack it deploys to

      Ids come from overrides, the environment, defineBlueprint, then .sanity/blueprint.config.json. Resources are not validated. No network access.

      Parameters

      Returns Promise<BlueprintInfo>

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

      const {resources, resourcesByName, stackId, sources} = await readBlueprint()
      resources.map((resource) => resource.name)
      resourcesByName['production-dataset']?.type // 'sanity.project.dataset'
      sources.stackId // 'config'

      When no blueprint file is found, it cannot be loaded, or resources is not an array