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.
.type
.value
const field = variant.metadata["gfeed::color"];if (field && field.type === "SingleLineTextField") { const color: string = field.value; // Properly typed as string} Copy
const field = variant.metadata["gfeed::color"];if (field && field.type === "SingleLineTextField") { const color: string = field.value; // Properly typed as string}
Product and variant metadata field types with strongly-typed values Server type: Store.Metadata.t
Idiomatic TypeScript discriminated union. Use
.typeto narrow and.valueto access payload.