TanqoryDocs

App embeds

Add a script from your server to every page of a store's theme, switched on by the merchant in the theme editor, for floating or sitewide UI such as a chat button or a pixel.

An app embed is a script tag Tanqory adds to every page of a theme, once the merchant switches it on for that theme. The script lives on your server. Use an embed for what has no place inside the page: a chat button, a banner fixed to an edge of the screen, a cookie notice, an analytics or pixel script.

UI that belongs in the page, such as a form under a product, is an app block, not an embed: review refuses an embed that finds a spot in the theme's markup. Theme app extensions has the rules.

Declare it

In the partner dashboard open the app, then Extensions, Add app embed:

FieldWhat to enter
NameWhat the merchant sees in the theme editor, at most 100 characters
Handle1 to 64 lower-case letters, digits or hyphens; unique in the app. The merchant's on and off follow it across versions, so keep it.
Script URLAn https address of at most 2048 characters, with no user name or password
WhereIn the page head (head) or End of the page (body-end)
How the script loadsasync (the default), defer or sync
Integrity hashRequired: the script's Subresource Integrity hash, sha384- (recommended), sha256- or sha512-. See Pin the script.

Or keep it in tanqory.extensions.json and send it with the command line, with your app blocks if you have any:

JSON
{
  "app": "<your app id>",
  "themeAppEmbeds": [
    { "handle": "chat", "name": "Chat button", "src": "https://chat.example.com/widget.3.js", "placement": "body-end", "loading": "defer", "integrity": "sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC" }
  ]
}
Shell
tanqory-partner app extensions check
tanqory-partner app extensions push

Through the Partner GraphQL API it is partnerAppUpdate(id, input: { themeAppEmbeds: [...] }) with the same fields (handle, name, src, placement, loading, integrity). The list replaces the app's embeds; [] removes them all.

Pin the script

Every app embed carries the Subresource Integrity hash of its script. The app review reads the script at that hash, and the shopper's browser runs it only if its bytes still match: a script that could change after review is not accepted, and saving an embed without a hash is refused with "Pin this embed script with its Subresource Integrity hash". Work it out from the file you serve:

Shell
echo "sha384-$(curl -s https://chat.example.com/widget.3.js | openssl dgst -sha384 -binary | openssl base64 -A)"

A new script is a new file at a new address with its new hash, in a new app version, which is reviewed again. Keep serving each address you released with the same bytes: a store keeps using the version it has until the new one is approved, and a changed file under a pinned hash stops running.

What the page gets

On each page of a theme that has the embed switched on, Tanqory adds:

HTML
<script src="https://chat.example.com/widget.3.js" defer integrity="sha384-..." crossorigin="anonymous" nonce="..." data-tq-app-embed="..."></script>

in the head or before the end of the body, as you chose. Because of integrity and crossorigin="anonymous", your server must answer the script with Access-Control-Allow-Origin (for example *), or the browser refuses it.

Your script runs on the store's address, under the store's security policy:

  • Add your own elements to document.body. Do not look up or change the theme's elements, and never write into the theme's forms.
  • Styles: load a stylesheet with a <link rel="stylesheet"> through the app proxy, which is on the store's own address. A stylesheet from another address, a <style> element and a style="" attribute are refused.
  • Calls to your server go through the app proxy (/apps/<subpath>/... on the store's address). Calls to other addresses are refused.
  • One address per script version, as in Pin the script.

How the merchant switches it on

  1. In the store dashboard, Online Store, Themes, Customize on a theme.
  2. More actions, App embeds (or the Theme view, App embeds) lists each embed of each installed app, with a switch.
  3. Every embed starts off. The merchant's switch is saved at once, for that theme only.

On the live theme it reaches shoppers within a minute. The theme editor's preview does not run embeds; open the store itself to see one. A draft theme made by duplicating another keeps its switches. When the app is uninstalled the switches are removed, and a reinstall starts with every embed off.

Limits

Embeds per app10
Embeds switched on in a store's live theme, all apps50
Script URL2048 characters

Built from commit c0b3fb3fdef7 · API version 2026-10