Sanity Library Reference Docs
    Preparing search index...

    Interface SourceOptionsBeta

    interface SourceOptions {
        __internal_tasks?: { footerAction: ReactNode };
        "[DECISION_PARAMETERS_SCHEMA]"?: DecisionParametersConfig;
        advancedVersionControl?: {
            enabled?: boolean | ComposableOption<boolean, ConfigContext>;
        };
        apiHost?: string;
        auth?: AuthConfig
        | AuthStore;
        dataset: string;
        document?: DocumentPluginOptions;
        form?: SanityFormConfig;
        i18n?: LocalePluginOptions;
        mediaLibrary?: MediaLibraryConfig;
        name: string;
        onUncaughtError?: (error: Error, errorInfo: ErrorInfo) => void;
        plugins?: PluginOptions[];
        projectId: string;
        releases?: {
            actions?: ReleaseActionComponent[] | ReleaseActionsResolver;
            enabled?: boolean;
            limit?: number;
        };
        scheduledDrafts?: { enabled: boolean };
        schema?: SchemaPluginOptions;
        search?: {
            enableLegacySearch?: boolean;
            strategy?: "groqLegacy" | "groq2024";
            unstable_partialIndexing?: { enabled: boolean };
        };
        studio?: { components?: StudioComponentsPluginOptions };
        title?: string;
        tools?: Tool<any>[] | ComposableOption<Tool<any>[], ConfigContext>;
        unstable_clientFactory?: (options: ClientConfig) => SanityClient;
    }

    Hierarchy (View Summary)

    Index

    Properties

    __internal_tasks?: { footerAction: ReactNode }
    "[DECISION_PARAMETERS_SCHEMA]"?: DecisionParametersConfig
    advancedVersionControl?: {
        enabled?: boolean | ComposableOption<boolean, ConfigContext>;
    }

    Advanced version control provides features such as inline content diffs in Studio to make resolving conflicts across document versions easier.

    Type declaration

    • Optional Betaenabled?: boolean | ComposableOption<boolean, ConfigContext>

      Control whether advanced version control functionality is enabled.

      Advanced version control provides features such as inline content diffs in Studio to make resolving conflicts across document versions easier.

    apiHost?: string

    API hostname used for requests. Generally used for custom CNAMEs, allowing businesses to use their own domain for API requests. Must include protocol: eg https://sanityapi.mycompany.com

    Note that (currently) the project ID will be prepended to the passed URL, so the above example would end up as: https://<projectId>.sanityapi.mycompany.com

    Authentication options for this source.

    dataset: string

    Dataset name for this source

    mediaLibrary?: MediaLibraryConfig

    Config for the Sanity Media Library asset source integration.

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

    Configuration for error handling.

    plugins?: PluginOptions[]
    projectId: string

    Project ID for this source

    releases?: {
        actions?: ReleaseActionComponent[] | ReleaseActionsResolver;
        enabled?: boolean;
        limit?: number;
    }

    Configuration for Content Releases

    Type declaration

    scheduledDrafts?: { enabled: boolean }

    Configuration for Scheduled drafts

    search?: {
        enableLegacySearch?: boolean;
        strategy?: "groqLegacy" | "groq2024";
        unstable_partialIndexing?: { enabled: boolean };
    }

    Type declaration

    • OptionalenableLegacySearch?: boolean

      Enables the legacy Query API search strategy.

      Use search.strategy instead.

    • Optionalstrategy?: "groqLegacy" | "groq2024"

      Control the strategy used for searching documents. This should generally only be used if you wish to try experimental search strategies.

      This option takes precedence over the deprecated search.enableLegacySearch option.

      Can be one of:

      • "groqLegacy" (default): Use client-side tokenization and schema introspection to search using the GROQ Query API.
      • "groq2024": (experimental) Perform full text searching using the GROQ Query API and its new text::matchQuery function.
    • Optionalunstable_partialIndexing?: { enabled: boolean }
    studio?: { components?: StudioComponentsPluginOptions }

    Type declaration

    title?: string
    tools?: Tool<any>[] | ComposableOption<Tool<any>[], ConfigContext>
    unstable_clientFactory?: (options: ClientConfig) => SanityClient