AI agent instructions
AI agent instructions
Prerequisites
Create the connection through your application’s Managed Auth connect flow and retain its connection ID. The API reference describes how to create a connect link. Never expose your Notte API key to the browser.Start a session
Pass up to ten connection IDs inauth_ids when creating a session. By default, the SDK waits for authentication before returning control. See Session Configurations for the parameters.
If you set wait_for_authentication=False in Python or wait_for_authentication: false in TypeScript, the session can be authenticating. Call session.wait_for_auth() in Python or await session.waitForAuth() in TypeScript before browser actions. See Session Lifecycle for session states.
Handle failures
Useauth_retry only for transient login failures, with zero to two additional retries. Expired credentials or a connection that needs user interaction require recovery through the connection flow. Avoid creating replacement sessions repeatedly when the underlying connection needs attention.
Stop the session when you finish by using Python’s context manager or TypeScript’s session.use(). A timeout while waiting does not mean that the session was automatically stopped.