@makerinc/react-sdk
    Preparing search index...

    Type Alias Metadata

    Metadata:
        | { type: "SingleLineTextField"; value: string }
        | { type: "MultiLineTextField"; value: string }
        | { type: "DecimalField"; value: number }
        | { type: "IntegerField"; value: number }
        | { type: "Dimension"; value: PhysicalQuantity }
        | { type: "Date"; value: string }
        | { type: "DateTime"; value: string }
        | { type: "Color"; value: string }
        | { type: "Boolean"; value: boolean }
        | { type: "Json"; value: unknown }
        | { type: "Money"; value: Money }
        | { type: "Volume"; value: PhysicalQuantity }
        | { type: "Weight"; value: PhysicalQuantity }
        | { type: "Url"; value: string }
        | { type: "Rating"; value: Rating }
        | { type: "ListColor"; value: string[] }
        | { type: "ListDimension"; value: PhysicalQuantity[] }
        | { type: "ListSingleLineTextField"; value: string[] }
        | { type: "ListUrl"; value: string[] }
        | { type: "ListVolume"; value: PhysicalQuantity[] }
        | { type: "ListWeight"; value: PhysicalQuantity[] }
        | { type: "ListNumberDecimal"; value: number[] }
        | { type: "ListNumberInteger"; value: number[] }
        | { type: "Unsupported"; value: null }

    Product and variant metadata field types with strongly-typed values Server type: Store.Metadata.t

    Idiomatic TypeScript discriminated union. Use .type to narrow and .value to access payload.

    const field = variant.metadata["gfeed::color"];
    if (field && field.type === "SingleLineTextField") {
    const color: string = field.value; // Properly typed as string
    }