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, and the write fails when the customer tries to save.
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.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 stays on your backend as long as you issue the JWT there and pass only
that token to the component. A browser holding the key itself would have access to
your whole workspace.
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.