Demo
Pick a brand to fill the asset tray: The brandmark and banner above were fetched once and committed, because the Brand API takes a secret key and its asset URLs can rotate. The square icon loads live fromimg.logo.dev.
Build it with AI
Want this brand import in your app? This prompt gives your AI coding tool everything it needs to build it in your framework.
Code
This example is in React, but you can get the same result in any frontend framework: the tray is a proxy endpoint, one fetch, and plain images. Addapi/brand-assets.ts on the server, then render the tray as the Usage tab shows.
Your publishable key is built for client-side code, so
you can ship it in the browser as-is. Your secret key powers the
api/brand-assets.ts proxy and stays on the server.How it works
- One request returns the kit.
GET /brand/:domainfrom the Brand API carries the name, brandmark, social banners, and color palette together, so the tray fills from a single fetch. - Failure still produces an asset. Brandmark and banner URLs do not get the monogram fallback that square icon URLs have, which is why the tray falls back to
img.logo.dev/:domainwhen the kit lookup fails. The user always gets at least one usable asset. - Every asset accepts image parameters. Brandmark and banner URLs take the usual
size,format,retina, andthemeimage parameters, so tray thumbnails and full-size inserts come from the same URLs. On white wells,theme=lightkeeps light wordmarks visible. - Banner lists need filtering. Some
social_bannersentries are blank placeholder URLs with no asset path. The server route drops them so the tray never renders an empty image.
Make it your own
- Make assets insertable. Wire each card to your editor’s insert or drag-and-drop action. The asset URL is all a canvas needs.
- Theme the document too. Set the deck’s accent from the same palette with the brand colors pattern.
- Cache the kit. Brand kits change rarely, so cache the server response per domain instead of calling the Brand API on every open.
Next steps
Brand API
Get the full response: logo, brandmark, banners, and colors.
Brand colors
Theme generated content with the same palette.