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 protected automatically. You can expose one in client code without putting your account at risk.
Secret key (sk_)
Server-side only. Required for search, describe, and other API endpoints. Never expose this key.
How we protect publishable keys
Even when your publishable key is copied, blocked traffic is never billed. We validate every request against several signals before it counts against your quota:- Endpoint restriction: publishable keys only work with the image CDN.
- Anomaly detection: usage that doesn’t match your normal traffic gets flagged.
- Origin blocking: suspicious referrers and excessive volumes are blocked before they count.
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, likeapp.example.comandwww.example.com
Ensuring your app sends referrer data
Browsers send theReferer header automatically for most requests, but some configurations strip it.
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)