Use case prompt
Find the domain for each account
The logo needs only a domain, and most accounts already have one:- The account has a website. Store its bare hostname, such as
stripe.com. - A contact has a work email. Use the part after
@. Skip free email providers, such asgmail.com, because that domain is not the account’s company. - You have only the account name. Send it to Search from your server, and let the rep confirm a candidate. The company autocomplete shows this flow.
Render the list and the record header
Both views use the same Logo.dev CDN URL at a different size: 20px in list rows and 56px in the record header. An account with no logo shows the generated monogram:Enrich the record on your server
The same domain gets the brand’s description and colors from Brand. Call it once when an account gets its domain, not on every page view:api/enrich-account.ts
A palette often starts with black or white, so use the first color with an OKLCH chroma (
oklch.c) of 0.08 or more as the accent. The brand kit import use case has a picker.
Test the account views
Test with an account that has a website, one with only a contact email, and one with only a name. Enrich a domain that Logo.dev has not indexed, and check that thepending state retries. Check that a not_found result shows the logo and the name with no description. Then enrich an account again, and check that the rep edit stays.
Brand
Every field, status, and identifier for brand lookups.
Company autocomplete
Capture a clean domain when a rep adds a company.