Creating the client
Each integration has a client that performs the actual HTTP requests. Usually this is a wrapper around an official SDK provided by the service.
src/index.ts
This is where the client should live.
We’re adopting the naming convention of naming the class after the service, without a suffix or
prefix. We prefer the exported name be Slack
instead of something like SlackIntegration
or
SlackConnector
Example: GitHub
Comments are for instructional purposes only and should be removed in your implementation.
The TriggerIntegration
interface requires three properties and one method to be implemented:
The id
that uniquely identifies the Integration. This should always be passed through the
constructor options.
“LOCAL” should be returned for API keys. “HOSTED” should be returned for OAuth.
This method is called before the run()
method is called on a Job. This is important because the
authentication data is dynamic, and can change (like OAuth credentials refreshing). This method
should return a new instance of the Integration, with the new authentication data, io, and
connectionKey set so they can be used by runTask and any Triggers.
Was this page helpful?