Skip to main content

Cookbook

Use case 1: Automated testing environments

Create an isolated instance per test run, execute tests against the access_url, then destroy the instance.

Use case 2: On-demand secure browsing sessions

Map an app user/session to an instance_uuid, return access_url to the client, then clean up when the session ends.

Use case 3: Instance pool management

Pre-warm a pool of instances for lower latency, track which are in use, and replenish when the pool drops below a threshold.

Best practices

  • Always clean up instances (timeouts + periodic sweeps).
  • Store API keys securely (server-side only, rotate regularly).
  • Implement retries with backoff for transient errors.
  • Monitor usage and audit logs (/legba/logs).