An app adds to the storefront in three ways, all declared in tringify.app.json and frozen into each release. Changing a declaration reaches a store only when it installs or updates to a release that contains it.
Extension |
What it is |
Who places it |
|---|---|---|
App block |
A Vascula block the merchant adds to a theme section, on the pages it lists. A |
The merchant, in the theme editor, in sections that accept app blocks. |
Hosted surface |
A page on your server that the storefront shows in an isolated frame, inline, as a drawer, a modal or a sticky bar. It can read and change the cart only through commands you declare. See Hosted surfaces. |
Opened by an app block, or by a popup embed when one of your campaigns triggers. |
App embed |
Vascula markup on every page, a popup that opens one of your hosted surfaces when your campaigns say so, or a tracking pixel. |
Vascula embeds and popups: the merchant, under App embeds in the theme editor, or the app for the whole store. Pixels: the merchant, in Online Store › Pixels, or the app for the whole store. |
App blocks, hosted surfaces and Vascula embeds never appear in checkout or order confirmation. Pixels are different: they run there to observe checkout events, always in an isolated frame. A sandboxed pixel uses its frame, and a page-runtime pixel the frame_url it declared for these pages; without one it is left out. No app code runs in the checkout page itself. Nothing an app adds to the storefront can stop a shopper checking out: a pixel that cannot be built is left out of the page.
App blocks#
"storefront_blocks": [
{
"key": "size-guide",
"name": "Size guide",
"description": "Opens a size finder under the product's options.",
"mode": "hosted_surface",
"pages": ["product"],
"surface_key": "size-guide",
"source": "{% schema %}\n{\"name\": \"Size guide\", \"kind\": \"block\", \"settings\": [{\"id\": \"label\", \"type\": \"text\", \"default\": \"Find your size\"}]}\n{% endschema %}\n<p class=\"tf-ab-small tf-ab-muted\">{{ settings.label }}</p>"
}
]
Field |
Meaning |
|---|---|
|
Lowercase letters and digits joined by |
|
What merchants see in the theme editor. Up to 80 characters. |
|
What the block shows, for merchants in the theme editor. Up to 300 characters. |
|
|
|
The page types it may be placed on: |
|
|
|
A complete Vascula block, up to 128 KB, with |
An app can declare up to 10 blocks. Merchants can add them to sections whose schema sets accept_app_blocks, in templates of the pages the block lists. The storefront renders the block's markup and, for a hosted_surface block, then mounts its surface directly after it.
A hosted surface is a page on your server that the storefront shows in an isolated frame, opened by a hosted_surface app block. It is the only way for an app to show something shoppers interact with, and it reads and changes the cart only through the commands it declares. See Hosted surfaces for the declaration, commands, context, launch token and the surface bridge.
Partner scripts#
Some vendors' widgets must run first-party in the store's page and cannot run in a frame, such as Klarna's on-site messaging ("Pay in 3 interest-free payments of €33.33"). Apps never ship scripts, so Tringify reviews such a vendor once and lists it as a partner script: its exact script, the one element it renders and what fills that element's attributes. Your app opts in with a partner_script app block, and stores the merchant's settings for it (such as a client identifier). The storefront renders the vendor's element in place of the block, with the price of the selected variant on a product page or the cart total on the cart page, loads the vendor's script once for the page after the shopper's consent for its category, and updates the element when the shopper picks another variant or changes the cart.
"storefront_blocks": [
{
"key": "product-messaging",
"name": "Klarna messaging",
"mode": "partner_script",
"pages": ["product"],
"partner_script": "klarna-messaging",
"placement": "credit-promotion-badge",
"source_file": "blocks/product-messaging.vasc"
}
]
// blocks/product-messaging.vasc
{% schema %}
{"name": "Klarna messaging", "kind": "block", "settings": []}
{% endschema %}
Store the merchant's settings with your app token. Only an app whose installed release declares a partner_script block for the key may; the settings are checked against the partner script's fields. Until settings are stored, the block renders only your markup. Uninstalling the app deletes them.
curl -X PUT https://api-store.tringify.com/api/2025-01/partner-scripts/klarna-messaging \
-H "Authorization: Bearer APP_TOKEN" -H "Content-Type: application/json" \
-d '{"config": {"client_id": "klarna_test_client_…", "environment": "playground"}}'
# GET, and PUT, return {"script_key", "config", "updated_at", "origins"} (config null when none); DELETE removes them.
# origins: the store's storefront addresses, primary first, which the vendor must allow (Klarna: the client identifier's allowed origins).
Partner script |
Vendor |
Placements |
Pages |
Settings |
Consent |
|---|---|---|---|---|---|
|
Klarna on-site messaging |
|
|
|
|
To have another vendor reviewed as a partner script, contact Tringify with its integration guide.
App embeds#
"storefront_embeds": [
{
"key": "returns-badge",
"name": "Returns badge",
"kind": "vascula",
"surface": "global_body_end",
"consent_category": "essential",
"snippet": "<div class=\"tf-ab-box tf-ab-row\"><span class=\"tf-ab-strong\">{{ store.name }}</span><span class=\"tf-ab-muted\">{{ settings.text }}</span></div>",
"settings_schema": [
{ "id": "text", "type": "text", "default": "Free returns within 30 days", "editor": { "label": "Badge text" } }
]
}
]
Field |
Meaning |
|---|---|
|
As for blocks. Up to 5 embeds per app. |
|
|
|
|
|
When the storefront adds the embed. |
|
Pixels: |
|
Pixels: your version-pinned HTTPS script, with a version or content hash in the path and no query or fragment. It must be on an origin the app registered ( |
|
Sandboxed pixels: the version-pinned frame document that hosts your pixel, on the origin of |
|
Page-runtime pixels: |
|
For |
|
Optional settings the merchant fills in when turning the embed on: a list of settings like a theme's global settings, each with an |
|
Popups: the |
Embeds declare no bridge actions. A Vascula embed is markup only and a pixel only observes events. A popup opens a hosted surface, and what it may do is what that surface declares. For anything else shoppers interact with, such as a button that adds to the cart, use an app block that opens a hosted surface.
App markup policy#
A Vascula embed's snippet follows the same app markup policy as app blocks. It may use reading markup and links only: no <script>, <style>, frames, forms, buttons, id or data-* attributes, event attributes or inline styles, and classes only from the platform's tf-ab-* set (listed on App blocks); the classes inherit the theme's font and colours. The snippet is checked when you save the configuration, and what it renders is checked again on every page.
A snippet that, rendered with a merchant's settings, breaks the policy is left out of that store's pages; the rest of the page renders as usual. You see it in the app's Health page under Storefront embeds: the stores, the embed, the reason and when it was last seen, for the last 7 days. The merchant sees the same reason on the embed under App embeds in the theme editor. Fix the snippet and release a new version.
Installing an app turns none of its embeds on. Merchants turn Vascula embeds and popups on per storefront under App embeds in the theme editor, and pixels per storefront in Online Store › Pixels; the theme editor shows a pixel's status and links there. An app can also activate one of its embeds on every storefront of the store with the app-token call PUT /api/2025-01/storefront-embeds/{embedKey}, for example when the merchant finishes its setup. A merchant's choice wins: a storefront where the merchant turned the embed off stays off. Storefronts created later inherit the app's activation. Uninstalling removes the app's switches, so a reinstall starts with everything off. An embed is left out of the page until the shopper has given the consent it declares.
Popups#
A popup embed (kind: surface) opens one of your hosted surfaces over the page: a centred card (a bottom sheet on phones) for modal, a side panel for drawer, a bar at the bottom for sticky_bar. Your campaigns decide when. Use it for email and text sign-ups, spin-to-win and discount reveals, announcements, age checks and notices. Nothing of your app loads until a campaign triggers, popups never open on checkout or order confirmation, and automated visits never see them.
"storefront_surfaces": [
{
"key": "signup",
"name": "Sign-up popup",
"url": "https://popups.example.com/surface@1.0.0/signup",
"bridge_major": 1,
"presentation": "modal",
"launch_transport": "form_post",
"actions": ["marketing.subscribe"],
"context": ["campaign.id", "localization.locale", "customer.logged_in"]
}
],
"storefront_embeds": [
{
"key": "signup-popup",
"name": "Sign-up popup",
"kind": "surface",
"surface": "global_overlay",
"consent_category": "essential",
"surface_key": "signup"
}
]
Set the campaigns of a popup with the app-token call PUT /api/2025-01/storefront-embeds/{embedKey}/campaigns (scope write_storefront). The list replaces every campaign of that embed on every storefront; storefronts created later inherit it. Campaigns never turn the embed on: the merchant turns it on under App embeds, or your app with PUT /api/2025-01/storefront-embeds/{embedKey}.
curl -X PUT https://api-store.tringify.com/api/2025-01/storefront-embeds/signup-popup/campaigns \
-H "Authorization: Bearer $APP_TOKEN" -H "Content-Type: application/json" \
-d '{
"campaigns": [{
"id": "welcome-10",
"priority": 50,
"starts_at": "2026-11-12T00:00:00Z",
"triggers": [{ "type": "page_load", "delay_seconds": 8 }, { "type": "exit_intent" }],
"targeting": {
"page_types": ["home", "product", "collection"],
"exclude_paths": ["/pages/contact"],
"devices": ["mobile", "desktop"],
"visitors": "new",
"customers": "guests"
},
"frequency": { "mode": "once_every_days", "days": 7, "stop_after_subscribe": true, "stop_after_close": true }
}]
}'
Field |
Meaning |
|---|---|
|
Your campaign's id, 1–64 letters, numbers, |
|
0–100. When several campaigns are ready at the same moment, the highest opens. One popup opens per page. |
|
Optional schedule (RFC 3339). |
|
1–5 triggers; any one opens the campaign. |
|
Only these storefronts. Empty: all. |
|
Only these page types, such as |
|
Up to 20 each. A path matches exactly, or as a prefix when it ends in |
|
ISO 3166-1 alpha-2 codes of the shopper's country. |
|
|
|
|
|
|
|
|
|
Stop showing this campaign in a browser where the shopper signed up through any campaign of this popup. |
|
Stop showing it for the rest of the session once the shopper closes it. |
Limits: 20 campaigns per popup and 32 KB in all, up to 250 countries and 50 storefronts per campaign. The storefront checks the schedule, storefront, page type, path, country and sign-in for each visitor, and the browser checks device, new or returning, frequency and triggers. When a campaign opens, the storefront checks it again, so a campaign you removed or that ended never opens from a page that was already loaded.
Size the popup with surface.observe(element), set a modal's width with surface.setWidth(px) (280–960), and close it with surface.close(); the shopper can also close it with Escape or by clicking outside. The popup appears only once your page reports its first layout, so a slow page never shows an empty box, and one that does not report within 8 seconds is left closed. Sign shoppers up with surface.subscribe() (the marketing.subscribe command): it uses the store's own sign-up, with its double opt-in and text-marketing consent rules, and must follow the shopper's own action in your frame. See Hosted surfaces.
Personalized products#
To collect text from the shopper, such as an engraving, declare line properties; for uploaded artwork and print files, use line artifacts. See Line properties and App-owned line artifacts. Check what the shopper supplies in your surface before you add it to the cart: once a line is in the cart, checkout never waits on your app.
Test#
Install the app on a development store and add your block to a product page in the theme editor.
Turn your pixel on for the development store's storefront in Online Store › Pixels, then follow Test event delivery.
Under the app's Installs in the Developer Portal, check which release each store runs.
Under Webhooks, Download lifecycle examples gives sample line artifact events to test your handlers without real orders.