Sanity Library Reference Docs
    Preparing search index...

    Function defineMediaLibraryConfig

    • Beta

      Defines a singleton Media Library configuration.

      Configuring the Media Library via Blueprints is experimental. This may be subject to breaking changes.

      Parameters

      • config: BlueprintMediaLibraryConfigConfig

        The Media Library configuration

        Configuration for a singleton Media Library configuration resource.

        • fields: BlueprintMediaLibraryField[]

          The custom fields the Media Library config exposes.

        • OptionalmfManifest?: Record<string, unknown>

          Module federation manifest

        • name: string

          The name of the resource. Unique within the blueprint. e.g. 'sync-webhook'

        • root: string

          The config build directory, relative to the blueprint file. Contains the config's package.json; every field src is resolved relative to it.

        • Optionalversion?: string

          The local version of sanity at deployment. Populated during deployment.

      Returns BlueprintMediaLibraryConfigResource

      The Media Library configuration resource

      The Media Library is a Sanity-owned singleton, so this resource carries no application identity of its own — only the config root and its fields. The provider resolves the organization's media library installation id at deploy time.

      defineMediaLibraryConfig({
      name: 'media-library',
      root: './media-library',
      fields: [{name: 'brand', title: 'Brand', src: './src/fields/brand.tsx'}],
      })