Sanity Library Reference Docs
    Preparing search index...

    Interface BlueprintMediaLibraryFunctionResourceEvent

    Event configuration for media library asset functions

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

    Hierarchy (View Summary)

    Index

    Properties

    filter?: string

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

    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}")

    Media library resource scoping (required for media library functions)