@Virtooal can you give me an example of a theme where the settings_data.json approach doesn’t work? (A free one would be great, if possible).
Topic summary
Detecting whether an app embed block is enabled in vintage Shopify themes without using ScriptTags. Initial observation: some themes (e.g., Supply) list enabled app embeds in config/settings_data.json under current.blocks, but others reportedly do not, raising reliability concerns.
Need: a dependable post-install check so merchants enable the app embed and click Save. A GraphQL-based verification was requested; no confirmed solution provided.
Proposed approaches:
- Theme editor signals: use request.design_mode and/or JavaScript events (shopify:section:load / shopify:section:unload) to ping a server when enabled/disabled, with cautions about race conditions and section removal.
- Server-side HTML scan: fetch the storefront homepage and search for the app embed’s JavaScript filename defined in app-embed.liquid schema (“javascript”: “name.js”). A TypeScript example was shared. One participant says this works on password-locked dev stores; another says it will not for password-protected shops.
- settings_data.json parsing: load config/settings_data.json, inspect current.blocks for an entry ending with /blocks/global_embed_block/{extension_uuid} and not disabled. Some argue all tested themes include app embeds here; a counterexample was requested.
Outcome: No consensus or final method. Reference docs were shared. Key open items: confirm GraphQL viability and whether any themes omit blocks in settings_data.json.