SDK
- Introduction
- TriggerClient
- Overview
- Constructor
- Instance properties
- Instance methods
- Job
- IO
- context
- RunNotification
- invokeTrigger()
- eventTrigger()
- cronTrigger()
- intervalTrigger()
- HttpEndpoint
- HttpTrigger
- DynamicTrigger
- DynamicSchedule
- ConnectionAuth
- isTriggerError()
- redactString
- verifyRequestSignature()
HTTP Reference
TriggerClient: constructor
The TriggerClient()
constructor creates a new TriggerClient object.
export const client = new TriggerClient({
id: "my-webapp",
apiKey: process.env.TRIGGER_API_KEY!,
logLevel: "debug",
});
Parameters
The id
property is used to uniquely identify the client.
The apiKey
property is the API Key for your Trigger.dev environment. We
recommend using an environment variable to store your API Key.
The apiUrl
property is an optional property that specifies the API URL. You
only need to specify this if you are not using Trigger.dev Cloud and are
running your own Trigger.dev instance.
The logLevel
property is an optional property that specifies the level of
logging for the TriggerClient. The level is inherited by all Jobs that use this Client, unless they also specify a logLevel
.
log
- logs only essential messageserror
- logs error messageswarn
- logs errors and warning messagesinfo
- logs errors, warnings and info messagesdebug
- logs everything with full verbosity
Very verbose log messages, default to false.
Default is false. If set to true it will log to the server’s console as well as the Trigger.dev platform
Returns
export const client = new TriggerClient({
id: "my-webapp",
apiKey: process.env.TRIGGER_API_KEY!,
logLevel: "debug",
});
Was this page helpful?
export const client = new TriggerClient({
id: "my-webapp",
apiKey: process.env.TRIGGER_API_KEY!,
logLevel: "debug",
});