View and manage your API keys in the Logo.dev
dashboard.
Key types
Publishable key (pk_)
Use anywhere — browsers, mobile apps, client-side code. Only works with img.logo.dev.
These keys are automatically protected. We handle security for you.
Secret key (sk_)
Server-side only. Required for search, describe, and other API endpoints. Never expose this key.
How we protect publishable keys
Your publishable keys are safe to use in public code because we automatically secure them for you. We block suspicious requests before they’re processed and never bill you for blocked traffic. Even if someone copies your publishable key, they can’t rack up charges on your account.Automatic protections
When a request reaches our servers, we validate it against multiple signals:- Endpoint restriction — Publishable keys only work with the image CDN
- Anomaly detection — We monitor for usage patterns that don’t match your normal traffic
- Origin blocking — Suspicious referrers and excessive volumes are blocked before they impact your quota
Domain restrictions
For additional control, you can restrict your publishable key to specific domains. When enabled, only requests with a matchingReferer header will be allowed.
How to enable
- Go to API Keys in your dashboard
- Toggle Allowed Domains Only
- Add your domains, one per line
- Click Save Changes
Domain format
example.com— matches onlyexample.com*.example.com— matches all subdomains (e.g.,app.example.com,www.example.com)
Ensuring your app sends referrer data
Browsers send theReferer header automatically for most requests, but certain configurations can prevent this. Here’s how to ensure referrers are sent correctly.
Check your Referrer-Policy
TheReferrer-Policy header controls what referrer information is sent with requests. These policies work with domain restrictions:
| Policy | Works? | Notes |
|---|---|---|
strict-origin-when-cross-origin | ✅ | Modern browser default. Sends origin cross-site. |
origin | ✅ | Always sends origin (recommended for APIs). |
origin-when-cross-origin | ✅ | Sends origin for cross-origin requests. |
unsafe-url | ✅ | Sends full URL (not recommended). |
no-referrer | ❌ | Never sends referrer. Will break restrictions. |
same-origin | ❌ | Only sends for same-origin. Will break. |
HTML meta tag
Add this to your<head> to ensure referrers are sent:
Next.js configuration
Add referrer headers innext.config.js:
Per-image referrer policy
You can also set the policy on individual images:Testing your setup
Before enabling domain restrictions:- Open your browser’s developer tools (Network tab)
- Load a page with Logo.dev images
- Click on an
img.logo.devrequest - Check that the
Refererheader is present and shows your domain
Referer header appears, check your Referrer-Policy settings.
What gets blocked
When domain restrictions are enabled:- ✅ Requests from allowed domains
- ❌ Requests from unlisted domains
- ❌ Requests with no
Refererheader (direct access, some privacy tools) - ❌ Requests from
localhost(unless explicitly added)