Code Monkey home page Code Monkey logo

api-reference's People

Contributors

biplobsd avatar d-k-p avatar froostycodes avatar gjohnsx avatar hmacr avatar kartik1397 avatar kritik-j avatar matt-aitken avatar nabinbhatt avatar nicktrn avatar rishi-raj-jain avatar shelar1423 avatar sp6370 avatar xementor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

api-reference's Issues

Create an example job using the AWS API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the AWS API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the AWS API, using their official SDK
  • The job must query a DynamoDB table and return a payload or invoke a lambda function

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Google Maps API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Google Maps API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the Google Maps API, using their official SDK, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Loops API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Loops API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Discord API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Discord API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the Discord API, using their official SDK or native fetch, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example Snyk job which uses an HTTP endpoint / trigger

Overview

HTTP endpoints allow you to subscribe to changes from an API. You can use defineHttpEndpoint to receive webhooks, verify them, and create an HTTP Trigger.

Details:

The task is to create a job example which is triggered by an HTTP Trigger when a change is received from Snyk.

Reference material:

  • Read our HTTP endpoints docs
  • Read our SDK reference docs
  • Check out our simple Cal.com example. This is a simple implementation.
  • Check out our WhatsApp example. This is a more advanced implementation (using respondWith) because WhatsApp sends a verification GET request to confirm before the webhooks can be created. Most APIs don't required this.

Requirements:

  • Use the structure of our Cal.com example.
  • The example must connect to Snyk, receive a payload which triggers an HTTP Trigger, and then perform a simple job.

Guidelines:

  • The code must use TypeScript
  • The job must use an HTTP Trigger
  • Create a TypeScript type for the webhook, ideally use types from the official SDK from the API.
  • Cast the json to that type using const body = await request.json() as WebhookPayload
  • Use native fetch where no official SDK or incompatible auth
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc.

Required structure:

  1. Follow this guide to get the project setup.​

  2. Create a new file in the src folder, named to match the API, with '-http-endpoint' at the end (e.g. GitHub would be called github-http-endpoint.ts).​

  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:

const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a video or screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example Square job which uses an HTTP endpoint / trigger

Overview

HTTP endpoints allow you to subscribe to changes from an API. You can use defineHttpEndpoint to receive webhooks, verify them, and create an HTTP Trigger.

Details:

The task is to create a job example which is triggered by an HTTP Trigger when a change is received from Square.

Reference material:

  • Read our HTTP endpoints docs
  • Read our SDK reference docs
  • Check out our simple Cal.com example. This is a simple implementation.
  • Check out our WhatsApp example. This is a more advanced implementation (using respondWith) because WhatsApp sends a verification GET request to confirm before the webhooks can be created. Most APIs don't required this.

Requirements:

  • Use the structure of our Cal.com example.
  • The example must connect to Square, receive a payload which triggers an HTTP Trigger, and then perform a simple job.

Guidelines:

  • The code must use TypeScript
  • The job must use an HTTP Trigger
  • Create a TypeScript type for the webhook, ideally use types from the official SDK from the API.
  • Cast the json to that type using const body = await request.json() as WebhookPayload
  • Use native fetch where no official SDK or incompatible auth
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc.

Required structure:

  1. Follow this guide to get the project setup.​

  2. Create a new file in the src folder, named to match the API, with '-http-endpoint' at the end (e.g. GitHub would be called github-http-endpoint.ts).​

  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:

const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a video or screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example Discord job which uses an HTTP endpoint / trigger

Overview

HTTP endpoints allow you to subscribe to changes from an API. You can use defineHttpEndpoint to receive webhooks, verify them, and create an HTTP Trigger.

Details:

The task is to create a job example which is triggered by an HTTP Trigger when a change is received from Discord.

Reference material:

  • Read our HTTP endpoints docs
  • Read our SDK reference docs
  • Check out our simple Cal.com example. This is a simple implementation.
  • Check out our WhatsApp example. This is a more advanced implementation (using respondWith) because WhatsApp sends a verification GET request to confirm before the webhooks can be created. Most APIs don't required this.

Requirements:

  • Use the structure of our Cal.com example.
  • The example must connect to Discord, receive a payload which triggers an HTTP Trigger, and then perform a simple job.

Guidelines:

  • The code must use TypeScript
  • The job must use an HTTP Trigger
  • Create a TypeScript type for the webhook, ideally use types from the official SDK from the API.
  • Cast the json to that type using const body = await request.json() as WebhookPayload
  • Use native fetch where no official SDK or incompatible auth
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc.

Required structure:

  1. Follow this guide to get the project setup.​

  2. Create a new file in the src folder, named to match the API, with '-http-endpoint' at the end (e.g. GitHub would be called github-http-endpoint.ts).​

  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:

const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a video or screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the YouTube API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the YouTube API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the YouTube API, using their official SDK, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example Salesforce job which uses an HTTP endpoint / trigger

Overview

HTTP endpoints allow you to subscribe to changes from an API. You can use defineHttpEndpoint to receive webhooks, verify them, and create an HTTP Trigger.

Details:

The task is to create a job example which is triggered by an HTTP Trigger when a change is received from Salesforce.

Reference material:

  • Read our HTTP endpoints docs
  • Read our SDK reference docs
  • Check out our simple Cal.com example. This is a simple implementation.
  • Check out our WhatsApp example. This is a more advanced implementation (using respondWith) because WhatsApp sends a verification GET request to confirm before the webhooks can be created. Most APIs don't required this.

Requirements:

  • Use the structure of our Cal.com example.
  • The example must connect to Salesforce, receive a payload which triggers an HTTP Trigger, and then perform a simple job.

Guidelines:

  • The code must use TypeScript
  • The job must use an HTTP Trigger
  • Create a TypeScript type for the webhook, ideally use types from the official SDK from the API.
  • Cast the json to that type using const body = await request.json() as WebhookPayload
  • Use native fetch where no official SDK or incompatible auth
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc.

Required structure:

  1. Follow this guide to get the project setup.​

  2. Create a new file in the src folder, named to match the API, with '-http-endpoint' at the end (e.g. GitHub would be called github-http-endpoint.ts).​

  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:

const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a video or screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Anthropic API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the Anthropic API and SDK. This will replace the GitHub example we currently have in the app:

2023-10-23 3

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Avoid external packages apart from offical SDKs
  • Only use io.backgroundFetch() where absolutely necessary
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example HubSpot job which uses an HTTP endpoint / trigger

Overview

HTTP endpoints allow you to subscribe to changes from an API. You can use defineHttpEndpoint to receive webhooks, verify them, and create an HTTP Trigger.

Details:

The task is to create a job example which is triggered by an HTTP Trigger when a change is received from HubSpot.

Reference material:

  • Read our HTTP endpoints docs
  • Read our SDK reference docs
  • Check out our simple Cal.com example. This is a simple implementation.
  • Check out our WhatsApp example. This is a more advanced implementation (using respondWith) because WhatsApp sends a verification GET request to confirm before the webhooks can be created. Most APIs don't required this.

Requirements:

  • Use the structure of our Cal.com example.
  • The example must connect to HubSpot, receive a payload which triggers an HTTP Trigger, and then perform a simple job.

Guidelines:

  • The code must use TypeScript
  • The job must use an HTTP Trigger
  • Create a TypeScript type for the webhook, ideally use types from the official SDK from the API.
  • Cast the json to that type using const body = await request.json() as WebhookPayload
  • Use native fetch where no official SDK or incompatible auth
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc.

Required structure:

  1. Follow this guide to get the project setup.​

  2. Create a new file in the src folder, named to match the API, with '-http-endpoint' at the end (e.g. GitHub would be called github-http-endpoint.ts).​

  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:

const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a video or screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the DeepL API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the DeepL API and SDK. This will replace the GitHub example we currently have in the app.

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Rippling API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Rippling API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Twilio API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the Twilio API and SDK. This will replace the GitHub example we currently have in the app:

2023-10-20 4

  • The job must connect to the Twilio API, using the SDK, and return an example payload from the API.
  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use the structure of our GitHub API reference file.

Requirements:

  1. Follow this guide to get the project setup.
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });

  1. You must add the Express specific lines to the bottom of the Job file:
// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);

  1. You must add the new script to the package.json file, in this format:
"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}


Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Mailgun API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Mailgun API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the Mailgun API, using their official SDK, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the ZBD API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the ZBD API and SDK. This will replace the GitHub example we currently have in the app.

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the ZBD API, using their official SDK, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Square API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Square API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Stability AI API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Stability AI API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the DigitalOcean API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the DigitalOcean API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example Twilio job which uses an HTTP endpoint / trigger

Overview

HTTP endpoints allow you to subscribe to changes from an API. You can use defineHttpEndpoint to receive webhooks, verify them, and create an HTTP Trigger.

Details:

The task is to create a job example which is triggered by an HTTP Trigger when a change is received from Twilio.

Reference material:

  • Read our HTTP endpoints docs
  • Read our SDK reference docs
  • Check out our simple Cal.com example. This is a simple implementation.
  • Check out our WhatsApp example. This is a more advanced implementation (using respondWith) because WhatsApp sends a verification GET request to confirm before the webhooks can be created. Most APIs don't required this.

Requirements:

  • Use the structure of our Cal.com example.
  • The example must connect to Twilio, receive a payload which triggers an HTTP Trigger, and then perform a simple job.

Guidelines:

  • The code must use TypeScript
  • The job must use an HTTP Trigger
  • Create a TypeScript type for the webhook, ideally use types from the official SDK from the API.
  • Cast the json to that type using const body = await request.json() as WebhookPayload
  • Use native fetch where no official SDK or incompatible auth
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc.

Required structure:

  1. Follow this guide to get the project setup.​

  2. Create a new file in the src folder, named to match the API, with '-http-endpoint' at the end (e.g. GitHub would be called github-http-endpoint.ts).​

  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:

const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a video or screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Gmail API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the Gmail API and SDK. This will replace the GitHub example we currently have in the app:

2023-10-18 5

Requirements:

  1. Follow this guide to get the project setup.
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });

  1. You must add the Express specific lines to the bottom of the Job file:
// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);

  1. You must add the new script to the package.json file, in this format:
"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}


Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Instagram API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Instagram API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the Instagram API, using their official SDK, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Google Sheets API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the Google Sheets API and SDK.

  • This job must connect to the Google Sheets API, using the SDK, and return an example payload from the API.

  • The job should use an eventTrigger

  • The job should use zod to define the payloads

  • Use the structure of our GitHub API reference file

Requirements:

  1. Follow this guide to get the project setup.
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });

  1. You must add the Express specific lines to the bottom of the Job file:
// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);

  1. You must add the new script to the package.json file, in this format:
"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}


Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Segment API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Segment API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the Segment API, using their official SDK, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an exampe job using the Novu API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Novu API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the PagerDuty API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the PagerDuty API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Salesforce API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the Salesforce API and SDK. This will replace the GitHub example we currently have in the app:

2023-10-20 3

  • The job must connect to the Salesforce API, using the SDK, and return an example payload from the API.
  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use the structure of our GitHub API reference file.

Requirements:

  1. Follow this guide to get the project setup.
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });

  1. You must add the Express specific lines to the bottom of the Job file:
// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);

  1. You must add the new script to the package.json file, in this format:
"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}


Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Coinbase API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Coinbase API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the Coinbase API, using their official SDK, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Hugging Face API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Hugging Face API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the Hugging Face API, using their official SDK, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Snyk API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Snyk API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
    ​- Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Notion API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Notion API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Cal.com API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the Cal.com API. This will replace the GitHub example we currently have in the app:

2023-10-25 10

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Svix API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Svix API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the Svix API, using their official SDK, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Zapier API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Zapier API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the Zapier API, using their official SDK, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Todoist API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Todoist API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Shopify API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the Shopify API and SDK. This will replace the GitHub example we currently have in the app:

2023-10-20 2

  • This job must connect to the Shopify, using the SDK, and return an example payload from the API.

  • The job should use an eventTrigger

  • The job should use zod to define the payloads

  • Use the structure of our GitHub API reference file

Requirements:

  1. Follow this guide to get the project setup.
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });

  1. You must add the Express specific lines to the bottom of the Job file:
// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);

  1. You must add the new script to the package.json file, in this format:
"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}


Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the HubSpot API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the HubSpot API and SDK. This will replace the GitHub example we currently have in the app:

2023-10-23 2

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Avoid external packages apart from offical SDKs
  • Only use io.backgroundFetch() where absolutely necessary
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Google Drive API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the Google Drive API and SDK. This will replace the GitHub example we currently have in the app:

2023-10-18 6

  • This job must connect to the Google Drive API, using the SDK, and return an example payload from the API.

  • The job should use an eventTrigger

  • The job should use zod to define the payloads

  • Use the structure of our GitHub API reference file

Requirements:

  1. Follow this guide to get the project setup.
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });

  1. You must add the Express specific lines to the bottom of the Job file:
// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);

  1. You must add the new script to the package.json file, in this format:
"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}


Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the X (Twitter) API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the X (Twitter) API and SDK. This will replace the GitHub example we currently have in the app:

2023-10-20 5

  • The job must connect to the X (Twitter) API, using the SDK, and return an example payload from the API.
  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use the structure of our GitHub API reference file.

Requirements:

  1. Follow this guide to get the project setup.
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });

  1. You must add the Express specific lines to the bottom of the Job file:
// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);

  1. You must add the new script to the package.json file, in this format:
"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}


Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Brex API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Brex API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example using the Reddit API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the Reddit API and SDK. This will replace the GitHub example we currently have in the app:

2023-10-25 12

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Google Calendar API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the Google Calendar API and SDK. This will replace the GitHub example we currently have in the app:

2023-10-23

  • The job must connect to the Google Calendar API, using the SDK, and return an example payload from the API.
  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use the structure of our GitHub API reference file.

Requirements:

  1. Follow this guide to get the project setup.
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });

  1. You must add the Express specific lines to the bottom of the Job file:
// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);

  1. You must add the new script to the package.json file, in this format:
"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}


Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Asana API and SDK

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job using the Asana API and SDK. This will replace the GitHub example we currently have in the app:

2023-10-25 9

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the WhatsApp API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the WhatsApp API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

  • Use the structure of our GitHub API reference file.
  • The job must connect to the WhatsApp API, using their official SDK or native fetch, and return an example payload from the API.

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example Shopify job which uses an HTTP endpoint / trigger

Overview

HTTP endpoints allow you to subscribe to changes from an API. You can use defineHttpEndpoint to receive webhooks, verify them, and create an HTTP Trigger.

Details:

The task is to create a job example which is triggered by an HTTP Trigger when a change is received from Shopify.

Reference material:

  • Read our HTTP endpoints docs
  • Read our SDK reference docs
  • Check out our simple Cal.com example. This is a simple implementation.
  • Check out our WhatsApp example. This is a more advanced implementation (using respondWith) because WhatsApp sends a verification GET request to confirm before the webhooks can be created. Most APIs don't required this.

Requirements:

  • Use the structure of our Cal.com example.
  • The example must connect to Shopify, receive a payload which triggers an HTTP Trigger, and then perform a simple job.

Guidelines:

  • The code must use TypeScript
  • The job must use an HTTP Trigger
  • Create a TypeScript type for the webhook, ideally use types from the official SDK from the API.
  • Cast the json to that type using const body = await request.json() as WebhookPayload
  • Use native fetch where no official SDK or incompatible auth
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc.

Required structure:

  1. Follow this guide to get the project setup.​

  2. Create a new file in the src folder, named to match the API, with '-http-endpoint' at the end (e.g. GitHub would be called github-http-endpoint.ts).​

  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:

const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a video or screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example Instagram job which uses an HTTP endpoint / trigger

Overview

HTTP endpoints allow you to subscribe to changes from an API. You can use defineHttpEndpoint to receive webhooks, verify them, and create an HTTP Trigger.

Details:

The task is to create a job example which is triggered by an HTTP Trigger when a change is received from Instagram.

Reference material:

  • Read our HTTP endpoints docs
  • Read our SDK reference docs
  • Check out our simple Cal.com example. This is a simple implementation.
  • Check out our WhatsApp example. This is a more advanced implementation (using respondWith) because WhatsApp sends a verification GET request to confirm before the webhooks can be created. Most APIs don't required this.

Requirements:

  • Use the structure of our Cal.com example.
  • The example must connect to Instagram, receive a payload which triggers an HTTP Trigger, and then perform a simple job.

Guidelines:

  • The code must use TypeScript
  • The job must use an HTTP Trigger
  • Create a TypeScript type for the webhook, ideally use types from the official SDK from the API.
  • Cast the json to that type using const body = await request.json() as WebhookPayload
  • Use native fetch where no official SDK or incompatible auth
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc.

Required structure:

  1. Follow this guide to get the project setup.​

  2. Create a new file in the src folder, named to match the API, with '-http-endpoint' at the end (e.g. GitHub would be called github-http-endpoint.ts).​

  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:

const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a video or screenshot of a successful run. This may involve you having to setup accounts with services.

Create an example job using the Lemon Squeezy API

Overview:

While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.

Details:

In this example, you will build a simple job which uses the Lemon Squeezy API. This will replace the GitHub example we currently have in the app:

2023-10-26 7

Requirements:

Guidelines:

  • The job should use an eventTrigger.
  • The job should use zod to define the payloads.
  • Use native fetch where no official SDK or incompatible auth
  • Only use io.backgroundFetch() where absolutely necessary
  • Avoid external packages apart from official SDKs
  • Prefer REST over GraphQL - avoid raw queries
  • Use a minimal io.runTask() callback - initialise clients and auth in global scope if possible
  • Leave clear comments with links to relevant developer docs, API key pages etc. The Discord example is the level of commenting we are looking for.

Required Structure:

  1. Follow this guide to get the project setup.​
  2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​
  3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:
const client = new TriggerClient({ id: "api-reference" });


4. You must add the Express specific lines to the bottom of the Job file:

// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);


5. You must add the new script to the package.json file, in this format:

"scripts": {
  //..other scripts
  "<api-name>": "nodemon --watch src/<api name>.ts -r tsconfig-paths/register -r dotenv/config src/<api name>.ts"
}

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.