Skip to main content

Installation

Initialization

Creates and returns a connected SDK instance. The WebSocket connection is established automatically — there is no separate connect() call.

Methods

createChannel

Creates a streaming channel pair for worker-to-worker data transfer. Returns a Channel with a local writer/reader and serializable refs that can be passed as fields in the invocation data to other functions. Signature

Parameters

Example

createStream

Creates a new stream implementation. This overrides the default stream implementation. Signature

Parameters

Example

registerFunction

Registers a new function with a local handler or an HTTP invocation config. Signature

Parameters

Example

registerService

Registers a new service. Signature

Parameters

registerTrigger

Registers a new trigger. A trigger is a way to invoke a function when a certain event occurs. Signature

Parameters

Example

registerTriggerType

Registers a new trigger type. A trigger type is a way to invoke a function when a certain event occurs. Signature

Parameters

Example

shutdown

Gracefully shutdown the iii, cleaning up all resources. Signature

Example

trigger

Invokes a function using a request object. Signature

Parameters

Example

unregisterTriggerType

Unregisters a trigger type. Signature

Parameters

Example

Subpath Exports

The iii-sdk package provides additional entry points:

Types

MessageType · ChannelReader · ChannelWriter · Channel · FunctionRef · InitOptions · RegisterFunctionMessage · RegisterFunctionOptions · RegisterServiceInput · RegisterTriggerInput · RegisterTriggerMessage · RegisterTriggerTypeInput · RegisterTriggerTypeMessage · RemoteFunctionHandler · StreamChannelRef · Trigger · TriggerHandler · TriggerRequest · TriggerTypeRef · IStream · DeleteResult · StreamSetResult · StreamUpdateResult · DeleteResult

MessageType

ChannelReader

Read end of a streaming channel. Uses native browser WebSocket.

ChannelWriter

Write end of a streaming channel. Uses native browser WebSocket.

Channel

A streaming channel pair for worker-to-worker data transfer. Created via ISdk.createChannel.

FunctionRef

Handle returned by ISdk.registerFunction. Contains the function’s id and an unregister() method.

InitOptions

Configuration options passed to registerWorker.

RegisterFunctionMessage

RegisterFunctionOptions

RegisterServiceInput

RegisterTriggerInput

RegisterTriggerMessage

RegisterTriggerTypeInput

RegisterTriggerTypeMessage

RemoteFunctionHandler

Async function handler for a registered function. Receives the invocation payload and returns the result.

StreamChannelRef

Serializable reference to one end of a streaming channel. Can be included in invocation payloads to pass channel endpoints between workers.

Trigger

Handle returned by ISdk.registerTrigger. Use unregister() to remove the trigger from the engine.

TriggerHandler

Handler interface for custom trigger types. Passed to ISdk.registerTriggerType.

TriggerRequest

Request object passed to ISdk.trigger.

TriggerTypeRef

Typed handle returned by ISdk.registerTriggerType. Provides convenience methods to register triggers and functions scoped to this trigger type, so callers don’t need to repeat the type field.

IStream

Interface for custom stream implementations. Passed to ISdk.createStream to override the engine’s built-in stream storage.

DeleteResult

Result of a stream delete operation.

StreamSetResult

Result of a stream set operation.

StreamUpdateResult

Result of a stream update operation.

DeleteResult

Result of a state delete operation.