Sanity Library Reference Docs
    Preparing search index...

    Function definePubSubFunction

    • Defines a function that provide pubsub behaviour.

      Parameters

      • functionConfig: BlueprintPubSubFunctionConfig

        The configuration for the pubsub function

        Configuration for defining an event function.

        • OptionaldisplayName?: string

          Human-readable display name for the function

        • Optionalenv?: Record<string, string>

          Environment variables provided to the function

        • Optionalmemory?: number

          Memory allocation in gigabytes

        • name: string

          The name of the resource. Unique within the blueprint. e.g. 'sync-webhook'

        • Optionalproject?: string

          The project ID of the project that contains your function.

          The project attribute must be defined if your blueprint is scoped to an organization.

        • OptionalrobotToken?: string

          Token provided during function invocation

        • Optionalruntime?: "node" | "nodejs22.x" | "nodejs24.x"

          The runtime environment for the function (currently only Node.js is supported)

          'nodejs24.x'
          
        • Optionalsrc?: string

          Path to the function source code

          functions/${name}

        • Optionaltimeout?: number

          Execution timeout in seconds

      Returns BlueprintPubSubFunctionResource

      The validated pubsub function resource

      A barebones pubsub function

      definePubSubFunction({
      name: 'send-email',
      })