@devries-cameron20 / composio Mirror · read-only / commits / 5ef15774e
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 18:30 UTC

feat(docs): enforce dashboard go-link paths and ban app/platform hosts

Extend the dashboard link policy: no app.composio.dev or platform.composio.dev anywhere, and any dashboard.composio.dev link with a path must be a go-link (/~/project/... or /~/org/...) or /login. Enforced via new no-restricted-syntax selectors for TS/TSX and the static test (renamed to dashboard-links.test.ts) for MDX. Rewrite the non-conforming links: quickstart /settings -> go-link for api-keys (also restores UTM params lost to a stray checkout during verification), changelog {workspace}/{project}/settings -> go-link for project settings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Sarah Simionescu committed Jul 21, 2026 at 18:18 UTC 5ef15774e6cc88d02715eed174c822b1216e4467
6 files changed +159 -87
docs/AGENTS.md
+1 -1
@@ -39,4 +39,4 @@ bun run generate:api-index
39 - API reference pages and toolkit/meta-tool data are generated. Do not hand-edit generated data unless the local generator owns it.
40 - Changelog entries require `title` and `date` frontmatter, and dates use `YYYY-MM-DD`.
41 - Prefer cURL for API interactions because docs are consumed by humans and AI crawlers.
42 -- Links to `dashboard.composio.dev` must carry `utm_source=docs`, `utm_medium`, and `utm_campaign` (content links use `utm_medium=content` and `utm_campaign=<page-slug>`). ESLint enforces TS/TSX; `tests/static/utm-links.test.ts` enforces MDX.
42 +- Links to `dashboard.composio.dev` must carry `utm_source=docs`, `utm_medium`, and `utm_campaign` (content links use `utm_medium=content` and `utm_campaign=<page-slug>`), and any link with a path must be a go-link (`/~/project/...` or `/~/org/...`) or `/login`. Never link `app.composio.dev` or `platform.composio.dev`. ESLint enforces TS/TSX; `tests/static/dashboard-links.test.ts` enforces MDX.
docs/content/changelog/01-08-26-mcp-api-key-enforcement.mdx
+1 -1
@@ -54,7 +54,7 @@ curl -X POST "https://mcp.composio.dev/{your_mcp_server_url}" \
54
55 ### Via Dashboard
56
57 -1. Navigate to [Project Settings](https://dashboard.composio.dev/{workspace}/{project}/settings?utm_source=docs&utm_medium=content&utm_campaign=changelog-01-08-26-mcp-api-key-enforcement)
57 +1. Navigate to [Project Settings](https://dashboard.composio.dev/~/project/settings/general?utm_source=docs&utm_medium=content&utm_campaign=changelog-01-08-26-mcp-api-key-enforcement)
58 2. Go to the **Project Configuration** tab
59 3. Find the **"Require API Key for MCP"** toggle
60 4. Enable the toggle
docs/content/docs/quickstart.mdx
+3 -3
@@ -39,7 +39,7 @@ The TypeScript SDK is ESM-only and requires Node.js 22.22.3 or newer. Use `impor
39 <StepTitle>Configure API Keys</StepTitle>
40
41 <Callout type="info">
42 -Get your `COMPOSIO_API_KEY` from [Settings](https://dashboard.composio.dev/settings) and `OPENAI_API_KEY` from [OpenAI](https://platform.openai.com/api-keys).
42 +Get your `COMPOSIO_API_KEY` from [Settings](https://dashboard.composio.dev/~/project/settings/api-keys?utm_source=docs&utm_medium=content&utm_campaign=docs-quickstart) and `OPENAI_API_KEY` from [OpenAI](https://platform.openai.com/api-keys).
43 </Callout>
44
45 ```bash title=".env"
@@ -185,7 +185,7 @@ readline.close();
185 <StepTitle>Configure API Keys</StepTitle>
186
187 <Callout type="info">
188 -Get your `COMPOSIO_API_KEY` from [Settings](https://dashboard.composio.dev/settings) and `ANTHROPIC_API_KEY` from [Anthropic](https://console.anthropic.com/settings/keys).
188 +Get your `COMPOSIO_API_KEY` from [Settings](https://dashboard.composio.dev/~/project/settings/api-keys?utm_source=docs&utm_medium=content&utm_campaign=docs-quickstart) and `ANTHROPIC_API_KEY` from [Anthropic](https://console.anthropic.com/settings/keys).
189 </Callout>
190
191 ```bash title=".env"
@@ -348,7 +348,7 @@ readline.close();
348 <StepTitle>Configure API Keys</StepTitle>
349
350 <Callout type="info">
351 -Get your `COMPOSIO_API_KEY` from [Settings](https://dashboard.composio.dev/settings) and `ANTHROPIC_API_KEY` from [Anthropic](https://console.anthropic.com/settings/keys).
351 +Get your `COMPOSIO_API_KEY` from [Settings](https://dashboard.composio.dev/~/project/settings/api-keys?utm_source=docs&utm_medium=content&utm_campaign=docs-quickstart) and `ANTHROPIC_API_KEY` from [Anthropic](https://console.anthropic.com/settings/keys).
352 </Callout>
353
354 ```bash title=".env"
docs/eslint.config.mjs
+26 -1
@@ -1,8 +1,13 @@
1 import { defineConfig, globalIgnores } from 'eslint/config';
2 import nextVitals from 'eslint-config-next/core-web-vitals';
3
4 +// Messages must not contain the literal hostnames or they trip their own selectors.
5 const utmMessage =
5 - 'Links to the Composio dashboard must carry utm_source=docs plus utm_medium and utm_campaign so sign-ups can be attributed to docs (MDX links are checked by tests/static/utm-links.test.ts).';
6 + 'Links to the Composio dashboard must carry utm_source=docs plus utm_medium and utm_campaign so sign-ups can be attributed to docs (MDX links are checked by tests/static/dashboard-links.test.ts).';
7 +const bannedHostMessage =
8 + 'The app/platform composio hosts do not exist; link to the Composio dashboard with a go-link path instead.';
9 +const goLinkMessage =
10 + 'Composio dashboard links with a path must be go-links (/~/project/... or /~/org/...) or /login so they resolve inside the user workspace.';
11
12 const eslintConfig = defineConfig([
13 ...nextVitals,
@@ -25,6 +30,26 @@ const eslintConfig = defineConfig([
30 'TemplateElement[value.raw=/dashboard\\.composio\\.dev/]:not([value.raw=/utm_source=/])',
31 message: utmMessage,
32 },
33 + {
34 + selector:
35 + 'Literal[value=/(?<![a-z0-9-])(app|platform)\\.composio\\.dev/]',
36 + message: bannedHostMessage,
37 + },
38 + {
39 + selector:
40 + 'TemplateElement[value.raw=/(?<![a-z0-9-])(app|platform)\\.composio\\.dev/]',
41 + message: bannedHostMessage,
42 + },
43 + {
44 + selector:
45 + 'Literal[value=/dashboard\\.composio\\.dev\\u002F(?!~\\u002F(project|org)([\\u002F?#]|$)|login([\\u002F?#]|$))/]',
46 + message: goLinkMessage,
47 + },
48 + {
49 + selector:
50 + 'TemplateElement[value.raw=/dashboard\\.composio\\.dev\\u002F(?!~\\u002F(project|org)([\\u002F?#]|$)|login([\\u002F?#]|$))/]',
51 + message: goLinkMessage,
52 + },
53 ],
54 },
55 },
docs/tests/static/dashboard-links.test.ts new
+128
@@ -0,0 +1,128 @@
1 +/**
2 + * Dashboard link policy tests.
3 + *
4 + * Authored content must follow three rules for Composio dashboard links:
5 + * 1. No app.composio.dev or platform.composio.dev hosts anywhere.
6 + * 2. Every dashboard.composio.dev link carries utm_source, utm_medium, and
7 + * utm_campaign so sign-ups can be attributed to docs.
8 + * 3. Any dashboard.composio.dev link with a path must be a go-link
9 + * (/~/project/... or /~/org/...) or /login, so it resolves to the right
10 + * page inside the user's workspace.
11 + *
12 + * Code fences and inline mentions are exempt from rules 2-3; rule 1 applies
13 + * to all file content. content/reference is generated upstream and excluded.
14 + * TS/TSX is enforced by the no-restricted-syntax rules in eslint.config.mjs.
15 + */
16 +import { describe, test, expect } from "bun:test";
17 +import { readdir, readFile } from "fs/promises";
18 +import { join, relative } from "path";
19 +
20 +const CONTENT_DIRS = ["docs", "examples", "changelog"].map((dir) =>
21 + join(import.meta.dir, "../../content", dir),
22 +);
23 +const CONTENT_ROOT = join(import.meta.dir, "../../content");
24 +
25 +const DASHBOARD_LINK_RE = /\]\((https:\/\/dashboard\.composio\.dev[^)\s]*)\)/g;
26 +const BANNED_HOST_RE = /(?<![a-z0-9-])(?:app|platform)\.composio\.dev/;
27 +const GO_LINK_PATH_RE = /^\/(?:~\/(?:project|org)(?:[/?#]|$)|login(?:[/?#]|$))/;
28 +const REQUIRED_PARAMS = ["utm_source=", "utm_medium=", "utm_campaign="];
29 +
30 +async function findMdxFiles(dir: string): Promise<string[]> {
31 + const results: string[] = [];
32 + let entries;
33 + try {
34 + entries = await readdir(dir, { withFileTypes: true });
35 + } catch {
36 + return results;
37 + }
38 +
39 + for (const entry of entries) {
40 + const fullPath = join(dir, entry.name);
41 + if (entry.isDirectory()) {
42 + results.push(...(await findMdxFiles(fullPath)));
43 + } else if (entry.name.endsWith(".mdx")) {
44 + results.push(fullPath);
45 + }
46 + }
47 + return results;
48 +}
49 +
50 +function dashboardLinks(content: string): { line: number; url: string }[] {
51 + const links: { line: number; url: string }[] = [];
52 + let inFence = false;
53 + content.split("\n").forEach((line, index) => {
54 + if (/^\s*(```|~~~)/.test(line)) {
55 + inFence = !inFence;
56 + return;
57 + }
58 + if (inFence) return;
59 + for (const match of line.matchAll(DASHBOARD_LINK_RE)) {
60 + links.push({ line: index + 1, url: match[1] });
61 + }
62 + });
63 + return links;
64 +}
65 +
66 +async function collectViolations(
67 + check: (content: string) => { line: number; url: string }[],
68 +): Promise<string[]> {
69 + const violations: string[] = [];
70 + for (const dir of CONTENT_DIRS) {
71 + for (const file of await findMdxFiles(dir)) {
72 + const content = await readFile(file, "utf-8");
73 + for (const violation of check(content)) {
74 + violations.push(
75 + `${relative(CONTENT_ROOT, file)}:${violation.line} ${violation.url}`,
76 + );
77 + }
78 + }
79 + }
80 + return violations;
81 +}
82 +
83 +describe("Content - dashboard link policy", () => {
84 + test("no app/platform composio hosts anywhere", async () => {
85 + const banned = await collectViolations((content) => {
86 + const violations: { line: number; url: string }[] = [];
87 + content.split("\n").forEach((line, index) => {
88 + const match = line.match(BANNED_HOST_RE);
89 + if (match) violations.push({ line: index + 1, url: match[0] });
90 + });
91 + return violations;
92 + });
93 +
94 + expect(
95 + banned,
96 + `banned hosts found (use dashboard go-links instead):\n${banned.join("\n")}`,
97 + ).toEqual([]);
98 + });
99 +
100 + test("all dashboard links carry utm params", async () => {
101 + const untagged = await collectViolations((content) =>
102 + dashboardLinks(content).filter(
103 + ({ url }) => !REQUIRED_PARAMS.every((param) => url.includes(param)),
104 + ),
105 + );
106 +
107 + expect(
108 + untagged,
109 + `dashboard links missing utm_source=/utm_medium=/utm_campaign=:\n${untagged.join("\n")}`,
110 + ).toEqual([]);
111 + });
112 +
113 + test("all dashboard links with a path are go-links or /login", async () => {
114 + const invalid = await collectViolations((content) =>
115 + dashboardLinks(content).filter(({ url }) => {
116 + const path = url
117 + .replace(/^https:\/\/dashboard\.composio\.dev/, "")
118 + .split("?")[0];
119 + return path !== "" && path !== "/" && !GO_LINK_PATH_RE.test(path);
120 + }),
121 + );
122 +
123 + expect(
124 + invalid,
125 + `dashboard links must use /~/project/..., /~/org/..., or /login paths:\n${invalid.join("\n")}`,
126 + ).toEqual([]);
127 + });
128 +});
docs/tests/static/utm-links.test.ts deleted
-81
@@ -1,81 +0,0 @@
1 -/**
2 - * UTM attribution tests.
3 - *
4 - * Every markdown link to dashboard.composio.dev in authored content must carry
5 - * utm_source, utm_medium, and utm_campaign so sign-ups can be attributed to
6 - * docs. Code fences and inline mentions are exempt; content/reference is
7 - * generated upstream and excluded. TS/TSX links are enforced by the
8 - * no-restricted-syntax rule in eslint.config.mjs.
9 - */
10 -import { describe, test, expect } from "bun:test";
11 -import { readdir, readFile } from "fs/promises";
12 -import { join, relative } from "path";
13 -
14 -const CONTENT_DIRS = ["docs", "examples", "changelog"].map((dir) =>
15 - join(import.meta.dir, "../../content", dir),
16 -);
17 -const CONTENT_ROOT = join(import.meta.dir, "../../content");
18 -
19 -const DASHBOARD_LINK_RE = /\]\((https:\/\/dashboard\.composio\.dev[^)\s]*)\)/g;
20 -const REQUIRED_PARAMS = ["utm_source=", "utm_medium=", "utm_campaign="];
21 -
22 -async function findMdxFiles(dir: string): Promise<string[]> {
23 - const results: string[] = [];
24 - let entries;
25 - try {
26 - entries = await readdir(dir, { withFileTypes: true });
27 - } catch {
28 - return results;
29 - }
30 -
31 - for (const entry of entries) {
32 - const fullPath = join(dir, entry.name);
33 - if (entry.isDirectory()) {
34 - results.push(...(await findMdxFiles(fullPath)));
35 - } else if (entry.name.endsWith(".mdx")) {
36 - results.push(fullPath);
37 - }
38 - }
39 - return results;
40 -}
41 -
42 -function findUntaggedLinks(content: string): { line: number; url: string }[] {
43 - const violations: { line: number; url: string }[] = [];
44 - let inFence = false;
45 - content.split("\n").forEach((line, index) => {
46 - if (/^\s*(```|~~~)/.test(line)) {
47 - inFence = !inFence;
48 - return;
49 - }
50 - if (inFence) return;
51 - for (const match of line.matchAll(DASHBOARD_LINK_RE)) {
52 - const url = match[1];
53 - if (!REQUIRED_PARAMS.every((param) => url.includes(param))) {
54 - violations.push({ line: index + 1, url });
55 - }
56 - }
57 - });
58 - return violations;
59 -}
60 -
61 -describe("Content - dashboard link UTM attribution", () => {
62 - test("all dashboard links carry utm params", async () => {
63 - const untagged: string[] = [];
64 -
65 - for (const dir of CONTENT_DIRS) {
66 - for (const file of await findMdxFiles(dir)) {
67 - const content = await readFile(file, "utf-8");
68 - for (const violation of findUntaggedLinks(content)) {
69 - untagged.push(
70 - `${relative(CONTENT_ROOT, file)}:${violation.line} ${violation.url}`,
71 - );
72 - }
73 - }
74 - }
75 -
76 - expect(
77 - untagged,
78 - `dashboard links missing utm_source=/utm_medium=/utm_campaign=:\n${untagged.join("\n")}`,
79 - ).toEqual([]);
80 - });
81 -});