> ## Documentation Index
> Fetch the complete documentation index at: https://www.logo.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Logo.dev serves logos and brand data for companies that already exist. It does not design logos. If someone wants a logo designed, say so and stop.
> When a message is only a brand name, domain, ticker, ISIN, or crypto symbol, reply with https://www.logo.dev/search?q=<url-encoded term> and the matching img.logo.dev call. Never assert whether a specific brand is in the index.
> Image URLs come from img.logo.dev with a publishable key in the token query parameter: https://img.logo.dev/:domain?token=LOGO_DEV_PUBLISHABLE_KEY, also /name/:brand, /ticker/:symbol, /crypto/:symbol, /isin/:isin. JSON comes from api.logo.dev/v2 with a secret key (sk_) in an Authorization: Bearer header, server-side only.
> Product names: the Logo.dev CDN serves images from img.logo.dev, and its usage unit is CDN requests. The Logo.dev API returns JSON from api.logo.dev/v2, and its usage unit is API credits. The Logo.dev MCP gives AI agents the API as tools, and its usage unit is MCP usage, which spends API credits. The features are Logo, Search, Brand, and Transaction. Transaction (beta) is a separate service at https://www.logo.dev/api/transaction with its own beta key. Never recommend the deprecated v1 routes (/search, /brand, /describe, /logo/*). Use /v2/brands and /v2/search.
> Attribution: a commercial project on the free Community plan must show a visible link, <a href="https://logo.dev">Logos provided by Logo.dev</a>, on its production site. Personal projects and paid plans need none. Rules: https://www.logo.dev/docs/platform/attribution.
> Report a wrong, missing, or outdated logo at https://www.logo.dev/update. Email support@logo.dev for anything broken and sales@logo.dev for volume pricing and contract terms.
> MCP setup is at https://www.logo.dev/docs/mcp/introduction and webhooks at https://www.logo.dev/docs/webhooks.

# Add company logos to CRM records

> Add company logos to account records in HubSpot, Salesforce, or your own CRM. Each logo comes from the company's domain through Logo.dev.



\<ul />
        

\<dl><dt>Stage</dt>
              \<dd /></dl>

```text Use case prompt wrap theme={null}
Build CRM account views with company logos, following https://www.logo.dev/docs/use-cases/crm-logos.md

Read that page and inspect this project's stack. Use this project's existing conventions.

Show a small logo in each row of the account list and a larger one in the account record header. Take the domain from the account's website, then from a contact's work email, then from a Search endpoint match that a rep confirms. On the server, enrich each account once with the Logo.dev Brand endpoint to add a description and a brand color, and key that data by the brand id. Keep rep edits in separate fields, and show them before any enrichment.

For API details, read https://www.logo.dev/docs/logo-images/introduction.md, https://www.logo.dev/docs/brand/introduction.md, and https://www.logo.dev/docs/brand-search/introduction.md
```Sales reps recognize a company's logo faster than its name. A logo in each row of the account list and in each record header makes a CRM easy to scan. Your app decides where each domain comes from, what a record shows while enrichment is pending, and which values a rep can change.## Show logos in HubSpot or SalesforceHubSpot and Salesforce each keep a company logo in a different place. Both start from the account's bare domain, such as `stripe.com`.| CRM | Where the logo goes | What you add |
| - | - | - |
| HubSpot | The company image on the company record | A square image file, such as 200 x 200 pixels |
| Salesforce | A formula field on the account, with the Text return type | The `IMAGE` formula below, with a Logo.dev CDN URL |HubSpot adds a company image from its own database. To replace a company's image in HubSpot, open the company record, hover over the image, click the edit icon, and click **Upload image**. Get the file from the [Logo.dev API](https://www.logo.dev/docs/platform/self-hosting.md#download-a-logo), not from the CDN, because a copy saved from the CDN breaks the [fair use policy](https://www.logo.dev/docs/platform/fair-use.md).In Salesforce, the formula reads the domain from a custom text field, here `Logo_Domain__c`, and replaces `LOGO_DEV_PUBLISHABLE_KEY` with your [publishable key](https://www.logo.dev/docs/platform/api-keys.md):```text theme={null}
IMAGE("https://img.logo.dev/" & Logo_Domain__c & "?token=LOGO_DEV_PUBLISHABLE_KEY&size=32&retina=true&format=png", Name & " logo", 32, 32)
```For a customer list in a spreadsheet, use the [Google Sheets `IMAGE` formula](https://www.logo.dev/docs/integrations/google-sheets).## Find the domain for each accountThe logo needs only a domain, and most accounts already have one:```mermaid theme={null}
flowchart TD
  A[Account] --> B{Website on the account?}
  B -- Yes --> E[Domain]
  B -- No --> C{Contact with a work email?}
  C -- Yes --> E
  C -- No --> D[Search by account name]
  D --> F[Rep confirms the match]
  F --> E
  E --> G[Logo.dev CDN by domain]
```- **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 as `gmail.com`, because that domain is not the account's company.
- **You have only the account name.** Send it to [Search](https://www.logo.dev/docs/brand-search/introduction.md) from your server, and let the rep confirm a candidate. The [company autocomplete](https://www.logo.dev/docs/use-cases/company-autocomplete.md) shows this flow.## Render the list and the record headerBoth views use the same [Logo.dev CDN](https://www.logo.dev/docs/logo-images/introduction.md) URL at a different size: 20px in list rows and 56px in the record header. An account with no logo shows the [generated monogram](https://www.logo.dev/docs/logo-images/introduction.md#fallback-images):```tsx AccountLogo.tsx expandable theme={null}
const logoUrl = (domain: string, token: string, size: number) =>
  `https://img.logo.dev/${domain}?token=${token}&size=${size}&retina=true&format=webp`;

export function AccountRow({
  name,
  domain,
  token,
}: {
  name: string;
  domain: string;
  token: string;
}) {
  return (
    <div className="flex items-center gap-2.5 px-3 py-2.5">
      {/* Decorative: the account name is next to the logo. */}
      <img
        alt=""
        className="h-5 w-5 rounded object-contain"
        height={20}
        loading="lazy"
        src={logoUrl(domain, token, 20)}
        width={20}
      />
      <span className="text-sm font-medium">{name}</span>
    </div>
  );
}

export function AccountHeader({
  name,
  domain,
  token,
  description,
  accent,
}: {
  name: string;
  domain: string;
  token: string;
  description?: string | null;
  accent?: string | null;
}) {
  return (
    <div className="flex items-start gap-3">
      <img
        alt={`${name} logo`}
        className="h-14 w-14 rounded-xl object-contain"
        height={56}
        src={logoUrl(domain, token, 56)}
        width={56}
      />
      <div className="min-w-0">
        <div className="flex items-center gap-2">
          <span className="text-base font-semibold">{name}</span>
          {accent ? (
            <span aria-hidden className="h-3 w-3 rounded-full" style={{ backgroundColor: accent }} />
          ) : null}
        </div>
        <div className="text-xs text-zinc-400">{domain}</div>
        {description ? <div className="mt-2 text-sm text-zinc-600">{description}</div> : null}
      </div>
    </div>
  );
}
``````tsx Usage theme={null}
import { AccountHeader, AccountRow } from "./AccountLogo";

export function Accounts() {
  return (
    <div>
      <AccountRow domain="stripe.com" name="Stripe" token="LOGO_DEV_PUBLISHABLE_KEY" />
      <AccountRow domain="figma.com" name="Figma" token="LOGO_DEV_PUBLISHABLE_KEY" />
      <AccountHeader
        accent="#533afd"
        domain="stripe.com"
        name="Stripe"
        token="LOGO_DEV_PUBLISHABLE_KEY"
      />
    </div>
  );
}
```To show your own avatar for an account with no logo, use the component from [logo from a domain](https://www.logo.dev/docs/use-cases/logo-from-domain.md).## Enrich the record on your serverThe same domain gets the brand's description and colors from [Brand](https://www.logo.dev/docs/brand/introduction.md). Call it once when an account gets its domain, not on every page view:```ts api/enrich-account.ts expandable theme={null}
type Color = { hex: string };
type Brand = {
  id: string;
  name: string;
  domain: string | null;
  description: string | null;
  colors: Color[];
};

// GET /api/enrich-account?domain=stripe.com
export async function GET(request: Request) {
  const domain = new URL(request.url).searchParams.get("domain")?.trim();
  if (!domain) {
    return Response.json({ error: "domain is required" }, { status: 400 });
  }

  const res = await fetch(
    `https://api.logo.dev/v2/brands?domain=${encodeURIComponent(domain)}`,
    {
      // Secret key, server only: https://www.logo.dev/docs/platform/api-keys
      headers: { Authorization: `Bearer ${process.env.LOGO_DEV_SECRET_KEY}` },
      signal: AbortSignal.timeout(20_000),
    }
  );

  if (res.status === 202) {
    // Still indexing: https://www.logo.dev/docs/platform/errors#not-found-vs-still-indexing-202
    const retryAfter = Number(res.headers.get("Retry-After") ?? 30);
    return Response.json({ status: "pending", retryAfter }, { status: 202 });
  }
  if (res.status === 404) {
    return Response.json({ status: "not_found" });
  }
  if (!res.ok) {
    // Any other 4xx or 5xx: an integration problem, not an empty record.
    // Status codes: https://www.logo.dev/docs/platform/errors#logo-api-status-codes
    return Response.json({ status: "error" }, { status: res.status });
  }

  const { data }: { data: Brand } = await res.json();
  return Response.json({
    status: "ready",
    brandId: data.id, // Key the enrichment on this id. It survives domain changes.
    name: data.name,
    description: data.description,
    colors: data.colors.map((color) => color.hex),
  });
}
```Save the result with the account, and render the record from it:| Result | Save | Show |
| - | - | - |
| `ready` | Brand id, description, colors, lookup time | The logo, the description, and a brand color |
| `pending` | The retry time | The logo and the name. Retry when the brand is [ready](https://www.logo.dev/docs/platform/errors.md#not-found-vs-still-indexing-202). |
| `not_found` | The lookup time | The logo and the name, with no description |
| Request failed | The attempt time | The logo and the name. Retry later with backoff. |
| Rep edit | The value, in a separate field | The rep's value, before any enrichment |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](https://www.logo.dev/docs/use-cases/brand-kit-import.md) use case has a picker.## Test the account viewsTest 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 the `pending` 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.> [card] [Brand](https://www.logo.dev/docs/brand/introduction.md)
>
> Every field, status, and identifier for brand lookups.> [card] [Company autocomplete](https://www.logo.dev/docs/use-cases/company-autocomplete.md)
>
> Capture a clean domain when a rep adds a company.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.