OAuth
Use OAuth to authenticate your team or to add Integrations to your product so your users can connect their accounts.
1. Create an Integration client (in code)
When using OAuth, you only need to specify the id
.
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.
This example send a Slack message when someone stars the trigger.dev
GitHub repo 🤩.
3. Creating the OAuth connection in the dashboard
Now you need to setup the OAuth client in the dashboard. You will use the id
that you specified in your code to associate them.
-
Go to the “Integrations page” in your dashboard. Click the Integration you want to setup.
-
Select OAuth as the authentication type.
-
Select “Developer” as the user type.
-
Enter the
id
that you specified in your code. Select the scopes that you want and enter a unique title. -
Click the Connect button, it will take you through the OAuth flow.
4. Viewing your connection clients
The Integrations page
The "Integrations" page shows
- 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 OAuth integration detail page
Some useful things on this page
- The
id
that you gave the connection when you defined it in your code - The Jobs that are using this connection
- All the connections associated with this Integration client (there will be more than one if you’re authenticated your users)
- The scopes that this connection has access to
References
Was this page helpful?