Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
mdx 91 lines 4.02 KB
Raw
1 ---
2 title: "Introducing Composio Auth Links"
3 description: "Hosted authentication solution that eliminates the need for custom auth forms"
4 date: "2025-09-15"
5 ---
6
7 Composio Auth Links provide a **hosted authentication solution** that eliminates the need for developers to build custom authentication forms. Instead of manually rendering OAuth consent screens, API key input forms, or custom authentication fields, developers can simply redirect users to a Composio-hosted URL that handles the entire authentication process automatically.
8
9 ### Why Use Auth Links?
10
11 - **Zero UI Development**: No need to build forms for OAuth, API keys, or custom fields like subdomains
12 - **Universal Authentication**: Works seamlessly across all supported third-party services
13 - **Reduced Complexity**: Replace complex OAuth flows with a simple redirect
14 - **Better UX**: Professional, consistent authentication experience for end users
15 - **Faster Integration**: Get authentication working in minutes, not hours
16
17 ---
18
19 ### Python SDK (v0.8.11)
20
21 **Added**
22
23 - **Composio Connect Link Support**: New `link()` method for creating external authentication links
24 - Added `link()` method to `ConnectedAccounts` class for generating user authentication links
25 - Support for callback URL redirection after authentication
26 - Enhanced user experience with external link-based authentication flow
27 - **No manual form rendering required** - Composio handles all authentication UI
28
29 **Examples:**
30
31 ```python
32 # Basic usage - create a connection request
33 connection_request = composio.connected_accounts.link('user_123', 'auth_config_123')
34 redirect_url = connection_request.redirect_url
35 print(f"Visit: {redirect_url} to authenticate your account")
36
37 # Wait for the connection to be established
38 connected_account = connection_request.wait_for_connection()
39
40 # With callback URL
41 connection_request = composio.connected_accounts.link(
42 'user_123',
43 'auth_config_123',
44 callback_url='<https://your-app.com/callback>'
45 )
46
47 ```
48
49 ### TypeScript SDK (v0.1.51)
50
51 **Added**
52
53 - **Composio Connect Links**: Added support for composio connect links
54 - New `link()` method in `ConnectedAccounts` class for generating authentication URLs
55 - Support for callback URL redirection with `CreateConnectedAccountLinkOptions`
56 - Comprehensive TypeScript types and validation for link creation options
57 - **Eliminates need for custom authentication forms** - just redirect users to the link
58
59 **Examples:**
60
61 ```tsx
62 // @noErrors
63 // Basic usage - create a connection request
64 const connectionRequest = await composio.connectedAccounts.link('user_123', 'auth_config_123');
65 const redirectUrl = connectionRequest.redirectUrl;
66 console.log(`Visit: ${redirectUrl} to authenticate your account`);
67
68 // Wait for the connection to be established
69 const connectedAccount = await connectionRequest.waitForConnection();
70
71 // With callback URL
72 const connectionRequest = await composio.connectedAccounts.link('user_123', 'auth_config_123', {
73 callbackUrl: '<https://your-app.com/callback>'
74 });
75
76 ```
77
78 ### Key Benefits
79
80 - **No Form Building**: Composio handles OAuth consent, API key collection, and custom field inputs
81 - **Hosted Authentication Flow**: Professional UI that works across all supported services
82 - **Callback URL Support**: Control where users return after successful authentication
83 - **Connection Waiting**: Built-in polling to detect when authentication completes
84 - **Cross-Platform Consistency**: Identical developer experience across Python and TypeScript
85
86 ### Customisation
87
88 You can customise the app logo and name showed in the authentication page via the dashboard. Head over your project via `dashboard.composio.dev` and choose Settings → Auth Links to upload a new logo and change the name.
89
90 ### Migration Note
91 This feature replaces manual authentication form development with a simple redirect-based approach, significantly reducing integration time and complexity while providing a better user experience. Auth links are drop in replacement for `composio.connectedAccounts.initate`, you can safely swap this to `composio.connectedAccounts.link`