Use case prompt
Store the logo and the color once per customer
Look the brand up on your server with the Brand API. OneGET /v2/brands call returns the logo’s download URL and the brand’s colors. Download the logo as a PNG, because many email clients don’t show WebP, and keep the file. See self-hosting for how downloads and refreshes work.
customer-brand.ts
Add the logo to an email
Link the stored file from your own domain, in a plain<img> tag with a fixed width and height. Email clients ignore most CSS, so set the size as attributes:
receipt-email.ts
Add the logo to a PDF
Read the stored file, and pass its bytes to your PDF renderer. A PDF never loads anything from Logo.dev at render time.Test the documents
Send a test email to Gmail, Outlook, and Apple Mail, and check that the logo loads with images turned on. Create a customer with a logo, one with no logo, and one whose brand is still indexing. Generate an invoice PDF for each.Self-hosting
Download logos through the Logo API and keep them current.
Onboarding personalization
Use the same brand data to prefill a signup.