1. Create an Integration client
process.env.GITHUB_TOKEN
and process.env.OPENAI_API_KEY
. They’re environment variables, which are a way of not putting secret values directly in your code.
For Next.js, local environment variables usually live in a .env.local
file in the root of the project.
.env.local
2. Use the Integration client
There are two way to use Integrations in a Job:- You can perform Tasks in the
run
function, by passing the Integration client into theintegrations
object. - You can use webhooks to Trigger a Job.
trigger.dev
repo (lucky him).
3. Viewing connections in the dashboard
The Integrations page

- Some of the APIs that you can use with Trigger.dev (you can use any API). Selecting one of these will give you instructions on how to use it.
- Your connected integrations. Clicking these will give you more details on that connection.
Connected API Key Integration detail page

- The
id
that you gave the connection when you defined it in your code - The Jobs that are using this connection