Sanity Library Reference Docs
    Preparing search index...

    Interface FavoriteDocumentContext

    Uniquely identifies a specific document within a Sanity dataset and project. Includes projectId, dataset, documentType, and the required documentId. Commonly used by document-related hooks and components to reference a document without fetching its full content initially.

    interface FavoriteDocumentContext {
        dataset?: string;
        documentId: string;
        documentType: string;
        liveEdit?: boolean;
        perspective?: ReleasePerspective | ClientPerspective;
        projectId?: string;
        resource?: DocumentResource;
        resourceId: string;
        resourceType: "studio" | "canvas" | "media-library";
        schemaName?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    dataset?: string
    documentId: string
    documentType: string
    liveEdit?: boolean

    Indicates whether this document uses liveEdit mode. When true, the document does not use the draft/published model and edits are applied directly to the document.

    projectId?: string
    resource?: DocumentResource

    Explicit resource to use. On an individual operation this overrides any default; on a SanityConfig it becomes the instance's default resource. Unlike projectId/dataset, this can also be a media library or canvas resource.

    resourceId: string
    resourceType: "studio" | "canvas" | "media-library"
    schemaName?: string