@devries-cameron20 / composio Mirror · read-only / commits / 313efbab9
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, 23:15 UTC

docs: add how to specify scopes in auth configs

balyan.sid@gmail.com committed Jun 30, 2025 at 19:51 UTC 313efbab9fa24288f5dc2fdc3541f29d86d25610
5 files changed +59 -7
fern/docs.yml
+1 -1
@@ -7,7 +7,7 @@ instances:
7 repo: composio
8 branch: master
9 title: Composio Docs
10 -default-language: typescript
10 +default-language: python
11 logo:
12 light: assets/logo.svg
13 dark: assets/logo-dark.svg
fern/pages/src/authentication/programmatic-auth-configs.mdx
+25 -2
@@ -42,12 +42,35 @@ const authConfig = await composio.authConfigs.create("LINEAR", {
42
43 console.log(authConfig);
44 ```
45 -</CodeGroup>
46 -
45
46 The `auth_config_id` should be stored securely in your database for future use to be created and destroyed multiple times.
47
48 You can also provide your own authentication details. The required `credentials` and `authScheme` depend on the auth type.
49 +</CodeGroup>
50 +
51 +## Specifying scopes for OAuth2
52 +Composio requests a set of _good_ default OAuth2 scopes for each toolkit wherever possible. However, you can override or modify these scopes by passing a `scopes` field to the `credentials` object.
53 +
54 +<CodeGroup>
55 +<SnippetCode
56 + src="fern/snippets/authentication/python/define-scopes.py"
57 + title="Python"
58 + startLine={1}
59 + endLine={17}
60 + highlightStart={11}
61 + highlightEnd={13}
62 +/>
63 +
64 +<SnippetCode
65 + src="fern/snippets/authentication/typescript/define-scopes.ts"
66 + title="TypeScript"
67 + startLine={1}
68 + endLine={17}
69 + highlightStart={8}
70 + highlightEnd={10}
71 +/>
72 +</CodeGroup>
73 +
74
75 ## Using Custom Auth
76 ### Create the auth config
fern/snippets/authentication/python/define-scopes.py new
+17
@@ -0,0 +1,17 @@
1 +from composio import Composio
2 +
3 +composio = Composio()
4 +
5 +response = composio.auth_configs.create(
6 + toolkit="HUBSPOT",
7 + options={
8 + "name": "HubspotConfig",
9 + "authScheme": "OAUTH2",
10 + "type": "use_composio_managed_auth",
11 + "credentials": {
12 + "scopes": "sales-email-read,tickets"
13 + }
14 + }
15 +)
16 +
17 +print(response.id)
\ No newline at end of file
fern/snippets/authentication/typescript/define-scopes.ts new
+13
@@ -0,0 +1,13 @@
1 +import { Composio } from "@composio/core";
2 +
3 +const composio = new Composio();
4 +
5 +const authConfig = await composio.authConfigs.create("HUBSPOT", {
6 + name: "HubspotConfig",
7 + type: "use_composio_managed_auth",
8 + credentials: {
9 + scopes: "sales-email-read,tickets",
10 + },
11 +});
12 +
13 +console.log(authConfig);
\ No newline at end of file
fern/turbo.json
+3 -4
@@ -4,7 +4,7 @@
4 "tasks": {
5 "build": {
6 "dependsOn": ["api:pull", "add-og", "snippets:build", "tools:generate", "sdkdocs"],
7 - "outputs": ["pages/*.mdx", "tools/*.mdx", "pages/**"],
7 + "outputs": ["apis/openapi.yml", "apis/openapi-mcp.json", "pages/dist/**", "tools/**"],
8 "cache": true
9 },
10
@@ -21,14 +21,13 @@
21
22 "add-og": {
23 "dependsOn": ["^build"],
24 - "outputs": ["pages/**/*.mdx"],
24 "inputs": ["scripts/add_og_imgs.py", "pages/**/*.mdx"],
26 - "cache": true
25 + "cache": false
26 },
27
28 "snippets:build": {
29 "dependsOn": ["^build"],
31 - "outputs": ["pages/**"],
30 + "outputs": ["pages/dist/**"],
31 "inputs": ["scripts/build-snippets.ts", "snippets/**", "docs/**"],
32 "cache": true
33 },