Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
docs: add how to specify scopes in auth configs
[email protected]313efbab9fa2
diff --git a/fern/docs.yml b/fern/docs.ymlindex c15e20ecf..9d7fe9268 100644--- a/fern/docs.yml+++ b/fern/docs.yml@@ -7,7 +7,7 @@ instances:repo: composiobranch: mastertitle: Composio Docs-default-language: typescript+default-language: pythonlogo:light: assets/logo.svgdark: assets/logo-dark.svgdiff --git a/fern/pages/src/authentication/programmatic-auth-configs.mdx b/fern/pages/src/authentication/programmatic-auth-configs.mdxindex 563eded0b..4ec204597 100644--- a/fern/pages/src/authentication/programmatic-auth-configs.mdx+++ b/fern/pages/src/authentication/programmatic-auth-configs.mdx@@ -42,12 +42,35 @@ const authConfig = await composio.authConfigs.create("LINEAR", {console.log(authConfig);```-</CodeGroup>-The `auth_config_id` should be stored securely in your database for future use to be created and destroyed multiple times.You can also provide your own authentication details. The required `credentials` and `authScheme` depend on the auth type.+</CodeGroup>++## Specifying scopes for OAuth2+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.++<CodeGroup>+<SnippetCode+ src="fern/snippets/authentication/python/define-scopes.py"+ title="Python"+ startLine={1}+ endLine={17}+ highlightStart={11}+ highlightEnd={13}+/>++<SnippetCode+ src="fern/snippets/authentication/typescript/define-scopes.ts"+ title="TypeScript"+ startLine={1}+ endLine={17}+ highlightStart={8}+ highlightEnd={10}+/>+</CodeGroup>+## Using Custom Auth### Create the auth configdiff --git a/fern/snippets/authentication/python/define-scopes.py b/fern/snippets/authentication/python/define-scopes.pynew file mode 100644index 000000000..415231768--- /dev/null+++ b/fern/snippets/authentication/python/define-scopes.py@@ -0,0 +1,17 @@+from composio import Composio++composio = Composio()++response = composio.auth_configs.create(+ toolkit="HUBSPOT",+ options={+ "name": "HubspotConfig",+ "authScheme": "OAUTH2",+ "type": "use_composio_managed_auth",+ "credentials": {+ "scopes": "sales-email-read,tickets"+ }+ }+)++print(response.id)\ No newline at end of filediff --git a/fern/snippets/authentication/typescript/define-scopes.ts b/fern/snippets/authentication/typescript/define-scopes.tsnew file mode 100644index 000000000..7fa57838f--- /dev/null+++ b/fern/snippets/authentication/typescript/define-scopes.ts@@ -0,0 +1,13 @@+import { Composio } from "@composio/core";++const composio = new Composio();++const authConfig = await composio.authConfigs.create("HUBSPOT", {+ name: "HubspotConfig",+ type: "use_composio_managed_auth",+ credentials: {+ scopes: "sales-email-read,tickets",+ },+});++console.log(authConfig);\ No newline at end of filediff --git a/fern/turbo.json b/fern/turbo.jsonindex e15a5355d..4be77acd7 100644--- a/fern/turbo.json+++ b/fern/turbo.json@@ -4,7 +4,7 @@"tasks": {"build": {"dependsOn": ["api:pull", "add-og", "snippets:build", "tools:generate", "sdkdocs"],- "outputs": ["pages/*.mdx", "tools/*.mdx", "pages/**"],+ "outputs": ["apis/openapi.yml", "apis/openapi-mcp.json", "pages/dist/**", "tools/**"],"cache": true},@@ -21,14 +21,13 @@"add-og": {"dependsOn": ["^build"],- "outputs": ["pages/**/*.mdx"],"inputs": ["scripts/add_og_imgs.py", "pages/**/*.mdx"],- "cache": true+ "cache": false},"snippets:build": {"dependsOn": ["^build"],- "outputs": ["pages/**"],+ "outputs": ["pages/dist/**"],"inputs": ["scripts/build-snippets.ts", "snippets/**", "docs/**"],"cache": true},