Skip to content

Commit 9786124

Browse files
committed
added logolink skill and updated logo
1 parent fa68508 commit 9786124

3 files changed

Lines changed: 89 additions & 7 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Official Cursor plugin for [Context.dev](https://context.dev): brand intelligenc
77
| Component | Purpose |
88
| --- | --- |
99
| **MCP server** | Connects to Context.dev's hosted MCP at `https://context-dev.stlmcp.com` |
10-
| **Skills** | API reference skill + onboarding skill for API key setup |
10+
| **Skills** | API reference, Logo Link, and onboarding skill for API key setup |
1111
| **Commands** | `/brand-colors`, `/scrape-url` for common workflows |
1212
| **Rules** | Routes live-data questions to MCP and enforces secure API integration patterns |
1313

@@ -68,6 +68,7 @@ Hosted HTTP connection to `context-dev.stlmcp.com`. Uses `${CONTEXT_DEV_API_KEY}
6868
### Skills
6969

7070
- `skills/context-dev/SKILL.md` — API endpoint reference, vendored from [docs.context.dev/skill.md](https://docs.context.dev/skill.md). Refresh with `node scripts/sync-skill.mjs`.
71+
- `skills/logolink/SKILL.md` — embed company logos in UI via Logo Link (`logos.context.dev`) with a public client ID.
7172
- `skills/get-api-key/SKILL.md` — onboarding flow when the user needs to sign up or configure their API key.
7273

7374
### Commands

‎assets/logo.svg‎

Lines changed: 1 addition & 6 deletions
Loading

‎skills/logolink/SKILL.md‎

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
name: logolink
3+
description: >-
4+
Use Context.dev Logo Link to dynamically pull in logos. Use when embedding
5+
company logos in UI (img tags, React components, CSS backgrounds, email HTML,
6+
spreadsheets), building logo walls, CRM avatars, or merchant icons — without
7+
calling the brand API from the frontend.
8+
---
9+
10+
# Context.dev Logo Link
11+
12+
Logo Link delivers company logos via CDN. Pass a front-end-safe `publicClientId` and a `domain`; the URL returns raw image bytes (no JSON, no API key).
13+
14+
**Do not** use the brand API or MCP from browser/client code for logos. Use Logo Link instead.
15+
16+
## When to use
17+
18+
- User wants logos in a UI, landing page, CRM, directory, or transaction list
19+
- User asks to "dynamically fetch/display company logos by domain"
20+
- High-volume logo rendering where `ctxt_secret_` keys must stay server-side
21+
- User needs a simple `<img src="...">` instead of parsing `brand.logos[]`
22+
23+
Use the **brand API** (see `context-dev` skill) when you need stored logos, multiple variants (light/dark/icon), or colors alongside the image.
24+
25+
## Step 1 — Get the Public Client ID
26+
27+
1. Sign up at [context.dev/signup](https://context.dev/signup) if needed (free tier: 10,000 Logo Link requests/month).
28+
2. Copy the **Public Client ID** from [context.dev/dashboard/logolink](https://context.dev/dashboard/logolink). Keys look like `brandLL_xxx`.
29+
3. Prefer an env var the codebase already uses, e.g. `NEXT_PUBLIC_LOGOLINK_KEY` or `VITE_LOGOLINK_PUBLIC_CLIENT_ID`. Never put `ctxt_secret_` keys in client code.
30+
31+
## Step 2 — Restrict referring domains
32+
33+
In the Logo Link dashboard, **Edit Restrictions** and allow only domains that embed the image (e.g. `*.example.com`, `localhost:3000`). The `publicClientId` is safe in frontend code only when restrictions are set.
34+
35+
## Step 3 — Build the URL
36+
37+
```text
38+
https://logos.context.dev/?publicClientId=MY_PUBLIC_CLIENT_ID&domain=TARGET_DOMAIN
39+
```
40+
41+
- Replace `MY_PUBLIC_CLIENT_ID` with the user's ID (or env var).
42+
- Replace `TARGET_DOMAIN` with the company domain variable (bare domain, e.g. `stripe.com`).
43+
- **GET** and **HEAD** only. Response is the image file; `Content-Type` is `image/png`, `image/svg+xml`, etc.
44+
- **24-hour** `Cache-Control` on the response. Browser/CDN caching is expected.
45+
- **Fallback:** if no logo is found, Logo Link returns a generated SVG monogram — `<img>` tags never 404.
46+
47+
## Step 4 — Implement in the codebase
48+
49+
1. Ask where logos should appear and which domain variable drives them.
50+
2. Update **only** those locations; preserve existing fallback and `onError` patterns.
51+
3. Examples:
52+
53+
```html
54+
<img
55+
src="https://logos.context.dev/?publicClientId=brandLL_xxx&domain=stripe.com"
56+
alt="Stripe logo"
57+
/>
58+
```
59+
60+
```jsx
61+
function CompanyLogo({ domain }) {
62+
const publicClientId = process.env.NEXT_PUBLIC_LOGOLINK_KEY;
63+
return (
64+
<img
65+
src={`https://logos.context.dev/?publicClientId=${publicClientId}&domain=${domain}`}
66+
alt={`${domain} logo`}
67+
onError={(e) => {
68+
e.target.style.display = "none";
69+
}}
70+
/>
71+
);
72+
}
73+
```
74+
75+
## Usage rules
76+
77+
- **Allowed:** embed via URL in `<img>`, CSS `background-image`, email HTML, `=IMAGE()` in Sheets/Excel; normal browser caching.
78+
- **Not allowed:** download and re-host logos in your own storage or persist image files outside cache headers. For that, use brand APIs server-side.
79+
80+
Logo Link requests are billed separately from API credits (no rate limit; one charge per unique logo per client per 24h).
81+
82+
## Links
83+
84+
- [Get logos from a domain](https://docs.context.dev/guides/get-logo-from-url)
85+
- [Logo Link dashboard](https://context.dev/dashboard/logolink)
86+
- [Pricing](https://context.dev/pricing)

0 commit comments

Comments
 (0)