Varn Docs Add Varn free

Metafields reference

Exactly what Varn stores, where, and how to read it from your own Liquid.

All of Varn's configuration lives in Shopify metafields in the plain varn namespace, on your shop and on individual products. Nothing about your catalogue is stored on our servers.

The namespace is plain, not app-reserved, on purpose: app-reserved metafields do not reliably resolve inside theme app extension Liquid, and a plain namespace survives uninstall and reinstall so your setup comes back intact.

Product metafields#

KeyTypeContains
varn.assignmentsJSONWhat each option value looks like for this product.
varn.value_orderJSONThe position map that keeps assignments correct in translated storefronts.

varn.assignments#

A map of lower-cased option value to its appearance.

json
{
  "sand": {
    "mode": "color",
    "color": "#d8c9b0"
  },
  "leopard": {
    "mode": "image",
    "image": "https://cdn.shopify.com/s/files/.../leopard.jpg",
    "media": ["30412345678901", "30412345678902"]
  },
  "black and white": {
    "mode": "dual",
    "color": "#1a1a1a",
    "color2": "#ffffff"
  }
}
FieldMeaning
modecolor, dual, gradient or image
colorPrimary color
color2Second color, for dual and gradient
imageCDN URL of an uploaded swatch photo
mediaOrdered product media IDs for this value, first is the cover

Only values you deliberately configured appear. An auto-seeded default is never written.

Shop metafields#

KeyTypeContains
varn.styleJSONYour whole Style studio configuration.
varn.metaJSONInstall date, plan tier, trial end, free photo allowance, setup state, analytics endpoint.
varn.groupsJSONProduct groups with their members.
varn.historyJSONRolling config snapshots for backups.
varn.orderJSONClick-derived swatch order scores, for self-optimizing order.
varn.colorsJSONColor index for "More in this color".

Reading them in your own Liquid#

They are ordinary metafields, so your theme can read them.

liquid
{% assign varn = product.metafields.varn.assignments.value %}
{% if varn %}
  {% for entry in varn %}
    {{ entry[0] }} is {{ entry[1].mode }} {{ entry[1].color }}
  {% endfor %}
{% endif %}

The style record, for a store-wide setting:

liquid
{% assign style = shop.metafields.varn.style.value %}
{{ style.shape }} {{ style.size }}

Robustness#

Every read runs through a defensive normaliser. A record with unknown keys, missing fields or malformed values degrades to sensible defaults rather than breaking your page.

This is also how removed features stay safe. When a setting is retired, old records still carrying it are simply ignored, because normalisers rebuild from known keys only.

Uninstall and reinstall#

Metafields survive uninstall. Reinstalling restores your entire configuration: assignments, style, groups and trial state.

That is deliberate, and it is also why the trial cannot be reset by reinstalling.

Deleting everything#

To remove Varn's data completely, uninstall the app and then delete the varn namespace metafields using Shopify's bulk editor or the Admin API. Shopify does not remove app metafields automatically, because they are yours.