@devries-cameron20 / composio Mirror · read-only / commits / 1673d7938
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 22, 22:00 UTC

chore: update composio package versions and clean up template imports

- Updated the version of the composio package from 0.8.1 to 0.8.5 in the uv.lock file. - Removed unused imports of auth_scheme from Python and TypeScript templates for cleaner code. - Adjusted the auth config ID format in TypeScript templates for consistency.

balyan.sid@gmail.com committed Jul 29, 2025 at 15:23 UTC 1673d79383e1549576762e5f6a47d81ed75f1afd
8 files changed +35 -40
fern/generators/tool_doc_generator/templates/python/api_key.py
-1
@@ -1,5 +1,4 @@
1 from composio import Composio
2 -from composio.types import auth_scheme
2
3 # Replace these with your actual values
4 {{toolkit_slug}}_auth_config_id = "{{auth_config_id|default:'ac_YOUR_AUTH_CONFIG_ID'}}" # Auth config ID created above
fern/generators/tool_doc_generator/templates/python/bearer_token.py
-1
@@ -1,5 +1,4 @@
1 from composio import Composio
2 -from composio.types import auth_scheme
2
3 # Auth config ID created above
4 {{toolkit_slug}}_auth_config_id = "{{auth_config_id|default:'ac_YOUR_AUTH_CONFIG_ID'}}"
fern/generators/tool_doc_generator/templates/python/oauth2.py
-1
@@ -1,5 +1,4 @@
1 from composio import Composio
2 -from composio.types import auth_scheme
2
3 # Replace these with your actual values
4 {{toolkit_slug}}_auth_config_id = "{{auth_config_id|default:'ac_YOUR_AUTH_CONFIG_ID'}}" # Auth config ID created above
fern/generators/tool_doc_generator/templates/typescript/api_key.ts
+10 -11
@@ -1,7 +1,7 @@
1 import { Composio } from '@composio/core';
2 -
2 +import { AuthScheme } from '@composio/core';
3 // Replace these with your actual values
4 -const {{toolkit_slug}}_auth_config_id = "{{auth_config_id|default:'ac_YOUR_AUTH_CONFIG_ID'}}"; // Auth config ID created above
4 +const {{toolkit_slug}}_auth_config_id = "ac_YOUR_{{toolkit_slug|upper}}_CONFIG_ID"; // Auth config ID created above
5 const userId = "{{user_id|default:'user@example.com'}}"; // User ID from database/application
6
7 const composio = new Composio();
@@ -10,18 +10,17 @@ async function authenticateToolkit(userId: string, authConfigId: string) {
10 // TODO: Replace this with a method to retrieve the API key from the user.
11 // In production, this should be securely retrieved from your database or user input.
12 // For example: const userApiKey = await getUserApiKey(userId);
13 - const userApiKey = "{{api_key_placeholder|default:'your_api_key_here'}}"; // Replace with actual API key
13 + const userApiKey = "your_{{toolkit_slug}}_api_key"; // Replace with actual API key
14
15 - const connectionRequest = await composio.connectedAccounts.initiate({
16 - userId: userId,
17 - authConfigId: authConfigId,
18 - config: {
19 - authScheme: "API_KEY",
20 - config: {
15 + const connectionRequest = await composio.connectedAccounts.initiate(
16 + userId,
17 + authConfigId,
18 + {
19 + config: AuthScheme.APIKey({
20 api_key: userApiKey
22 - }
21 + })
22 }
24 - });
23 + );
24
25 // API Key authentication is immediate - no redirect needed
26 console.log(`Successfully connected {{toolkit_name}} for user ${userId}`);
fern/generators/tool_doc_generator/templates/typescript/bearer_token.ts
+10 -11
@@ -1,7 +1,7 @@
1 import { Composio } from '@composio/core';
2 -
2 +import { AuthScheme } from '@composio/core';
3 // Replace these with your actual values
4 -const {{toolkit_slug}}_auth_config_id = "{{auth_config_id|default:'ac_YOUR_AUTH_CONFIG_ID'}}"; // Auth config ID created above
4 +const {{toolkit_slug}}_auth_config_id = "ac_YOUR_{{toolkit_slug|upper}}_CONFIG_ID"; // Auth config ID created above
5 const userId = "{{user_id|default:'user@example.com'}}"; // User ID from database/application
6
7 const composio = new Composio();
@@ -10,18 +10,17 @@ async function authenticateToolkit(userId: string, authConfigId: string) {
10 // TODO: Replace this with a method to retrieve the Bearer Token from the user.
11 // In production, this should be securely retrieved from your database or user input.
12 // For example: const bearerToken = await getUserBearerToken(userId);
13 - const bearerToken = "{{bearer_token_placeholder|default:'your_bearer_token_here'}}"; // Replace with actual bearer token
13 + const bearerToken = "your_{{toolkit_slug}}_bearer_token"; // Replace with actual bearer token
14
15 - const connectionRequest = await composio.connectedAccounts.initiate({
16 - userId: userId,
17 - authConfigId: authConfigId,
18 - config: {
19 - authScheme: "BEARER_TOKEN",
20 - config: {
15 + const connectionRequest = await composio.connectedAccounts.initiate(
16 + userId,
17 + authConfigId,
18 + {
19 + config: AuthScheme.BearerToken({
20 token: bearerToken
22 - }
21 + })
22 }
24 - });
23 + );
24
25 // Bearer token authentication is immediate - no redirect needed
26 console.log(`Successfully connected {{toolkit_name}} for user ${userId}`);
fern/generators/tool_doc_generator/templates/typescript/oauth2.ts
+5 -5
@@ -1,16 +1,16 @@
1 import { Composio } from '@composio/core';
2
3 // Replace these with your actual values
4 -const {{toolkit_slug}}_auth_config_id = "{{auth_config_id|default:'ac_YOUR_AUTH_CONFIG_ID'}}"; // Auth config ID created above
4 +const {{toolkit_slug}}_auth_config_id = "ac_YOUR_{{toolkit_slug|upper}}_CONFIG_ID"; // Auth config ID created above
5 const userId = "{{user_id|default:'user@example.com'}}"; // User ID from database/application
6
7 const composio = new Composio();
8
9 async function authenticateToolkit(userId: string, authConfigId: string) {
10 - const connectionRequest = await composio.connectedAccounts.initiate({
11 - userId: userId,
12 - authConfigId: authConfigId,
13 - });
10 + const connectionRequest = await composio.connectedAccounts.initiate(
11 + userId,
12 + authConfigId
13 + );
14
15 console.log(`Visit this URL to authenticate {{toolkit_name}}: ${connectionRequest.redirectUrl}`);
16
fern/package.json
+1 -1
@@ -20,7 +20,7 @@
20 "snippets:dev": "bun watch scripts/build-snippets.ts --watch",
21 "add-og": "uv run scripts/add_og_imgs.py",
22 "check": "fern check",
23 - "dev": "bun run scripts/build-snippets.ts && (bun run scripts/build-snippets.ts --watch & fern docs dev) && pnpm css:watch",
23 + "dev": "bun run scripts/build-snippets.ts && (bun run scripts/build-snippets.ts --watch & fern docs dev)",
24 "dev:docs": "fern docs dev",
25 "links": "fern docs broken-links",
26 "build": "echo 'Build orchestrated by Turbo'",
uv.lock
+9 -9
@@ -467,7 +467,7 @@ wheels = [
467
468 [[package]]
469 name = "composio"
470 -version = "0.8.1"
470 +version = "0.8.5"
471 source = { virtual = "python" }
472 dependencies = [
473 { name = "composio-client" },
@@ -514,7 +514,7 @@ dev = [
514
515 [[package]]
516 name = "composio-anthropic"
517 -version = "0.8.1"
517 +version = "0.8.5"
518 source = { virtual = "python/providers/anthropic" }
519 dependencies = [
520 { name = "anthropic" },
@@ -546,7 +546,7 @@ wheels = [
546
547 [[package]]
548 name = "composio-crewai"
549 -version = "0.8.1"
549 +version = "0.8.5"
550 source = { virtual = "python/providers/crewai" }
551 dependencies = [
552 { name = "composio" },
@@ -561,7 +561,7 @@ requires-dist = [
561
562 [[package]]
563 name = "composio-gemini"
564 -version = "0.8.1"
564 +version = "0.8.5"
565 source = { virtual = "python/providers/gemini" }
566 dependencies = [
567 { name = "composio" },
@@ -576,7 +576,7 @@ requires-dist = [
576
577 [[package]]
578 name = "composio-google"
579 -version = "0.8.1"
579 +version = "0.8.5"
580 source = { virtual = "python/providers/google" }
581 dependencies = [
582 { name = "composio" },
@@ -591,7 +591,7 @@ requires-dist = [
591
592 [[package]]
593 name = "composio-google-adk"
594 -version = "0.8.1"
594 +version = "0.8.5"
595 source = { virtual = "python/providers/google_adk" }
596 dependencies = [
597 { name = "composio" },
@@ -606,7 +606,7 @@ requires-dist = [
606
607 [[package]]
608 name = "composio-langchain"
609 -version = "0.8.1"
609 +version = "0.8.5"
610 source = { virtual = "python/providers/langchain" }
611 dependencies = [
612 { name = "composio" },
@@ -621,7 +621,7 @@ requires-dist = [
621
622 [[package]]
623 name = "composio-openai"
624 -version = "0.8.1"
624 +version = "0.8.5"
625 source = { virtual = "python/providers/openai" }
626 dependencies = [
627 { name = "composio" },
@@ -636,7 +636,7 @@ requires-dist = [
636
637 [[package]]
638 name = "composio-openai-agents"
639 -version = "0.8.1"
639 +version = "0.8.5"
640 source = { virtual = "python/providers/openai_agents" }
641 dependencies = [
642 { name = "composio" },