Skip to main content
API reference for the @enclave-vm/client package - the client SDK for EnclaveJS.

Installation

EnclaveClient Class

The main client class for connecting to EnclaveJS brokers.

Constructor

ClientOptions

AuthOptions

ReconnectionOptions

EncryptionOptions

Methods

execute(code, options?)

Execute code with streaming response.
Options:
Example:

executeWithToolHandler(code, toolHandler, options?)

Execute with automatic tool handling.
Example:

getSession(sessionId)

Get session information.

submitToolResult(sessionId, callId, result)

Submit a tool result.

health()

Check broker health.

Event Handling

Event Types

Processing Events

Cancellation

Using AbortController

Authentication

Bearer Token

Dynamic Token

API Key

Encryption

Enable E2E Encryption

Reconnection

Automatic Reconnection

Error Handling

Complete Example

Browser Usage