TemplateProviderwrapsTemplateEditorfor content.BrandProviderwrapsBrandEditorfor logo, colors, and footer.
Template editor
Mount it, restrict channels, switch templates, offer variables, publish.
Brand editor
Logo, colors, and footer, with their own scopes.
Tenant Templates API
The endpoints both editors write through.
Install the package
Requires React 18.2.0 or newer.Issue a scoped token
The editor runs in the browser, so it authenticates with a JWT, never your API key. Issue one from your backend with , scoped to the Tenant the customer may edit: is the source of truth for the mint-and-sign-in flow. The scopes below are the designer’s own, and they differ from the Inbox scopes documented there.Scopes
Scope a token to one Tenant so a customer edits only their own. Plural forms grant workspace-wide access.
The per-Tenant Template scope is
notifications, plural. Always include a user_id:<id> scope.
A scope that is too narrow fails at save, not at mount. A token with Template scopes and
no Brand scopes renders a Brand editor the customer cannot save from. Nothing reports the
gap until the write is rejected.
Verify
Mount the editor and confirm it renders. A blank editor means the provider created a new draft. Publish a change, then open the Tenant’s Template in Courier and confirm it reflects what the customer wrote.Limits & behavior
- Issue the token server-side. Shipping your API key to the browser exposes the whole workspace.
- A scope grants exactly what it names. A token with only
notificationsscopes cannot write a Brand, even with the brand editor mounted. - Tenant-scoped, not workspace. These Templates belong to a Tenant. For workspace Templates use the .
- Topics are set at send time. Pass
preferences.subscription_topic_idon the send. See .
FAQ
What scopes does the token need?
What scopes does the token need?
A
user_id:<id> scope, plus tenant:<id>:notifications:read and :write for Templates, and tenant:<id>:brand:read / :write if you show the brand editor.Is my API key exposed in the browser?
Is my API key exposed in the browser?
The API key never reaches the browser as long as you issue the JWT from your backend
and pass only that token to the component.
Can I embed only the brand editor?
Can I embed only the brand editor?
Mount
BrandProvider with BrandEditor and a token scoped to the Brand. See
.Which channels can my customers edit?
Which channels can my customers edit?
Email is fully supported. Pass
routing to limit which channels appear, as
describes.