Browser Sessions
Session Management
Learn how Notte manages sessions, billing, and timeouts.
Session Management
Notte uses sessions to maintain browser states and manage interactions. Each session is uniquely identified and must be explicitly started and closed using the SDK or REST API.
Key Points
- Session Lifecycle:
- Start a session using
client.start()
. - Close a session using
client.close()
.
- Start a session using
- Reusing Sessions: By default, sessions are set to
keep_alive=False
, allowing them to be reused within their timeout period. - Session Limits: Only one session can be active per client instance when using the SDK.
Example
Billing Management
Billing is based on API usage and session activity. Each API call contributes to usage metrics, which are billed according to your selected plan.
Key Points:
- Billing Units:
- Actions like
observe
,scrape
, andstep
consume API credits. - Credits are deducted based on the complexity of the operation.
- Actions like
- Plan Details: Billing rates and limits are available on the Billing Dashboard.
- Usage Tracking: Monitor usage and remaining credits in real-time on the Usage Dashboard.
Example
Timeout Management
Timeouts ensure sessions are terminated after a predefined period of inactivity to optimize resource usage and cost.
Key Points
- Default Timeout:
- The default session timeout is 5 minutes.
- Configurable during session start using the
session_timeout
parameter.
- Timeout Behavior:
- Sessions are automatically terminated after the timeout period unless
keep_alive=True
.
- Sessions are automatically terminated after the timeout period unless
Example
Important Notes
- Ensure sessions are explicitly closed to avoid unnecessary billing.
- Monitor timeout settings to prevent premature session termination.