Select Template Grid feature

I’m implementing a Select Template Grid feature.
When creating a Product Offer Rule, six different grid options will be displayed. The merchant selects one grid, and that selected grid should appear on the Product Page where our app embed block is used.

Now, my question is about how to handle the Grid Setting Configuration:

Option 1: Save settings inside the Theme Extension Schema

{% schema %}
{
“name”: “Conditional App block”,
“target”: “section”,
“stylesheet”: “app.css”,
“javascript”: “app.js”,
“available_if”: “{{ app.metafields.conditional.block1 }}”,
“settings”: [
{
“label”: “Colour”,
“id”: “colour”,
“type”: “color”,
“default”: “#000000”
}
]
}
{% endschema %}

In this approach, configuration is stored within the theme schema of the extension.

Option 2: Save settings inside App Metafields (Application Data)

mutation CreateAppDataMetafield($metafieldsSetInput: [MetafieldsSetInput!]!) {
metafieldsSet(metafields: $metafieldsSetInput) {
metafields {
id
namespace
key
}
userErrors {
field
message
}
}
}

{
“metafieldsSetInput”: [
{
“namespace”: “secret_keys”,
“key”: “api_key”,
“type”: “single_line_text_field”,
“value”: “aS1hbS1hLXNlY3JldC1hcGkta2V5Cg==”,
“ownerId”: “gid://shopify/AppInstallation/3”
}
]
}

In this approach, we store configuration values (like grid selection) in App Installation Metafields using a custom namespace and key.


My Question

Since we’re planning to develop a new Shopify app, which is the best approach to save app configuration?

  1. Theme Schema (Theme Extension)

  2. Application Data (App Metafields)

Or should we use App Metafields with namespace and key for configuration instead of the theme schema?

Hey @Shrutika_Lokhande :waving_hand: , thanks for reaching out!

Using a hybrid approach might be the best option here if you wanted to look at that route. For example, you can put global and logic-driven configuration data in your App Installation metafields (app-data under the reserved $app namespace), and keep presentational, per-placement tweaks in the theme app extension schema settings.

App‑data metafields are app‑owned and persist across theme changes, so they might be useful for more permanent data and you can use them in combination with the available_if schema object for gating if needed.

Theme schema settings are per block instance and mainly ideal for visuals/visual controls. For example, if the grid selection varies per product or rule, store it per product using $app product metafields (or a metaobject) and render with an app block on product templates to keep data portable and avoid duplicated configuration. Then, for conditional visibility, you could set a boolean app‑data metafield (for example, $app.grid_enabled) and reference it in available_if on your block schema.

Hope this helps/makes sense, let me know if I can clarify anything on my end here, happy to help!

Hey @Shrutika_Lokhande, reaching out to see if the above helped, let me know if I can assist further!