An app block is the surface most widgets want: the merchant chooses where it
goes, and it can be switched off per block without uninstalling.
The Apps page in the theme editor
A theme earns an Apps page in the merchant’s theme editor by declaring anappBlocks field in its salesive.form.json:
salesive.config.json is [], so a store with no apps
saves nothing and every slot stays empty.
A field with no default is
undefined on stores that predate it. Always
treat the value as “maybe an array”: Array.isArray(value) ? value : [].What the storefront injects
The platform writes two globals the theme reads, and only when the store has at least one block installed:/app-blocks.js, which walks the page for placeholders and mounts
each block into them. Your theme never calls into an app directly: it renders a
placeholder carrying the right attributes and the loader does the rest.
Because both globals are conditional, a slot must be safe to render before
they exist. Return null rather than an empty wrapper, or you will ship an
empty <div> with margins on every store that has no apps.
Demo: an app block
This is the whole contract, dependency-free. It is the component the default theme ships insrc/components/AppBlockSlot.jsx:
context is how the block knows which product or order it is looking
at. A block mounted without context gets an empty object and must not assume one.
The same thing with the SDK
If the theme already depends onsalesive-dev-tools, its components do exactly
this and save you the file:
hasAppBlock(key) when the theme needs to reserve layout space or hide a
heading around a slot that might be empty. See
storefront extensions for the rest of the exports.
Demo: an app embed
An embed needs no theme work at all: the merchant toggles it on, and the platform puts your script in the head of every page.There is no store id in
window.SALESIVE_CONFIG on a production storefront, so
an embed cannot read one. Your embed calls your own server, and your server
resolves which store the request is for from the install it recorded at OAuth
time. Never trust a store id sent from the page.Demo: a script
A script is the app itself writing into the head through the API, with no merchant step. Use it for analytics or a tag that must load before the theme.WRITE_SCRIPTS. The merchant did not agree to this one individually, so
keep it to what the install consent described.
Choosing a surface
The merchant should control placement
The merchant should control placement
Use an app block. It is the only surface where the merchant decides where
the widget appears, and the only one they can move without editing code.
It runs on every page and the merchant turns it on
It runs on every page and the merchant turns it on
Use an app embed. One toggle, no theme edits, and it survives a theme
switch.
It must load unconditionally, before anything else
It must load unconditionally, before anything else
Use a script. Reach for it last: it is invisible in the merchant’s
settings compared with an embed.
It should not run on the storefront at all
It should not run on the storefront at all
Use the app proxy, which serves your page under
/apps/<slug> on the store’s domain without your code entering the theme.Verifying your slot
- Install your app on a development store.
- Set an
appBlocksfield in the theme’s form, and place your block in the editor’s Apps page. - Open the storefront. The placeholder should carry
data-salesive-app-block="<your-slug>/<your-key>". - Uninstall the app and reload: the slot must disappear and leave no wrapper behind. A gap where the widget was is the most common bug here.

