Sanity Library Reference Docs
    Preparing search index...

    Interface Source

    Represents a source.

    interface Source {
        authenticated: boolean;
        currentUser: CurrentUser;
        dataset: string;
        getClient: (clientOptions: SourceClientOptions) => SanityClient;
        mediaLibrary?: MediaLibraryConfig;
        name: string;
        onUncaughtError?: (error: Error, errorInfo: ErrorInfo) => void;
        projectId: string;
        releases?: { enabled?: boolean; limit?: number };
        schema: Schema;
        search: {
            enableLegacySearch?: boolean;
            filters: SearchFilterDefinition[];
            operators: SearchOperatorDefinition<any>[];
            strategy?: "groqLegacy" | "groq2024";
            unstable_partialIndexing?: { enabled: boolean };
        };
        tasks?: { enabled: boolean };
        templates: Template<any, any>[];
        title: string;
        tools: Tool<any>[];
        type: "source";
    }

    Hierarchy (View Summary)

    Index

    Properties

    authenticated: boolean

    Whether the user is authenticated.

    currentUser: CurrentUser

    The current user of the source.

    dataset: string

    The name of the dataset.

    getClient: (clientOptions: SourceClientOptions) => SanityClient

    Returns a client instance.

    Type declaration

    mediaLibrary?: MediaLibraryConfig

    Config for the Sanity Media Library asset source integration.

    name: string

    The name of the source.

    onUncaughtError?: (error: Error, errorInfo: ErrorInfo) => void

    Configuration for error handling.

    projectId: string

    The ID of the project.

    releases?: { enabled?: boolean; limit?: number }

    Type declaration

    • Optionalenabled?: boolean
    • Optionallimit?: number

      Limit the number of releases that can be created by this workspace.

    schema: Schema

    The schema of the source.

    search: {
        enableLegacySearch?: boolean;
        filters: SearchFilterDefinition[];
        operators: SearchOperatorDefinition<any>[];
        strategy?: "groqLegacy" | "groq2024";
        unstable_partialIndexing?: { enabled: boolean };
    }
    tasks?: { enabled: boolean }
    templates: Template<any, any>[]

    The templates of the source.

    title: string

    The title of the source.

    tools: Tool<any>[]

    The tools of the source.

    type: "source"

    The type of the source.