You can use any API in your Jobs by using existing Node.js SDKs or HTTP requests. Integrations
just make it much easier especially when you want to use OAuth. And you get great logging.
Authentication
There are two ways to authenticate Integrations, OAuth and API Keys/Access Tokens.API Keys/Access Tokens
Use API Keys or Access Tokens to connect an Integration
OAuth
Use OAuth to connect an Integration for your team or your users
Bring-your-own Auth
Use our integrations with your user’s auth credentials, using Clerk.com, Nango.dev, or rolling
your own with our custom auth resolvers
Using for Jobs & Tasks
You must pass Integrations into your Job to run integration tasks. Passed in Integrations will be available on theio
object in the run()
function with the same name as the key. For example:
postMessage
and addIssueLabels
functions above are implemented as an “Authenticated Task” that is defined inside the Integration, where the first argument is always the task key and the second argument is the parameters for the task. For example, here is how you would call the postMessage
function above:
runTask
function to get access to the authenticated client.
For example, the Slack integration doesn’t expose an Authenticated Task function for deleting a message, but you can use the chat.delete
function provided by the @slack/web-api package directly:
runTask
to specify the task parameters:
Using outside of Jobs
If you want to use integrations that support “local auth” only (e.g. API keys, like Stripe and Supabase) outside of a Job you can use the.native
property on the integration to get direct access to the client. For example:
stripe.ts
Using for Triggers
Some integrations provide triggers that you can use to start a Job. For example, the GitHub integration provides apush
trigger that will start a Job when a new commit is pushed to a repository:
@trigger.dev/github
integration will create a webhook on your repository that will call our API when a new push event is received. We will then start your Job with the payload from the push event.
If you are just using an integration to trigger a job but not using authenticated tasks inside the
job run, there is no need to pass the integration in the job
integrations
option.