Browse documentation

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

RuntimeFrameworkAdapterComplete guide
TypeScriptVercel AI SDKvercelAI()Vercel AI
TypeScriptOpenAI AgentsopenAIAgents()OpenAI Agents
TypeScriptMastramastraAI()Mastra
TypeScriptcaller-owned MCPmcpServer()Local MCP
PythonAgnoagno()Agno
PythonLangChainlangchain()LangChain
PythonOpenAI Agentsopenai_agents()OpenAI Agents
Pythonportable local toolsgeneric()Python SDK

Python

The Python factories share one Result-handling pattern:

Python
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.data

Expected 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.