Appearance
Theme SDK
SaveLayer exposes a browser global through the Shopify theme app extension:
js
window.SaveLayerDelivery model
- Installed as a Shopify theme app embed
- Injects the effective SaveLayer API base
- Keeps the storefront integration thin
Save Button block
The theme extension also ships a Save Button section block (extensions/savelayer-theme/blocks/save-button.liquid) that renders a configurable save/toggle control for the current page entity (product, variant, collection, and more). It depends on the same app embed loading window.SaveLayer; merchants should keep the embed enabled wherever they use the block.
Current SDK surface
SaveLayer.versionSaveLayer.save()SaveLayer.remove()SaveLayer.toggle()SaveLayer.list()—GETwithListQueryquery paramsSaveLayer.isSaved()—GETwithcontext,entityType,entityGid(see marketing docs/docs/api-reference)SaveLayer.on()
After successful save, remove, toggle, and list calls, SaveLayer also publishes custom customer events for Web Pixels (Shopify.analytics.publish when available) and emits on the same event names for SaveLayer.on listeners.
Next steps
- SDK Code Examples — Copy-pasteable examples for every SDK method with request/response shapes and error handling patterns.
- Integration Examples — End-to-end patterns for Liquid templates, headless React/Next.js, and analytics event forwarding.
Optional authorization (direct APIs)
When you construct SaveLayerSdk with SdkConfig outside the theme embed (for example a headless server or a custom client), you may set authorization to the SaveLayer JWT string returned from a headless or customer-account exchange (Bearer <jwt>). When present, the SDK sends it as the Authorization header on every request. Theme-embedded usage typically omits this field.
Why this matters for agencies
Agencies should not need custom ScriptTag wiring or bespoke storefront networking code. The theme app embed is the supported path for Online Store themes.