Pro and Enterprise plans include a license to store logos on your own
infrastructure for as long as your subscription is active.
Self-hosting means downloading logos from Logo.dev and serving them from your own storage. You fetch once, store in your infrastructure (S3, CDN, filesystem), and serve unlimited times. Reduces API calls and gives you full control.
Implementation
Every stack is different. Your storage, CDN, and infrastructure will vary. Here’s the core pattern you can adapt to your setup.
Basic pattern
// 1. Fetch logo from Logo.dev
const response = await fetch(
`https://img.logo.dev/${domain}?token=${YOUR_PUBLISHABLE_KEY}&format=webp`
);
const buffer = await response.arrayBuffer();
// 2. Store in your infrastructure
await yourStorageSystem.upload(`logos/${domain}.webp`, buffer);
// 3. Serve from your CDN
return `https://your-cdn.com/logos/${domain}.webp`;
Batch processing
const domains = ["stripe.com", "shopify.com", "square.com"];
await Promise.all(
domains.map(async (domain) => {
const response = await fetch(
`https://img.logo.dev/${domain}?token=${YOUR_PUBLISHABLE_KEY}`
);
const buffer = await response.arrayBuffer();
await yourStorageSystem.upload(`logos/${domain}.webp`, buffer);
})
);
Storage examples
Adapt these to your infrastructure:
AWS S3
import AWS from "aws-sdk";
const s3 = new AWS.S3();
async function storeInS3(domain) {
const response = await fetch(
`https://img.logo.dev/${domain}?token=${YOUR_PUBLISHABLE_KEY}&format=webp`
);
const buffer = await response.arrayBuffer();
await s3
.putObject({
Bucket: "your-bucket",
Key: `logos/${domain}.webp`,
Body: Buffer.from(buffer),
ContentType: "image/webp",
CacheControl: "public, max-age=31536000",
})
.promise();
}
Google Cloud Storage
import { Storage } from "@google-cloud/storage";
const storage = new Storage();
const bucket = storage.bucket("your-bucket");
async function storeInGCS(domain) {
const response = await fetch(
`https://img.logo.dev/${domain}?token=${YOUR_PUBLISHABLE_KEY}&format=webp`
);
const buffer = await response.arrayBuffer();
await bucket.file(`logos/${domain}.webp`).save(Buffer.from(buffer), {
contentType: "image/webp",
});
}
Azure Blob Storage
import { BlobServiceClient } from "@azure/storage-blob";
const blobService = BlobServiceClient.fromConnectionString(CONNECTION_STRING);
const container = blobService.getContainerClient("logos");
async function storeInAzure(domain) {
const response = await fetch(
`https://img.logo.dev/${domain}?token=${YOUR_PUBLISHABLE_KEY}&format=webp`
);
const buffer = await response.arrayBuffer();
await container
.getBlockBlobClient(`${domain}.webp`)
.uploadData(Buffer.from(buffer), {
blobHTTPHeaders: { blobContentType: "image/webp" },
});
}