Managing multiple accounts
Users can connect multiple accounts for the same toolkit (e.g., personal and work Gmail accounts). This is useful when users need to manage different email accounts, GitHub organizations, or separate work and personal contexts. This guide explains how to connect, select, and manage multiple accounts.
Default account behavior
When multiple accounts are connected for the same toolkit:
- Each session can only use one account per toolkit at a time
- Tool Router uses the most recently connected account by default
- You can override this by explicitly selecting an account
- Each account maintains its own authentication and permissions
Connecting multiple accounts
Call session.authorize() multiple times for the same toolkit. Each authorization creates a separate connected account with its own ID. The most recently connected account becomes the active one for that session. New sessions will also use the most recent account unless you explicitly select a different one.
Store the account IDs returned after connection to explicitly select accounts later.
Selecting a specific account for a session
Each Tool Router session can only use one account per toolkit at a time. To use a specific account in a session, pass it in the session config:
Listing all user accounts
To list all accounts a user has connected (not just the active one), see List accounts.
Viewing session’s active account
Use session.toolkits() to see which account is currently active in the session: