> ## 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.

# Use Logo.dev with Next.js

> Show company logos in Next.js from the Logo.dev CDN. Render next/image with unoptimized so the browser loads each logo, and get files for server code from the Logo.dev API.

Show a company logo in Next.js with a Logo.dev CDN URL. The browser loads each logo from `img.logo.dev`, so the image never passes through your server. Render `next/image` with the `unoptimized` prop, or use a plain `<img>`.

## Prerequisites

* A Next.js app.
* A Logo.dev publishable key:

> [card] [Get your API keys](https://www.logo.dev/dashboard/api-keys)
>
> Your dashboard has a publishable key for the Logo.dev CDN and a secret key for the Logo.dev API. Every plan includes both.

**1. Store your publishable key in an env var**

A publishable key is safe in client code. Prefix the variable with `NEXT_PUBLIC_` so client components can read it:

```bash .env.local theme={null}
NEXT_PUBLIC_LOGO_DEV_PUBLISHABLE_KEY=pk_xxxxxxxxxxxx
```

**2. Render the logo**

Pass the domain and your publishable key to `next/image`, and set `unoptimized`. Set `width` and `height`, since `next/image` requires them for remote images:

```tsx CompanyLogo.tsx theme={null}
import Image from "next/image";

export function CompanyLogo({ domain }: { domain: string }) {
  return (
    <Image
      src={`https://img.logo.dev/${domain}?token=${process.env.NEXT_PUBLIC_LOGO_DEV_PUBLISHABLE_KEY}`}
      alt={`${domain} logo`}
      width={128}
      height={128}
      unoptimized
    />
  );
}
```

With `unoptimized`, you need no change to `next.config.js`.

## Skip the optimizer

Without `unoptimized`, the Next.js Image Optimization API fetches each image on your server and passes it on to your users. [Fair use](https://www.logo.dev/docs/platform/fair-use.md) does not allow this for `img.logo.dev`. The Logo.dev CDN already serves sized, cached images, so the optimizer adds nothing.

If you added `img.logo.dev` to `images.remotePatterns`, remove the entry. Next.js then rejects any `next/image` that sends a logo through the optimizer.

A plain `<img>` also loads the logo in the browser:

```tsx theme={null}
<img
  src={`https://img.logo.dev/${domain}?token=${process.env.NEXT_PUBLIC_LOGO_DEV_PUBLISHABLE_KEY}`}
  alt={`${domain} logo`}
  width={128}
  height={128}
/>
```

To control the output, set the [`size`, `format`, and `theme` parameters](https://www.logo.dev/docs/logo-images/introduction#parameters) on the URL.

## Canvas and OG images

A logo drawn on a `<canvas>` needs `crossorigin="anonymous"`. An Open Graph image from `next/og` needs the logo file on your server, so get it from the Logo.dev API, not the CDN. [CORS, canvas, and CSP](https://www.logo.dev/docs/platform/cors.md) covers both cases.

## Use logos in server code

To work with a logo file in a route handler, a script, or any other server code, call the Logo.dev API with your secret key. You can store those files and serve them from your own servers. See [self-hosting](https://www.logo.dev/docs/platform/self-hosting.md).


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