Skip to main content

Install and create a client

The API key controls sandbox lifecycle. Keep it out of the process being tested.

Create from explicit state

createSession waits until every environment is ready. If readiness fails, it attempts to destroy the new sandbox before returning the original error. Use startSession when you need the sandbox ID immediately, then call waitUntilReady.

Call a provider-shaped endpoint

callEnvironment reads the connection from the sandbox, removes any caller provider authorization, and applies the returned scoped credential headers. It rejects paths that leave the environment base URL.

State

A diff always requires the explicit prior JSON state. It does not infer the reset baseline.

Longer work

renewSession refreshes expiry and scoped connections. manageSessionLease can renew before the nearest lease boundary and refresh credentials. Stopping a managed lease stops its renewal timer, but does not destroy the sandbox. Read the returned hardExpiresAt instead of assuming one plan-wide maximum.

Common client methods

  • listEnvironments and describeEnvironment
  • listSessions, startSession, createSession, and getSession
  • waitUntilReady, its awaitSessionReady alias, and waitUntilDestroyed
  • validateState, getState, loadState, and diffState
  • callEnvironment and getEvidence
  • resetEnvironment, resetSession, and renewSession
  • manageSessionLease and destroySession