@devries-cameron20 / composio-1 / commits / 0e7c74b5c
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.

Remove all old assets from docs

Sushmithamallesh committed Oct 12, 2025 at 23:18 UTC 0e7c74b5cfd28aa5f1e7121b3180db2f5c68c73f
28 files changed +8 -736
fern/assets/CohereHeadline-Bold.woff2
Binary files a/fern/assets/CohereHeadline-Bold.woff2 and /dev/null differ
fern/assets/CohereHeadline-Regular.woff2
Binary files a/fern/assets/CohereHeadline-Regular.woff2 and /dev/null differ
fern/assets/CohereMono-Regular.woff2
Binary files a/fern/assets/CohereMono-Regular.woff2 and /dev/null differ
fern/assets/CohereText-Regular.woff2
Binary files a/fern/assets/CohereText-Regular.woff2 and /dev/null differ
fern/assets/CohereVariable.woff2
Binary files a/fern/assets/CohereVariable.woff2 and /dev/null differ
fern/assets/images/auth-concepts.png
Binary files a/fern/assets/images/auth-concepts.png and /dev/null differ
fern/assets/images/integrations-page.png
Binary files a/fern/assets/images/integrations-page.png and /dev/null differ
fern/assets/images/providers-and-toolsets.png
Binary files a/fern/assets/images/providers-and-toolsets.png and /dev/null differ
fern/assets/videos/composio-welcome.mp4
Binary files a/fern/assets/videos/composio-welcome.mp4 and /dev/null differ
fern/assets/videos/configure-webhook-url.mp4
Binary files a/fern/assets/videos/configure-webhook-url.mp4 and /dev/null differ
fern/assets/videos/creating-integration.mp4
Binary files a/fern/assets/videos/creating-integration.mp4 and /dev/null differ
fern/assets/videos/debugging-triggers.mp4
Binary files a/fern/assets/videos/debugging-triggers.mp4 and /dev/null differ
fern/docs.yml
+8 -8
@@ -192,28 +192,28 @@ navigation:
192 slug: troubleshooting
193 contents:
194 - page: Overview
195 - path: pages/src/troubleshooting/overview.mdx
195 + path: pages/dist/troubleshooting/overview.mdx
196 slug: overview
197 - page: API
198 - path: pages/src/troubleshooting/api.mdx
198 + path: pages/dist/troubleshooting/api.mdx
199 slug: api
200 - page: Authentication
201 - path: pages/src/troubleshooting/authentication.mdx
201 + path: pages/dist/troubleshooting/authentication.mdx
202 slug: authentication
203 - page: Dashboard
204 - path: pages/src/troubleshooting/dashboard.mdx
204 + path: pages/dist/troubleshooting/dashboard.mdx
205 slug: dashboard
206 - page: MCP
207 - path: pages/src/troubleshooting/mcp.mdx
207 + path: pages/dist/troubleshooting/mcp.mdx
208 slug: mcp
209 - page: SDKs
210 - path: pages/src/troubleshooting/sdks.mdx
210 + path: pages/dist/troubleshooting/sdks.mdx
211 slug: sdks
212 - page: Tools & Toolkits
213 - path: pages/src/troubleshooting/tools.mdx
213 + path: pages/dist/troubleshooting/tools.mdx
214 slug: tools
215 - page: Triggers
216 - path: pages/src/troubleshooting/triggers.mdx
216 + path: pages/dist/troubleshooting/triggers.mdx
217 slug: triggers
218 - tab: examples
219 layout:
fern/pages/src/examples/gmail-filterer.mdx deleted
-188
@@ -1,188 +0,0 @@
1 ----
2 -title: AI Gmail Labeller
3 -subtitle: 'A Python app that uses your custom LLM prompt to label your Gmail!'
4 -image: "https://og.composio.dev/api/og?title=AI%20Gmail%20Labeller" # image for socials
5 -keywords: ''
6 -hide-nav-links: false
7 ----
8 -
9 -Imagine having an AI assistant that automatically organizes your Gmail inbox by intelligently labeling incoming emails. That's exactly what we'll build in this tutorial.
10 -
11 -<Frame>
12 - <img
13 - src="https://camo.githubusercontent.com/29b105fdcc2e005d8dd76bab0af33081a0567637da1061da6e1664285b843f8d/68747470733a2f2f692e696d6775722e636f6d2f515646337956582e676966"
14 - alt="Gmail Labeller"
15 - />
16 -</Frame>
17 -
18 -The complete app is available in our [`filter-gmails-example`](https://github.com/ComposioHQ/filter-gmails-example) repository. The app has a frontend built with Next.js along with Supabase for authentication.
19 -
20 -<Card
21 - title="GitHub Repository"
22 - href="https://github.com/ComposioHQ/filter-gmails-example"
23 - icon="fa-brands fa-github"
24 ->
25 - Explore the complete source code on GitHub
26 -</Card>
27 -
28 -In this guide, we'll focus on the Composio + OpenAI Agents part of the app.
29 -
30 -## Prerequisites
31 -
32 -- Clone the [`filter-gmails-example`](https://github.com/ComposioHQ/filter-gmails-example) repository and set the project up locally.
33 -- Get a Composio API key. You can get one <a href="https://platform.composio.dev?next_page=/settings" target="_blank">here</a>.
34 -
35 -## Creating Triggers for users
36 -
37 -[Triggers](/docs/using-triggers) are a way to listen for events from apps. They act as a notification system for your AI applications, enabling your agents to respond dynamically to external events occurring within your apps.
38 -
39 -In some cases, triggers require certain configurations to set the correct events. You can inspect and add these properties while enabling the triggers.
40 -
41 -<SnippetCode
42 - githubUrl="https://github.com/ComposioHQ/filter-gmails-example/blob/master/apps/backend/email_processor.py#L135-L156"
43 - language="python"
44 - title="apps/backend/email_processor.py"
45 - highlightStart={18}
46 - highlightEnd={22}
47 -/>
48 -
49 -Then the trigger can be created with the following code:
50 -
51 -<SnippetCode
52 - githubUrl="https://github.com/ComposioHQ/filter-gmails-example/blob/master/apps/backend/email_processor.py#L163-L169"
53 - language="python"
54 - title="apps/backend/email_processor.py"
55 -/>
56 -
57 -## Listening for a trigger event
58 -
59 -<Callout type="info">
60 -For local development, you can use [ngrok](https://ngrok.com/) to expose your local server to the internet.
61 -
62 -```bash
63 -ngrok http 8000
64 -```
65 -
66 -Then you can set the ngrok URL in the trigger configuration.
67 -
68 -<Frame>
69 - <img src="../../../assets/images/examples/trigger-config.png" alt="Trigger configuration" />
70 -</Frame>
71 -</Callout>
72 -
73 -This is the main webhook endpoint for processing Gmail new message events.
74 -
75 -Composio sends a POST request to the webhook endpoint `/composio/webhook` that contains the event data.
76 -
77 -It is parsed and then the labeling method `process_gmail_message` is called through a FastAPI Background task.
78 -
79 -```python apps/backend/main.py {1-5, 29-33} maxLines=33
80 -@app.post("/composio/webhook")
81 -async def listen_webhooks(
82 - request: Request,
83 - background_tasks: BackgroundTasks
84 -):
85 - """
86 - Main webhook endpoint for processing Gmail
87 - new message events. This is the core webhook
88 - labeling functionality.
89 - """
90 - # Verify webhook signature
91 - # Check if this is a Gmail new message event
92 - if (
93 - webhook_data.get("type") == "gmail_new_message"
94 - or "gmail" in webhook_data.get("type", "").lower()
95 - ):
96 - gmail_message = GmailMessage.from_composio_payload(
97 - webhook_data
98 - )
99 - # Get the user's custom prompt or use default
100 - default_prompt = (
101 - initial_prompt or "Default email processing prompt"
102 - )
103 - user_prompt = get_user_prompt(
104 - gmail_message.user_id, default_prompt
105 - )
106 -
107 - # Add email processing to background tasks
108 - background_tasks.add_task(
109 - process_gmail_message,
110 - gmail_message,
111 - user_prompt
112 - )
113 -
114 - logger.info(
115 - f"Queued email {gmail_message.id} for processing"
116 - )
117 - return {"status": "received", "webhook_id": webhook_id}
118 -```
119 -
120 -## Processing the mail using OpenAI Agents SDK
121 -
122 -The `process_gmail_message` method is responsible for processing the email using the OpenAI Agents SDK.
123 -
124 -<SnippetCode
125 - githubUrl="https://github.com/ComposioHQ/filter-gmails-example/blob/master/apps/backend/email_processor.py#L14-L24"
126 - language="python"
127 - title="apps/backend/email_processor.py"
128 -/>
129 -
130 -<SnippetCode
131 - githubUrl="https://github.com/ComposioHQ/filter-gmails-example/blob/master/apps/backend/email_processor.py#L42-L45"
132 - language="python"
133 - title="apps/backend/email_processor.py"
134 -/>
135 -
136 -We read the first 10k characters of the email body to pass it to the agent. This is done to avoid overwhelming or surpassing the token limits in case of really long emails.
137 -
138 -<SnippetCode
139 - githubUrl="https://github.com/ComposioHQ/filter-gmails-example/blob/master/apps/backend/email_processor.py#L50-L60"
140 - language="python"
141 - title="apps/backend/email_processor.py"
142 -/>
143 -
144 -`user_filter` is the user's custom prompt from the database. We pass it to the agent along with the email body.
145 -
146 -<SnippetCode
147 - githubUrl="https://github.com/ComposioHQ/filter-gmails-example/blob/master/apps/backend/email_processor.py#L68-L85"
148 - language="python"
149 - title="apps/backend/email_processor.py"
150 -/>
151 -
152 -You can view the agent trace in OpenAI's [Traces Dashboard](https://platform.openai.com/traces/).
153 -
154 -<Frame>
155 - <img src="../../../assets/images/examples/gmail-agent-trace.png" alt="Gmail Agent Trace" />
156 -</Frame>
157 -
158 -## Securing the webhooks!
159 -
160 -It is important to validate the webhook signature to ensure the request is coming from Composio.
161 -
162 -Generate and store the webhook signature in the environment variables.
163 -
164 -<Frame>
165 - <img src="../../../assets/images/examples/webhook-secret.png" alt="Webhook Secret" />
166 -</Frame>
167 -
168 -The webhook signature is validated in the `verify_webhook_signature` function.
169 -
170 -<SnippetCode
171 - githubUrl="https://github.com/ComposioHQ/filter-gmails-example/blob/master/apps/backend/webhook.py#L10-L56"
172 - language="python"
173 - title="apps/backend/webhook.py"
174 -/>
175 -
176 -In the `/composio/webhook` endpoint, we verify the webhook signature and then parse the request body. If the signature is invalid, we return a 401 status code.
177 -
178 -<SnippetCode
179 - githubUrl="https://github.com/ComposioHQ/filter-gmails-example/blob/master/apps/backend/main.py#L31-L38"
180 - language="python"
181 - title="apps/backend/main.py"
182 -/>
183 -
184 -## Inspiration
185 -
186 -This example was inspired by an X/Twitter post by [@FarzaTV](https://x.com/FarzaTV/status/1905371012369350857).
187 -
188 -We encourage you to check out the [full app](https://github.com/ComposioHQ/filter-gmails-example), fork it, build it, and make it your own! Reach out to [soham@composio.dev](mailto:soham@composio.dev) for free credits ;)
fern/pages/src/index.mdx deleted
-171
@@ -1,171 +0,0 @@
1 ----
2 -no-image-zoom: true
3 ----
4 -
5 -export const LandingPageCard = ({ href, title, imgSrc, description }) => (
6 - <div className="rounded-lg bg-[#F5F4F2] dark:bg-[#0F0F0F] px-6 py-5 hover:bg-[#E9E6DE] dark:hover:bg-[#292929] md:p-8">
7 - <a
8 - href={href}
9 - target="_self"
10 - className="flex h-full flex-col justify-between"
11 - style={{ textDecoration: 'none' }}
12 - >
13 - <div className="mb-5 flex flex-col justify-between gap-5">
14 - <h2 className="lg:min-h-20 [@media(min-width:1181px)]:min-h-0">
15 - {title}
16 - </h2>
17 - <img src={imgSrc} alt={title} />
18 - <p className="p-lg">{description}</p>
19 - </div>
20 - <div className="mt-2 text-sm text-[#2D4CB9] dark:text-[#4C6EE6] md:mt-0 md:self-end">
21 - {"GET STARTED"}
22 - <div className="ml-2 inline-block group-hover:no-underline">
23 - <svg
24 - width="12"
25 - height="11"
26 - viewBox="0 0 12 11"
27 - fill="none"
28 - xmlns="http://www.w3.org/2000/svg"
29 - style={{ transform: "rotate(-90deg)" }}
30 - >
31 - <path
32 - d="M6 10.75L0.75 5.31686L1.74907 4.27907L5.2556 8.00291L5.2556 0.25L6.7444 0.25L6.7444 8.00291L10.2509 4.27907L11.25 5.31686L6 10.75Z"
33 - fill="currentColor"
34 - ></path>
35 - </svg>
36 - </div>
37 - </div>
38 - </a>
39 - </div>
40 -);
41 -
42 -export const EndpointLink = ({ href, title }) => (
43 - <a
44 - href={href}
45 - className="group flex cursor-pointer flex-row text-sm !font-normal text-[#2D4CB9] dark:text-[#4C6EE6]"
46 - rel="noreferrer"
47 - target="_self"
48 - >
49 - {title}
50 - <span className="duration-400 flex items-center transition-all ease-in-out group-hover:pl-1 group-hover:pr-2">
51 - <div className="ml-2 inline-block text-sm !text-[#2D4CB9] group-hover:no-underline">
52 - <svg
53 - width="12"
54 - height="11"
55 - viewBox="0 0 12 11"
56 - fill="none"
57 - xmlns="http://www.w3.org/2000/svg"
58 - style={{ transform: "rotate(-90deg)" }}
59 - >
60 - <path
61 - d="M6 10.75L0.75 5.31686L1.74907 4.27907L5.2556 8.00291L5.2556 0.25L6.7444 0.25L6.7444 8.00291L10.2509 4.27907L11.25 5.31686L6 10.75Z"
62 - fill="currentColor"
63 - ></path>
64 - </svg>
65 - </div>
66 - </span>
67 - </a>
68 -);
69 -
70 -export const cards = [
71 - {
72 - href: "/docs",
73 - imgSrc: "https://fern-image-hosting.s3.amazonaws.com/cohere/8da77c9-Frame_138972.png",
74 - title: "Guides",
75 - description:
76 - "Understand how to use the Composio SDK and platform on a deeper level. Build with authenticated tools, triggers and more.",
77 - },
78 - {
79 - href: "/api-reference/",
80 - imgSrc: "https://fern-image-hosting.s3.amazonaws.com/cohere/8ff146a-Group_138977.png",
81 - title: "Reference",
82 - description:
83 - "Use Composio's tools and MCP servers into your agents with just a few lines of code.",
84 - },
85 - {
86 - href: "/cookbooks",
87 - imgSrc: "https://fern-image-hosting.s3.amazonaws.com/cohere/7fca92c-Group_138977_2.png",
88 - title: "Cookbooks",
89 - description:
90 - "A collection of resources to help developers get up and running with Composio.",
91 - },
92 -];
93 -
94 -export const frameworks = [
95 - {
96 - href: "/frameworks/langchain",
97 - title: "LangChain",
98 - },
99 - {
100 - href: "/frameworks/langgraph",
101 - title: "LangGraph",
102 - },
103 - {
104 - href: "/frameworks/crewai",
105 - title: "CrewAI",
106 - },
107 - {
108 - href: "/frameworks/vercel",
109 - title: "Vercel",
110 - },
111 - {
112 - href: "/frameworks/autogen",
113 - title: "Autogen",
114 - },
115 -];
116 -
117 -<div className="m-auto max-w-[1195px] flex-grow overflow-y-auto px-8 pt-10 md:p-10 md:pb-14">
118 - <div className="flex flex-col gap-5 md:!grid md:grid-cols-2 md:gap-10 md:pb-7 lg:!grid-cols-3 lg:gap-x-8 lg:gap-y-10 lg:pb-16">
119 - {cards.map((card) => (
120 - <LandingPageCard
121 - key={card.href}
122 - href={card.href}
123 - imgSrc={card.imgSrc}
124 - title={card.title}
125 - description={card.description}
126 - />
127 - ))}
128 - <a href="/frameworks" className="col-span-2" style={{ textDecoration: 'none' }}>
129 - <div className="mb-8 flex flex-col gap-9 rounded-lg bg-[#F5F4F2] dark:bg-[#0F0F0F] px-6 py-5 hover:bg-[#E9E6DE] dark:hover:bg-[#292929] md:!flex-row md:items-end md:gap-16 md:p-8 lg:gap-10">
130 - <div className="md:w-1/2">
131 - <h2 className="mb-8 mt-4 md:mt-0">Frameworks</h2>
132 - <p className="p-lg w-full">
133 - Build with frameworks that support Composio's tools and MCP servers.
134 - </p>
135 - </div>
136 - <div className="grid grid-cols-2 gap-5 md:w-1/2 md:gap-10 lg:w-1/3 lg:gap-8">
137 - {frameworks.map((framework) => (
138 - <EndpointLink key={framework.href} {...framework} />
139 - ))}
140 - </div>
141 - </div>
142 - </a>
143 - </div>
144 - <div
145 - className="block h-full w-full rounded-lg bg-cover bg-no-repeat p-6 md:hidden"
146 - style={{
147 - backgroundImage: "url('https://fern-image-hosting.s3.amazonaws.com/cohere/ddd53ed-Mask_group.png')",
148 - }}
149 - >
150 - <a
151 - href="https://cohere.com/llmu"
152 - target="_blank"
153 - className="flex h-full w-full flex-col justify-between !text-white md:!flex-row"
154 - >
155 - <div className="flex h-full flex-col justify-between">
156 - <div className="flex flex-row">
157 - <img
158 - src="https://fern-image-hosting.s3.amazonaws.com/cohere/9d0694c-Symbol.svg"
159 - alt=""
160 - className="h-7 w-7 lg:h-10 lg:w-10"
161 - />
162 - <h2 className="h3 mb-28 ml-5 mt-0">LLM University</h2>
163 - </div>
164 - <p className="p-lg !text-white">
165 - New to NLP? Learn about Natural Language processing and Large Language
166 - Models through our structured curriculum.
167 - </p>
168 - </div>
169 - </a>
170 - </div>
171 -</div>
fern/pages/src/providers/google-adk.mdx deleted
-19
@@ -1,19 +0,0 @@
1 ----
2 -title: Google ADK Provider
3 -slug: /providers/google-adk
4 -image: "https://og.composio.dev/api/og?title=Google%20ADK%20Provider" # image for socials
5 -keywords: ""
6 -hide-nav-links: false
7 ----
8 -
9 -- [ ] Pending on Python SDK
10 -
11 -## Google ADK Provider
12 -
13 -The Google ADK Provider formats the Composio tools into an object compatible with Google's ADK capabilities. Agents and LLM workflows built with this can call and execute the Composio tools.
14 -
15 -## Setup
16 -
17 -```typescript TypeScript maxLines=60 wordWrap
18 -
19 -```
\ No newline at end of file
fern/snippets/authentication/typescript/custom-auth-injection.ts deleted
-65
@@ -1,65 +0,0 @@
1 -import { Composio } from '@composio/core';
2 -import { z } from 'zod';
3 -
4 -const composio = new Composio();
5 -
6 -const bearerToken = 'ghp_YourPersonalAccessToken...';
7 -// const userId = 'user@acme.com';
8 -const userId = 'sid';
9 -
10 -// const tool = await composio.tools.createCustomTool({
11 -// slug: 'GITHUB_SEARCH_REPOSITORIES',
12 -// name: 'Search GitHub Repositories',
13 -// description: 'Search for repositories with custom parameters',
14 -// toolkitSlug: 'github',
15 -// inputParams: z.object({
16 -// query: z.string().describe('Search query'),
17 -// perPage: z.number().optional().describe('Results per page'),
18 -// }),
19 -// execute: async (input, connectionConfig, executeToolRequest) => {
20 -// const result = await executeToolRequest({
21 -// endpoint: '/search/repositories',
22 -// method: 'GET',
23 -// parameters: [
24 -// // Add custom auth header
25 -// {
26 -// name: 'Authorization',
27 -// value: `Bearer ${bearerToken}`,
28 -// in: 'header',
29 -// },
30 -// ],
31 -// });
32 -// return result;
33 -// },
34 -// });
35 -
36 -const customToolSlug = 'GITHUB_STAR_COMPOSIOHQ_REPOSITORY';
37 -const tool_1 = await composio.tools.createCustomTool({
38 - slug: customToolSlug,
39 - name: 'Github star composio repositories',
40 - toolkitSlug: 'github',
41 - description: 'For any given repository of the user composiohq, star the repository',
42 - inputParams: z.object({
43 - repository: z.string().describe('The repository to star'),
44 - }),
45 - execute: async (input, connectionConfig, executeToolRequest) => {
46 - console.log('🚀 ~ execute: ~ params:', input);
47 - console.log('🚀 ~ execute: ~ connectionConfig:', connectionConfig);
48 -
49 - const result = await executeToolRequest({
50 - endpoint: `/user/starred/composiohq/${input.repository}`,
51 - method: 'PUT',
52 - });
53 - return result;
54 - },
55 -});
56 -
57 -const result = await composio.tools.execute(tool_1.slug, {
58 - arguments: {
59 - repository: 'composio',
60 - },
61 - userId,
62 - connectedAccountId: 'ca_XOVkjOlY95qN',
63 -});
64 -
65 -console.log(result);
fern/snippets/examples/sample-script/sample-script.py deleted
-41
@@ -1,41 +0,0 @@
1 -from composio_core import Composio
2 -from openai import OpenAI
3 -
4 -# Initialize OpenAI client
5 -openai = OpenAI(api_key="your-openai-api-key")
6 -
7 -# Initialize Composio client
8 -composio = Composio(api_key="your-composio-api-key")
9 -
10 -# Set up user identifier
11 -userId = "your@email.com"
12 -
13 -# Authorize and get tools for Gmail
14 -connection, tools = composio.toolkits.authorize(userId, "gmail")
15 -print(f"🔗 Visit the URL to authorize:\n👉 {connection.redirect_url}")
16 -
17 -# Wait for the user to complete authorization
18 -connection.wait_for_connection()
19 -
20 -# Create a chat completion with tool calling
21 -completion = openai.chat.completions.create(
22 - model="gpt-4o",
23 - messages=[
24 - {
25 - "role": "system",
26 - "content": "You are a helpful assistant that can send emails.",
27 - },
28 - {
29 - "role": "user",
30 - "content": "send an email to soham@composio.dev saying 'hi from the composio quickstart'",
31 - # we'll ship you free merch if you do ;)
32 - },
33 - ],
34 - tools=tools,
35 - tool_choice="auto",
36 -)
37 -
38 -# Handle the tool call and execute
39 -result = composio.provider.handle_tool_call(userId, completion)
40 -print("✅ Email sent successfully!")
41 -print(result)
fern/snippets/mcp/typescript/openai.ts deleted
-51
@@ -1,51 +0,0 @@
1 -import { Composio } from '@composio/core';
2 -import { OpenAIResponsesProvider } from '@composio/openai';
3 -import OpenAI from 'openai';
4 -import { v4 as uuidv4 } from 'uuid';
5 -
6 -const openai = new OpenAI({
7 - apiKey: process.env.OPENAI_API_KEY,
8 -});
9 -
10 -const composio = new Composio({
11 - apiKey: process.env.COMPOSIO_API_KEY,
12 - provider: new OpenAIResponsesProvider(),
13 -});
14 -
15 -const mcpConfig = await composio.mcp.create(
16 - 'gmail-mcp',
17 - [
18 - {
19 - toolkit: 'GMAIL',
20 - allowedTools: ['GMAIL_FETCH_EMAILS'],
21 - authConfigId: 'ac_GHetipM5x5s0',
22 - },
23 - ],
24 - { useComposioManagedAuth: true }
25 -);
26 -
27 -console.log(`✅ MCP server created: ${mcpConfig.id}`);
28 -console.log(`🔧 Available toolkits: ${mcpConfig.toolkits.join(', ')}`);
29 -
30 -// Retrieve server URLs for connected accounts
31 -const mcpTools = await mcpConfig.getServer({
32 - userId: "sid"
33 -});
34 -
35 -console.log('MCP Tools:', mcpTools);
36 -
37 -const completion = await openai.responses.create({
38 - model: 'gpt-4o-mini',
39 - input:
40 - "I've connected to Gmail and I want to fetch the latest email from my inbox and summarize it",
41 - tools: mcpTools,
42 -});
43 -
44 -console.log('\n📬 Email Summary:');
45 -console.log(completion.output_text);
46 -
47 -console.log('\n✅ OpenAI MCP example completed successfully!');
48 -console.log(
49 - '\n💡 Note: The MCP server URLs can also be used to connect from other MCP-compatible clients.'
50 -);
51 -console.log(`📍 Server ID for future reference: ${mcpConfig.id}`);
fern/snippets/providers/python/anthropic.py deleted
-6
@@ -1,6 +0,0 @@
1 -from composio import Composio
2 -
3 -# Initialize Composio client
4 -composio = Composio()
5 -
6 -# TODO: Add your code here
fern/snippets/providers/typescript/anthropic.ts deleted
-32
@@ -1,32 +0,0 @@
1 -import { Composio } from '@composio/core';
2 -import { AnthropicProvider } from '@composio/anthropic';
3 -import { Anthropic } from '@anthropic-ai/sdk';
4 -
5 -const composio = new Composio({
6 - provider: new AnthropicProvider({
7 - cacheTools: false, // default
8 - }),
9 -});
10 -
11 -const anthropic = new Anthropic();
12 -
13 -const userId = 'user@acme.com';
14 -const tools = await composio.tools.get(userId, {
15 - tools: ['GITHUB_GET_OCTOCAT', 'GITHUB_GET_THE_ZEN_OF_GITHUB'],
16 -});
17 -
18 -const msg = await anthropic.messages.create({
19 - model: 'claude-3-5-sonnet-20240620',
20 - messages: [
21 - {
22 - role: 'user',
23 - content: 'Get me the GitHub Octocat',
24 - },
25 - ],
26 - tools: tools,
27 - max_tokens: 1000,
28 -});
29 -
30 -const res = await composio.provider.handleToolCalls(userId, msg);
31 -
32 -console.log(JSON.parse(res[0]).details);
fern/snippets/tool-calling/python/callback-url.py deleted
-16
@@ -1,16 +0,0 @@
1 -from composio import Composio
2 -from composio.types import auth_scheme
3 -
4 -# Initialize Composio client
5 -composio = Composio()
6 -linear_auth_config_id = "ac_dqYN9oElNVlg"
7 -user_id = "0000-1111-2222"
8 -
9 -# Create a new connected account
10 -connection_request = composio.connected_accounts.initiate(
11 - user_id=user_id, auth_config_id=linear_auth_config_id, config=auth_scheme.oauth2()
12 -)
13 -print(connection_request.redirect_url)
14 -
15 -# Wait for the connection to be established
16 -connected_account = connection_request.wait_for_connection()
\ No newline at end of file
fern/snippets/tool-calling/python/fetching-tools.py deleted
-6
@@ -1,6 +0,0 @@
1 -from composio import Composio
2 -
3 -# Initialize Composio client
4 -composio = Composio()
5 -
6 -# TODO: Add your code here
fern/snippets/tool-calling/typescript/auth-tools.ts deleted
-50
@@ -1,50 +0,0 @@
1 -import { Composio } from '@composio/core';
2 -
3 -const composio = new Composio();
4 -const linearAuthConfigId = 'ac_dqYN9oElNVlg';
5 -
6 -const userId = '1111-2222-3333';
7 -
8 -// Initiate the OAuth connection request
9 -const connRequest = await composio.connectedAccounts.initiate(userId, linearAuthConfigId);
10 -
11 -// Destructure redirectUrl for easier access
12 -const { redirectUrl, id } = connRequest;
13 -console.log(redirectUrl);
14 -
15 -// Wait for the connection to be established
16 -await connRequest.waitForConnection();
17 -
18 -// If you only have the connection request ID, you can also wait using:
19 -// Recommended for when connRequest object is destroyed
20 -await composio.connectedAccounts.waitForConnection(id);
21 -
22 -// API Key based toolkit
23 -
24 -import { AuthScheme } from '@composio/core';
25 -const serpAuthConfigId = 'ac_VWmFEC55Zgv6';
26 -
27 -// Retrieved from the user
28 -const userApiKey = 'sk_1234567890';
29 -
30 -const serpConnectionRequest = await composio.connectedAccounts.initiate(userId, serpAuthConfigId, {
31 - config: AuthScheme.APIKey({
32 - api_key: userApiKey,
33 - }),
34 -});
35 -
36 -console.log(JSON.stringify(serpConnectionRequest, null, 2));
37 -
38 -// Auth scheme for Airtable Bearer
39 -import { AuthScheme } from '@composio/core';
40 -const airtableAuthConfigId = 'ac_1234567890';
41 -
42 -// Retrieved from the user
43 -const userBearerToken = '1234567890';
44 -
45 -const airtableConnectionRequest = await composio.connectedAccounts.initiate(
46 - userId, airtableAuthConfigId, {
47 - config: AuthScheme.BearerToken({
48 - token: userBearerToken,
49 - }),
50 -});
fern/snippets/tool-calling/typescript/callback-url.ts deleted
-20
@@ -1,20 +0,0 @@
1 -import { Composio } from '@composio/core';
2 -import { v4 as uuidv4 } from 'uuid';
3 -
4 -const composio = new Composio();
5 -const linearAuthConfigId = 'ac_dqYN9oElNVlg';
6 -
7 -const userId = uuidv4();
8 -
9 -// Initiate the OAuth connection request
10 -const connRequest = await composio.connectedAccounts.initiate(
11 - userId,
12 - linearAuthConfigId,
13 - {
14 - callbackUrl: 'https://www.yourapp.com/callback',
15 - }
16 -);
17 -
18 -console.log(connRequest.redirectUrl);
19 -
20 -await connRequest.waitForConnection();
fern/snippets/tool-calling/typescript/fetching-tools.ts
fern/snippets/triggers/typescript/quickstart-vercel.ts deleted
-32
@@ -1,32 +0,0 @@
1 -import { Composio } from '@composio/core';
2 -import { generateText } from 'ai';
3 -import { anthropic } from '@ai-sdk/anthropic';
4 -import { VercelProvider } from '@composio/vercel';
5 -import { v4 as uuidv4 } from 'uuid';
6 -
7 -const userId = uuidv4(); // The user's ID.
8 -const composio = new Composio({
9 - apiKey: process.env.COMPOSIO_API_KEY,
10 - provider: new VercelProvider(),
11 -});
12 -
13 -const connection = await composio.toolkits.authorize(userId, 'gmail');
14 -console.log(`🔗 Visit the URL to authorize:\n👉 ${connection.redirectUrl}`);
15 -
16 -await connection.waitForConnection();
17 -
18 -const tools = await composio.tools.get(userId, { tools: ['GMAIL_SEND_EMAIL'] });
19 -
20 -const { text } = await generateText({
21 - model: anthropic('claude-3-7-sonnet-20250219'),
22 - messages: [
23 - {
24 - role: 'user',
25 - content: "say 'hi from the composio quickstart' to soham@composio.dev", // we'll ship you free merch if you do ;)
26 - },
27 - ],
28 - tools,
29 - maxSteps: 1,
30 -});
31 -
32 -console.log(text);
fern/snippets/triggers/typescript/quickstart.ts deleted
-31
@@ -1,31 +0,0 @@
1 -import { Composio } from '@composio/core';
2 -import { AnthropicProvider } from '@composio/anthropic';
3 -import Anthropic from '@anthropic-ai/sdk';
4 -
5 -const anthropic = new Anthropic();
6 -const composio = new Composio({
7 - provider: new AnthropicProvider(),
8 -});
9 -
10 -const userId = 'user@example.com';
11 -const connection = await composio.toolkits.authorize(userId, 'GITHUB');
12 -console.log(`🔗 Visit the URL to authorize:\n👉 ${connection.redirectUrl}`);
13 -
14 -const tools = await composio.tools.get(userId, {
15 - tools: ['GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER'],
16 -});
17 -await connection.waitForConnection();
18 -const msg = await anthropic.messages.create({
19 - model: 'claude-3-7-sonnet-latest',
20 - tools: tools,
21 - messages: [
22 - {
23 - role: 'user',
24 - content: 'Star the composiohq/composio repository',
25 - },
26 - ],
27 - max_tokens: 1024,
28 -});
29 -
30 -const result = await composio.provider.handleToolCalls(userId, msg);
31 -console.log('✅ Tool results:', result);