diff --git a/apps/webapp/app/services/externalApis/integrationCatalog.server.ts b/apps/webapp/app/services/externalApis/integrationCatalog.server.ts index 4bbaab85c..52ea98184 100644 --- a/apps/webapp/app/services/externalApis/integrationCatalog.server.ts +++ b/apps/webapp/app/services/externalApis/integrationCatalog.server.ts @@ -1,6 +1,6 @@ -import { airtable } from "./integrations/airtable"; import { github } from "./integrations/github"; import { openai } from "./integrations/openai"; +import { resend } from "./integrations/resend"; import { slack } from "./integrations/slack"; import type { Integration } from "./types"; @@ -25,8 +25,10 @@ export class IntegrationCatalog { } export const integrationCatalog = new IntegrationCatalog({ - airtable, + //todo support airtable + // airtable, github, openai, + resend, slack, }); diff --git a/apps/webapp/app/services/externalApis/integrations/resend.ts b/apps/webapp/app/services/externalApis/integrations/resend.ts new file mode 100644 index 000000000..5e05356d5 --- /dev/null +++ b/apps/webapp/app/services/externalApis/integrations/resend.ts @@ -0,0 +1,61 @@ +import type { Integration } from "../types"; + +export const resend: Integration = { + identifier: "resend", + name: "Resend", + packageName: "@trigger.dev/resend", + authenticationMethods: { + apikey: { + type: "apikey", + help: { + samples: [ + { + title: "Creating the client", + code: ` +import { Resend } from "@trigger.dev/resend"; + +const resend = new Resend({ + id: "resend", + apiKey: process.env.RESEND_API_KEY!, +}); +`, + }, + { + title: "Using the client", + code: ` +new Job(client, { + id: "send-resend-email", + name: "Send Resend Email", + version: "0.1.0", + trigger: eventTrigger({ + name: "send.email", + schema: z.object({ + to: z.union([z.string(), z.array(z.string())]), + subject: z.string(), + text: z.string(), + }), + }), + integrations: { + resend, + }, + run: async (payload, io, ctx) => { + await io.resend.sendEmail("send-email", { + to: payload.to, + subject: payload.subject, + text: payload.text, + from: "Trigger.dev ", + }); + }, +}); + + `, + highlight: [ + [13, 15], + [17, 22], + ], + }, + ], + }, + }, + }, +};