diff --git a/src/images/providers/dark/scalekit.svg b/src/images/providers/dark/scalekit.svg new file mode 100644 index 0000000000..b91d4bd71f --- /dev/null +++ b/src/images/providers/dark/scalekit.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/images/providers/light/scalekit.svg b/src/images/providers/light/scalekit.svg new file mode 100644 index 0000000000..d1ee3b73a4 --- /dev/null +++ b/src/images/providers/light/scalekit.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/images/providers/scalekit-icon.svg b/src/images/providers/scalekit-icon.svg new file mode 100644 index 0000000000..356bd42c3d --- /dev/null +++ b/src/images/providers/scalekit-icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/oss/python/integrations/tools/index.mdx b/src/oss/python/integrations/tools/index.mdx index 38f0eac36d..0c4fdf4995 100644 --- a/src/oss/python/integrations/tools/index.mdx +++ b/src/oss/python/integrations/tools/index.mdx @@ -84,6 +84,7 @@ The following platforms provide access to multiple tools and services through a | Tool/Toolkit | Number of Integrations | Pricing | Key Features | |-------------|----------------------|---------|--------------| | [Composio](/oss/integrations/tools/composio) | 500+ | Free tier available | OAuth handling, event-driven workflows, multi-user support | +| [Scalekit](/oss/integrations/tools/scalekit) | 80+ | Free tier available | Delegated OAuth, token vault, multi-user support, LangSmith tracing | ## All tools and toolkits @@ -150,6 +151,8 @@ The following platforms provide access to multiple tools and services through a + + diff --git a/src/oss/python/integrations/tools/scalekit.mdx b/src/oss/python/integrations/tools/scalekit.mdx new file mode 100644 index 0000000000..04fb11949b --- /dev/null +++ b/src/oss/python/integrations/tools/scalekit.mdx @@ -0,0 +1,228 @@ +--- +title: "Scalekit integration" +description: "Integrate with 80+ prebuilt OAuth connectors through Scalekit AgentKit using LangChain Python." +--- + +[Scalekit](https://scalekit.com) AgentKit is an integration platform that provides 80+ prebuilt OAuth connectors for services like Gmail, Slack, GitHub, Salesforce, and more. It gives AI agents authenticated access to external tools through delegated OAuth, a managed token vault, and a native LangChain adapter that returns `StructuredTool` objects. + +## Overview + +### Integration details + +| Class | Package | Serializable | JS support | Version | +|:---|:---|:---:|:---:|:---:| +| ScalekitClient | [`scalekit-sdk-python`](https://pypi.org/project/scalekit-sdk-python/) | ❌ | ❌ | ![PyPI - Version](https://img.shields.io/pypi/v/scalekit-sdk-python?style=flat-square&label=%20) | + +### Tool features + +- **80+ prebuilt connectors**: Gmail, Slack, GitHub, Salesforce, Jira, HubSpot, Linear, Notion, and more +- **Delegated OAuth**: Scalekit manages the full OAuth flow, token refresh, and credential storage +- **Multi-user support**: Scope tools per user via the `identifier` parameter +- **Connector filtering**: Load tools by `connection_names`, `tool_names`, or `providers` +- **LangSmith compatible**: Works with [LangSmith](/langsmith/home) tracing out of the box + +## Setup + +The integration lives in the `scalekit-sdk-python` package. The LangChain adapter is included and lazy-loaded when you access `actions.langchain`. + + +```python pip +pip install -U scalekit-sdk-python langchain +``` +```python uv +uv add scalekit-sdk-python langchain +``` + + +### Credentials + +You need Scalekit API credentials. Sign up at [app.scalekit.com](https://app.scalekit.com) and find your credentials under **Settings** and **API Credentials**. + +```python Set credentials icon="key" +import getpass +import os + +if not os.environ.get("SCALEKIT_ENVIRONMENT_URL"): + os.environ["SCALEKIT_ENVIRONMENT_URL"] = getpass.getpass("Enter your Scalekit environment URL: ") + +if not os.environ.get("SCALEKIT_CLIENT_ID"): + os.environ["SCALEKIT_CLIENT_ID"] = getpass.getpass("Enter your Scalekit client ID: ") + +if not os.environ.get("SCALEKIT_CLIENT_SECRET"): + os.environ["SCALEKIT_CLIENT_SECRET"] = getpass.getpass("Enter your Scalekit client secret: ") +``` + +It's also helpful to set up [LangSmith](/langsmith/home) for tracing: + +```python Enable tracing icon="flask" +# os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ") +# os.environ["LANGSMITH_TRACING"] = "true" +``` + +## Instantiation + +Initialize `ScalekitClient` and load tools via `actions.langchain.get_tools()`. Each tool is a native LangChain `StructuredTool` with name, description, and input schema populated from the connector definition. + +```python Initialize Scalekit icon="robot" +import scalekit.client + +client = scalekit.client.ScalekitClient( + env_url=os.environ["SCALEKIT_ENVIRONMENT_URL"], + client_id=os.environ["SCALEKIT_CLIENT_ID"], + client_secret=os.environ["SCALEKIT_CLIENT_SECRET"], +) + +# Load Gmail tools for a specific user +tools = client.actions.langchain.get_tools( + identifier="user_123", + connection_names=["gmail"], +) + +print(f"Loaded {len(tools)} tools") +``` + +### Filter tools + +You can filter tools by connector, tool name, or provider: + +```python Filter tools icon="filter" +# Load tools from multiple connectors +tools = client.actions.langchain.get_tools( + identifier="user_123", + connection_names=["gmail", "slack"], +) + +# Load specific tools by name +tools = client.actions.langchain.get_tools( + identifier="user_123", + tool_names=["gmail_fetch_mails", "gmail_send_email"], +) + +# Load all tools for a user (across all active connectors) +all_tools = client.actions.langchain.get_tools( + identifier="user_123", +) +``` + +## Invocation + +### Directly + +```python Call tool icon="rocket" +tool = tools[0] +tool.invoke({"max_results": 5}) +``` + +### As a ToolCall + +Invoke the tool with a model-generated `ToolCall`, in which case a @[`ToolMessage`] will be returned: + +```python ToolCall icon="briefcase" +# This is usually generated by a model, but we'll create a tool call directly for demo purposes. +model_generated_tool_call = { + "args": {"max_results": 5}, + "id": "1", + "name": tool.name, + "type": "tool_call", +} +tool.invoke(model_generated_tool_call) +``` + +### Within an agent + +Use Scalekit tools in an agent. For this you need a model with tool-calling capabilities. + +```python Agent with Scalekit tools icon="robot" +# pip install -qU "langchain[openai]" to call the model +from langchain.agents import create_agent + +agent = create_agent( + model="claude-sonnet-4-6", + tools=tools, +) + +# Run the agent +agent.invoke( + {"messages": [{"role": "user", "content": "Fetch my last 5 unread emails and summarize them"}]} +) +``` + +## Authentication setup + +Before loading tools, users must connect their accounts through OAuth. Scalekit manages the full OAuth flow: + +```python Connect a user account icon="key" +# Check if user already has an active Gmail connection +response = client.actions.get_or_create_connected_account( + connection_name="gmail", + identifier="user_123", +) + +if response.connected_account.status != "ACTIVE": + # Get an authorization link for the user to complete OAuth + link = client.actions.get_authorization_link( + connection_name="gmail", + identifier="user_123", + ) + print(f"Authorize Gmail: {link.link}") +``` + +See [Authorize a user](https://docs.scalekit.com/agentkit/tools/authorize/) for production authorization handling. + +## Multi-user scenarios + +Scalekit supports multi-user applications. Each user authenticates their own accounts, and tools are scoped per user via the `identifier` parameter: + +```python Multi-user tools icon="users" +# Each user gets tools scoped to their own connected accounts +tools_user_1 = client.actions.langchain.get_tools( + identifier="user_1", + connection_names=["gmail"], +) + +tools_user_2 = client.actions.langchain.get_tools( + identifier="user_2", + connection_names=["gmail"], +) + +# User 1's agent acts on User 1's Gmail account +agent_1 = create_agent(model="claude-sonnet-4-6", tools=tools_user_1) + +# User 2's agent acts on User 2's Gmail account +agent_2 = create_agent(model="claude-sonnet-4-6", tools=tools_user_2) +``` + +## Use MCP instead + +LangChain also supports Scalekit via MCP using `langchain-mcp-adapters`. Scalekit can generate per-user MCP URLs that provide authenticated tool access through the Model Context Protocol. + +See [Generate user MCP URLs](https://docs.scalekit.com/agentkit/mcp/generate-user-urls/) for details. + +## Available connectors + +Scalekit provides 80+ prebuilt OAuth connectors: + +**Productivity**: Gmail, Google Calendar, Google Drive, Google Docs, Google Sheets, Notion, Confluence, Trello, Asana, ClickUp, Monday, Airtable + +**Communication**: Slack, Microsoft Teams, Discord, Zoom, Outlook + +**Development**: GitHub, GitLab, Bitbucket, Linear, Jira, Vercel, PagerDuty + +**CRM and Sales**: Salesforce, HubSpot, Pipedrive, Close, Outreach, Apollo, Attio, Affinity + +**Finance**: QuickBooks, Xero + +**Analytics and Data**: BigQuery, Snowflake, Datadog, Tableau, PostHog + +**Support**: Zendesk, Freshdesk, Intercom, ServiceNow + +**And more...** + +See the [full connector catalog](https://docs.scalekit.com/agentkit/connectors/) for the complete list. + +## API reference + +For detailed documentation of all Scalekit AgentKit features and configurations, visit: +- [AgentKit overview](https://docs.scalekit.com/agentkit/overview/) +- [LangChain example](https://docs.scalekit.com/agentkit/examples/langchain/) +- [Connectors reference](https://docs.scalekit.com/agentkit/connectors/) \ No newline at end of file