Documentation
Framework adapters
Choose a shipped adapter after binding one authenticated external user.
Adapters translate canonical definitions into local framework tools. They do not create an Authlane gateway.
Prerequisites
Authenticate the SaaS user on the server, initialize the TypeScript or Python SDK, and install the framework's optional peer.
Implement the workflow
| Runtime | Framework | Adapter | Complete guide |
|---|---|---|---|
| TypeScript | Vercel AI SDK | vercelAI() | Vercel AI |
| TypeScript | OpenAI Agents | openAIAgents() | OpenAI Agents |
| TypeScript | Mastra | mastraAI() | Mastra |
| TypeScript | caller-owned MCP | mcpServer() | Local MCP |
| Python | Agno | agno() | Agno |
| Python | LangChain | langchain() | LangChain |
| Python | OpenAI Agents | openai_agents() | OpenAI Agents |
| Python | portable local tools | generic() | Python SDK |
Python
The Python factories share one Result-handling pattern:
import os
from authlane import Authlane
from authlane.adapters import agno, generic, langchain, openai_agents
with Authlane(api_key=os.environ["AUTHLANE_API_KEY"]) as authlane:
user = authlane.user("user_123")
agno_result = user.tools.list(adapter=agno())
if agno_result.error is not None:
raise RuntimeError(agno_result.error.code)
assert agno_result.data is not None
agno_tools = agno_result.data
langchain_result = user.tools.list(adapter=langchain())
if langchain_result.error is not None:
raise RuntimeError(langchain_result.error.code)
assert langchain_result.data is not None
langchain_tools = langchain_result.data
openai_result = user.tools.list(adapter=openai_agents())
if openai_result.error is not None:
raise RuntimeError(openai_result.error.code)
assert openai_result.data is not None
openai_tools = openai_result.data
portable_result = user.tools.list(adapter=generic())
if portable_result.error is not None:
raise RuntimeError(portable_result.error.code)
assert portable_result.data is not None
portable_tools = portable_result.dataExpected result
The returned object is native to the selected framework and bound to one external user.
Handle errors
Handle the Authlane tuple or Python Result before calling the framework. Framework lifecycle and model calls may still throw according to their own contracts.
Security boundary
Never cache or serialize executable toolsets. Each invocation gets a fresh access-only lease and calls the provider from the SaaS runtime; Authlane receives neither tool input nor provider output.
Next step
Open the complete guide for your selected ecosystem.