Template Builder for developers
Template Builder is the design tool in Scaleflex Studio. An author builds a template once, marks the parts that change as variables, and every image after that comes from the same template.
These pages are about the two programmatic surfaces around it:
The render URL. A saved template is a file in the DAM, and requesting its URL with a query string renders an image. No SDK is involved. See The render URL.
The widget.
@scaleflex/template-builderembeds the editor itself in your own application, so your users build and edit templates without leaving it. See Getting started.
The two are independent. Plenty of integrations only ever need the render URL.
Which surface you need
Generate images from templates someone else authored
Let your own users edit templates in your application
The widget, in DAM-backed mode
Let your users edit templates that your application stores
The widget, in stateless mode
Fill variables from your own product data
Custom metadata, plus the render URL
Talk to the editor without the widget
What the widget is
<sfx-template-builder> is a custom element. It loads the editor from a Template Builder deployment in an iframe, hands over the credential, and re-publishes everything the editor does as ordinary DOM CustomEvents. From your side it behaves like any other component.
It is a protocol adapter, not a renderer. Server-side text rendering, font resolution, asset browsing and the template document all stay inside the deployment. That has one consequence worth knowing up front: an embedded editor always needs an authenticated Scaleflex tenant, even when your own application owns the template document. How rendering works explains why.
Two choices to make
Embedding means picking a storage mode and a credential. They are related: one combination is not available.
Who stores the template
Scaleflex, as a file in the DAM
You do
Hub session
Yes
Yes
Security template
No
Yes
A security template is a permission-scoped guest credential you define once in your Scaleflex project. It needs no Scaleflex identity for any of your users, which is what makes it the usual choice for an external integration - and it works in stateless mode only.
Storage modes and Authentication each go into one of these in full.
Before you start
You need:
A Scaleflex account with Studio enabled on the project, and a running Template Builder deployment to point
base-urlat.A credential minted on your server. Never hardcode one in a public bundle.
Your page's origin added to the deployment's embedding allowlist. See Embedding and origins - this one is easy to miss and produces a blank frame rather than an error message.
A browser with Custom Elements v1. The floors are in Embedding and origins, and they are higher than a plain web component would need, because cross-site embedding depends on partitioned cookies.
Where to go next
Getting started - install it and get an editor on screen
The render URL - render images without embedding anything
API reference - every attribute, method and event