Sanity Library Reference Docs
    Preparing search index...

    Interface BlueprintDocumentFunctionResourceEvent

    Event configuration for document functions

    interface BlueprintDocumentFunctionResourceEvent {
        filter?: string;
        includeAllVersions?: boolean;
        includeDrafts?: boolean;
        on?: [
            BlueprintFunctionResourceEventName,
            ...BlueprintFunctionResourceEventName[],
        ];
        projection?: `{${string}}`;
        resource?: BlueprintFunctionResourceEventResourceDataset;
    }

    Hierarchy (View Summary)

    Index

    Properties

    filter?: string

    GROQ filter expression to match specific documents (e.g., "_type == 'post'")

    includeAllVersions?: boolean

    Include all versions of documents, not just the current version

    includeDrafts?: boolean

    Include draft documents in addition to published documents

    Event types that trigger the function

    ['publish']
    
    projection?: `{${string}}`

    GROQ projection to specify which fields to include (e.g., "{_id, title, slug}")

    Optional dataset resource scoping for the function