Skip to main content
BrandEditor edits one Tenant’s logo, colors, and email footer. BrandProvider carries its auth.
BrandProvider takes no templateId. A Brand belongs to the Tenant rather than to one Template, so every Template that Tenant sends picks the same Brand up.

Scope the token for a Brand

The Brand scopes are separate from the Template scopes, and a token carrying only Template scopes cannot write a Brand. Include both read and write for an editor a customer can save from. See for the full list and the mint flow. A missing Brand scope fails at save, not at mount. The editor renders, the customer edits, and the write is rejected. Scope the token before you ship rather than after a customer reports it.

Run both editors together

Two arrangements do this, and they differ in how much control you get. brandEditor on TemplateEditor shows the Brand editor beside the content editor, inside the Template provider. brandProps passes options through to it.
Mounting BrandProvider separately gives the Brand its own page or dialog. Each provider creates its own store, so a Brand editor mounted this way holds state independent of the Template editor. Either way the token needs the Brand scopes. Adding brandEditor to a Template editor does not widen the token.

Publish from your own button

hidePublish removes the built-in control, and useBrandActions exposes the actions behind it.
The hook also returns saveBrand for an explicit save, and getTemplate. Call it inside BrandProvider, or inside the TemplateProvider when the Brand editor is mounted through brandEditor. Publishing a Brand is its own call. Publishing a Template does not publish the Brand beside it, so a customer who changes both has two things to publish.

Theme the editor

theme takes a theme object or a class name, and colorScheme selects light or dark.
Import @trycourier/react-designer/styles.css once in your app. Without it the editor renders unstyled.

Provider props

BrandProvider takes auth and identity only.

Editor props

Verify

Render the page, change the logo or a color, and wait for the save message. Publish, then open and confirm the Tenant’s Brand carries the change. Send that Tenant a Template and confirm the email picks the Brand up.

Troubleshooting

Limits & behavior

  • Brand scopes are separate from Template scopes. One token needs both to edit both.
  • A Brand is Tenant-wide. Every Template that Tenant sends resolves the same Brand.
  • Publishing is per resource. A Template publish leaves an edited Brand unpublished.
  • Each provider owns its store. A separately mounted Brand editor shares no state with the Template editor.

FAQ

Mount BrandProvider with BrandEditor and issue a token carrying just the Brand scopes. No Template scopes are needed.
The token is missing tenant:<id>:brand:write. A missing Brand scope fails at save rather than at mount, so the editor renders before anything reports it.
Publishing is per resource. A customer who edits both has two publishes to make, and publishBrand from useBrandActions is the Brand one.
A Brand belongs to the Tenant rather than to a Template, so BrandProvider takes tenantId and token only.