iii
API Reference

@iii-dev/sdk

Build with iii SDK

Bridge

This is the main class for the iii SDK. It is used to register services, functions, and triggers.

import { Bridge } from '@iii-dev/sdk';

const bridge = new Bridge(process.env.III_BRIDGE_URL ?? 'ws://localhost:49134')

The port to iii is usually ws://localhost:49134 if you're running the iii process locally.

Methods

registerTrigger
(trigger: RegisterTriggerInput) => Trigger
required

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

registerService
(service: RegisterServiceInput) => void
required

Registers a new service. A service is a collection of functions that are related to each other.

registerFunction
(func: RegisterFunctionInput, handler: RemoteFunctionHandler) => void
required

Registers a new function. A function is a unit of work that can be invoked by other services.

invokeFunction
<TInput, TOutput>(function_path: string, data: TInput) => Promise<TOutput>
required

Invokes a function.

invokeFunctionAsync
<TInput>(function_path: string, data: TInput) => void
required

Invokes a function asynchronously.

registerTriggerType
<TConfig>(triggerType: RegisterTriggerTypeInput, handler: TriggerHandler<TConfig>) => void
required

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

unregisterTriggerType
(triggerType: RegisterTriggerTypeInput) => void
required

Unregisters a trigger type.

On this page