Example
The
TriggerClient
should only ever be used in a server-side environment. It is not safe to use
in a browser environment because it exposes your API Key.Constructor
TriggerClient()
Creates a new TriggerClient object.Instance properties
id
A string that uniquely identifies the client.store
An object to access namespaced Key-Value Stores in and outside of your Jobs.Instance methods
sendEvent()
Sending an event triggers any Jobs that are listening for that event (based on the name). Use eventTrigger() on a Job to listen for events. You can call this function from anywhere in your code to send an event. The other way to send an event is by using io.sendEvent() from inside arun()
function.
sendEvents()
Sending multiple events triggers any Jobs that are listening for those events (based on the name). Use eventTrigger() on a Job to listen for events. You can call this function from anywhere in your code to send multiple events. The other way to send multiple events is by using io.sendEvents() from inside arun()
function.
getEvent()
ThegetEvent()
method gets the event details for a given eventId.
cancelEvent()
ThecancelEvent()
method cancels an event that is scheduled to be delivered in the future.
cancelRunsForEvent()
ThecancelRunsForEvent()
method cancels the job runs (yet to be executed) that are triggered by a given eventId.
cancelRunsForJob()
ThecancelRunsForJob()
method cancels all runs for the specified job (yet to be executed).
getRuns()
ThegetRuns()
method gets runs for a Job.
getRun()
ThegetRun()
method gets the details for a given Run.
defineJob()
ThedefineJob()
method defines a new Job.
defineHttpEndpoint()
ThedefineHttpEndpoint()
method defines a new HTTP Endpoint.
defineDynamicTrigger()
ThedefineDynamicTrigger()
method defines a new Dynamic Trigger.
defineDynamicSchedule()
ThedefineDynamicSchedule()
method defines a new Dynamic Schedule.
defineAuthResolver()
ThedefineAuthResolver()
method defines a new Auth Resolver.
on()
Use theon()
method to listen for run notifications across all Jobs.