Skip to main content
Triggers allow functions to be invoked automatically when certain events occur. The III SDK provides types for configuring triggers and implementing trigger handlers.

TriggerConfig

Configuration passed to a trigger handler when a trigger is registered.

Fields

string
required
Unique identifier for this trigger instance.
string
required
The function to invoke when the trigger fires.
TConfig
required
Custom configuration specific to this trigger type.

TriggerHandler

Interface for implementing custom trigger types.

Methods

function
required
Called when a trigger of this type is registered. Should set up the necessary resources or listeners.
function
required
Called when a trigger is unregistered. Should clean up resources and stop listeners.

RegisterTriggerMessage

Message format for registering a trigger with the engine.

Fields

string
required
Unique identifier for this trigger instance (auto-generated).
string
required
The trigger type identifier (e.g., "http", "cron", "custom::event").
string
required
The function to invoke when this trigger fires.
any
required
Configuration specific to the trigger type.

Example: Custom Trigger Type