@devries-cameron20 / composio Mirror · read-only
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, 03:37 UTC

next
md 123 lines 3.93 KB
Rendered Raw
1 # Composio Docs
2
3 Documentation site for Composio, built with [Fumadocs](https://fumadocs.dev/).
4
5 For issue triage, review, validation, and publication, follow [Change the Composio docs](CONTRIBUTING.md).
6
7 ## Getting Started
8
9 ```bash
10 bun install
11 bun run dev
12 ```
13
14 Open [http://localhost:3000](http://localhost:3000).
15
16 ## Project Structure
17
18 ```
19 docs/
20 ├── app/ # Next.js app router
21 ├── content/ # MDX content
22 │ ├── docs/
23 │ ├── examples/
24 │ ├── changelog/
25 │ └── reference/
26 ├── components/ # React components
27 ├── lib/ # Utilities
28 └── public/ # Static assets
29 ```
30
31 ## Social Preview Images
32
33 `app/api/og/route.tsx` renders `/api/og` cards. Titles and descriptions apply `textWrap: 'balance'` only when they contain whitespace: Satori undermeasures balanced text that cannot wrap, which shifts single-word titles right. Preview with `/api/og?title=Firewall&description=Block+tool+calls+and+tool+results+you+don%27t+want+your+agent+to+act+on`; add `theme=light` for the light variant.
34
35 ## Adding Content
36
37 Create an `.mdx` file in `content/`, add frontmatter, then add to `meta.json`:
38
39 ```mdx
40 ---
41 title: Page Title
42 description: Brief description
43 ---
44
45 Content here...
46 ```
47
48 ### Components
49
50 ```mdx
51 <Tabs items={['Python', 'TypeScript']}>
52 <Tab value="Python">...</Tab>
53 <Tab value="TypeScript">...</Tab>
54 </Tabs>
55
56 <Callout type="info">Note</Callout>
57
58 <Cards>
59 <Card title="Title" href="/path" />
60 </Cards>
61 ```
62
63 ### Sidebar
64
65 Each folder has `meta.json` for ordering:
66
67 ```json
68 {
69 "pages": ["page-one", "page-two"]
70 }
71 ```
72
73 ## TypeScript Code Blocks
74
75 All TypeScript code blocks in MDX files are **type-checked at build time** using Twoslash. This ensures docs stay in sync with the SDK.
76
77 - Use `// @noErrors` to skip checking for partial snippets
78 - Use `// ---cut---` to hide setup code from output
79 - Run `bun run build` locally to validate before pushing
80
81 See the [Twoslash guide](agent-guidance/context/twoslash.md) for complete example patterns and troubleshooting.
82
83 ## Redirects
84
85 Define permanent redirects in `next.config.mjs` and cover legacy entry points in `tests/integration/redirects.test.ts`. `/docs/getting-started` redirects to `/docs/quickstart` so stale links found by agents still reach the current guide.
86
87 Keep legacy redirects topic-specific. Requests ending in `.md` and legacy `/llms.mdx/` requests must target a Markdown representation, not an HTML guide. The redirect integration tests cover the seven DEVREL-304 entry points, their response formats, content negotiation, and unknown routes that must remain 404s.
88
89 ## Search
90
91 Docs search uses Algolia when `NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY` is set; otherwise it falls back to the local Fumadocs `/api/search` endpoint for development and tests. The sync script builds a first-party index from MDX/OpenAPI/toolkit data (no crawler required), splits long pages into section-sized records, configures searchable attributes/custom ranking/distinct, requests `clickAnalytics`, and sends search result view/click events with `search-insights`.
92
93 ```bash
94 NEXT_PUBLIC_ALGOLIA_APP_ID=62HI9PQZ1L # optional; default shown
95 NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY=...
96 NEXT_PUBLIC_ALGOLIA_INDEX_NAME=docs_composio # optional; default shown
97 ```
98
99 Sync the Algolia index with an admin key:
100
101 ```bash
102 ALGOLIA_APP_ID=62HI9PQZ1L
103 ALGOLIA_ADMIN_API_KEY=...
104 ALGOLIA_INDEX_NAME=docs_composio bun run sync:search
105 ```
106
107 Preview the generated records or test live relevance:
108
109 ```bash
110 bun run sync:search --dry-run --samples
111 ALGOLIA_SEARCH_API_KEY=... bun run test:search "oauth auth config" "gmail send email"
112 ```
113
114 ## Commands
115
116 | Command | Description |
117 |---------|-------------|
118 | `bun run dev` | Dev server |
119 | `bun run build` | Production build (validates TS code blocks) |
120 | `bun run types:check` | Type check |
121 | `bun run sync:search` | Sync docs search records to Algolia |
122 | `bun run test:search` | Query the configured Algolia index from the terminal |
123