Specifications

Blueprint configuration reference

Reference documentation for the Blueprint configuration files.

The Blueprints configuration file defines resources, like Functions, for deployment to Sanity's infrastructure.

Interact with Blueprints by using the npx sanity blueprints CLI command.

  • RequiredblueprintVersionstring

    Defines the version of the Blueprints specification to use when parsing the configuration.

  • Requiredresourcesarray

    An array of Sanity resources. Right now this is limited to Function resources, but will expand in the future.

Resources

The following properties are shared across all resources. Additional resource-specific properties follow in the sections below.

  • Requirednamestring

    A unique function name. Must be an alphanumeric string that can contain dashes or underscores.

  • Requiredtypestring

    A resource type. For Sanity resources, this is made up of the sanity namespace, category, subcategory, and resource types separated by single periods. For example: sanity.function.document.

  • displayNamestring
  • displayNamestring

Functions

In addition to the common resource properties, functions also contain the following resources.

  • Requiredsrcstring

    The path, relative to the blueprint configuration file, of the individual function directory. For example, functions/myFunction.

  • eventobject

    Configuration options for the triggering event. See the event properties section below for details.

  • timeoutinteger

    The max invocation time, in seconds, of the function.

    • Default: 10
    • Minimum: 1
    • Maximum: 900
  • memoryinteger

    Sets the max memory allocation, in GBs.

    • Default: 1
    • Min: 1
    • Max: 10

event properties

  • onstring

    Defines the type of event trigger. The options are:

    • publish: Activates when a document is published.

    These actions trigger on individual documents with unique _id values. For example, updating or deleting a draft of a document will not trigger an update or delete on the published document.

  • filterstring

    A valid GROQ filter. This accepts most core GROQ filter functionality found in groq-js. Delta GROQ is not supported at this time.

    Only include the contents of the filter, not any other surrounding syntax.

    ✅ Do this: _type == "article"

    ❌ Not this: [_type == "article"]

  • projectionstring

    A valid GROQ projection. Omit the outer wrapping parentheses.

    • ✅ Do this: title, _id, slug
    • ❌ Not this: { title, _id, slug }

Example

Was this page helpful?

OSZAR »