Skip to content

Sandbox

Source: src/client/sandbox.ts

Sandbox(client: Leap0Client, data: SandboxData)

Bound sandbox handle with convenience methods and resource-scoped helpers.

  • Leap0Error: If API requests or response validation fail.
async refresh(): Promise<this>

Fetches the latest sandbox state from the API.

  • The refreshed sandbox handle.
  • Leap0Error: If fetching the sandbox fails.
async pause(options?: { timeout?: number }): Promise<this>

Pauses the sandbox and updates local state.

  • options: Optional request settings.
  • The paused sandbox handle.
  • Leap0Error: If pausing the sandbox fails.
async delete(options?: { timeout?: number }): Promise<void>

Deletes the sandbox.

  • options: Optional request settings.
  • Leap0Error: If deleting the sandbox fails.
invokeUrl(path = "/", port?: number): string

Returns the public invoke URL for the sandbox.

  • path: Route path to append.
  • port: Optional forwarded port.
  • The public HTTPS URL.
websocketUrl(path = "/", port?: number): string

Returns the public websocket URL for the sandbox.

  • path: Route path to append.
  • port: Optional forwarded port.
  • The public websocket URL.