Skip to main content
Use case prompt
Slide tools, design apps, website builders, and white-label products all need the customer’s brand. An upload step asks for files that most people do not have. An import that fills itself from a domain removes that step, and a workspace in the customer’s own colors feels like their tool from the first session. Logo.dev returns the brand’s name, images, and colors in one response. Your app stores the files, picks the accent, and decides what to show when a brand has no data.

Import the brand on your server

Look up the domain with the Brand API, from your server with your secret key. The kit uses data.logo, data.brandmark, the first of data.social_banners, and data.colors. Store the files, not the URLs. The image URLs expire, so download each image at import time. On a later import, replace only the images whose etag changed, as images describes. The etag identifies the source image, not the size or theme of your download. Store the size and theme with each file, and download the image again when you request a different one. The following route looks up the brand, stores its images, and returns the kit. It writes the files to public/brand-kits/. Replace the two file calls with your object storage:
api/brand-kit.ts
To import the brand again when it changes, use update webhooks. The etags tell you which files to replace.

Render the asset tray

The tray calls the route, retries while the brand is indexing, and shows the stored files. When there is no kit, it shows the domain’s logo from the Logo CDN:
Connect each asset to your editor’s insert or drag action. A canvas needs only the stored file path.

Theme the workspace with the brand colors

The import also stores a theme: the first color in the palette with an OKLCH chroma (oklch.c) of 0.08 or more as the accent, and a text color that is legible on it. Palettes often start with black or white, so the first color is not always the accent. Store the theme with the customer’s account, and render from it: Set the stored colors as theme variables at the top of the customer’s workspace. Every button, link, and highlight that reads the variables then uses the customer’s accent:
Use the same accent and logo in the pages, slides, and emails that you generate for the customer.

Test the import

Import a brand with full data (spotify.com), a brand whose accent is light enough to need dark text, a domain that Logo.dev has not indexed yet, and an invented domain. An invented domain can return 202 before it returns 404. Import the same brand two times, and check that the second import downloads no files. Set a color as the customer, and check that a new import keeps it. Make the lookup fail once, and check that the tray still shows a logo and the default theme shows.

Brand API

See every field, status code, and image parameter, including colors in hex and OKLCH.

Onboarding personalization

Get the domain at signup and theme the workspace from day one.