diff --git a/README.md b/README.md index c525a9630db..37ec5ffea9e 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,13 @@ -### The Trigger.dev Private beta is now open. Sign up for access [here](https://bcymafitv0e.typeform.com/tddsignup#source=GitHubReadme). - -  - ![Hero](https://raw.githubusercontent.com/triggerdotdev/trigger.dev/eebe37109e33beae6390ee19029fce8a5934c84b/apps/webapp/public/images/logo-banner.png) - --- - -  - - -![Logo](https://trigger.dev/_next/static/media/triggerdotdev-logo.9226e5d0.png?imwidth=256) - [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/triggerdotdev.svg?style=social&label=Follow%20%40trigger.dev)](https://twitter.com/triggerdotdev) +[![Docs](https://img.shields.io/badge/-Documentation-blueviolet)](https://docs.trigger.dev) + -# ⚙️ Automate complex workflows with code +# ⚙️ Effortless automation built for developers Trigger workflows from APIs, on a schedule, or on demand. API calls are easy with authentication handled for you. Add durable delays that survive server restarts. diff --git a/apps/docs/examples/github.mdx b/apps/docs/examples/github.mdx index b61ac797c2c..ac0242c1af8 100644 --- a/apps/docs/examples/github.mdx +++ b/apps/docs/examples/github.mdx @@ -4,7 +4,7 @@ sidebarTitle: "GitHub" description: "Here are some example workflows you could create using the GitHub integration." --- -You can explore all the supported GitHub functions [here](/). +You can explore all the supported GitHub functions [here](/integrations/apis/github/events/push). ## When a GitHub issue is created or modified, post to Slack diff --git a/apps/docs/examples/resend.mdx b/apps/docs/examples/resend.mdx new file mode 100644 index 00000000000..8e3d744d306 --- /dev/null +++ b/apps/docs/examples/resend.mdx @@ -0,0 +1,76 @@ +--- +title: "Resend" +sidebarTitle: "Resend" +description: "Here are some example workflows you could create using the Resend integration." +--- + +## Welcome email drip campaign + +This workflow will get triggered and a Slack notification and welcom email will be sent straight away. +1 day later we check if the user has completed onboarding, if they have, they get a 'tips' email, otherwise they get a re-engagement email. + +Integrations required: Resend, Slack + +```ts +import { resend, slack } from "@trigger.dev/integrations"; +import { customEvent, Trigger, sendEvent } from "@trigger.dev/sdk"; +import React from "react"; +import { z } from "zod"; +import { getUser } from "../db"; +import { InactiveEmail, TipsEmail, WelcomeEmail } from "./email-templates"; + +new Trigger({ + id: "welcome-email-campaign", + name: "Welcome email drip campaign", + apiKey: "", + on: customEvent({ + name: "user.created", + schema: z.object({ + userId: z.string(), + }), + }), + async run(event, context) { + //get the user data from the database + const user = await getUser(event.userId); + + await slack.postMessage("send-to-slack", { + channelName: "new-users", + text: `New user signed up: ${user.name} (${user.email})`, + }); + + //Send the first email + const welcomeResponse = await resend.sendEmail("welcome-email", { + from: "Trigger.dev ", + replyTo: "James ", + to: user.email, + subject: "Welcome to Trigger.dev", + react: , + }); + await context.logger.debug( + `Sent welcome email to ${welcomeResponse.to} with id ${welcomeResponse.id}` + ); + + //wait 1 day, check if the user has created a workflow and send the appropriate email + await context.waitFor("wait-a-while", { days: 1 }); + const updatedUser = await getUser(event.userId); + + if (updatedUser.hasOnboarded) { + await resend.sendEmail("onboarding-complete", { + from: "Trigger.dev ", + replyTo: "James ", + to: updatedUser.email, + subject: "Pro tips for workflows", + react: , + }); + } else { + await resend.sendEmail("onboarding-incomplete", { + from: "Trigger.dev ", + replyTo: "James ", + to: updatedUser.email, + subject: "Help with your first workflow", + react: , + }); + } + }, +}).listen(); +``` diff --git a/apps/docs/examples/slack.mdx b/apps/docs/examples/slack.mdx index b4f9510f8ca..ac7f9628df8 100644 --- a/apps/docs/examples/slack.mdx +++ b/apps/docs/examples/slack.mdx @@ -4,8 +4,6 @@ sidebarTitle: "Slack" description: "Here are some example workflows you could create using the Slack integration." --- -You can explore all the supported Slack functions [here](/). - ## Post to Slack when a GitHub issue is created or modified Integrations required: Slack, GitHub diff --git a/apps/docs/mint.json b/apps/docs/mint.json index efa9b0c2ce9..7dd0e81b089 100644 --- a/apps/docs/mint.json +++ b/apps/docs/mint.json @@ -39,11 +39,7 @@ "navigation": [ { "group": "Getting Started", - "pages": [ - "welcome", - "getting-started", - "get-help" - ] + "pages": ["welcome", "getting-started", "get-help"] }, { "group": "Examples", @@ -51,7 +47,8 @@ "examples/examples", "examples/slack", "examples/github", - "examples/shopify" + "examples/shopify", + "examples/resend" ] }, { @@ -70,15 +67,11 @@ "pages": [ { "group": "Slack", - "pages": [ - "integrations/apis/slack/actions/post-message" - ] + "pages": ["integrations/apis/slack/actions/post-message"] }, { "group": "Resend.com", - "pages": [ - "integrations/apis/resend/actions/send-email" - ] + "pages": ["integrations/apis/resend/actions/send-email"] } ] }, @@ -135,4 +128,4 @@ "github": "https://github.com/triggerdotdev/trigger.dev", "discord": "https://discord.gg/nkqV9xBYWy" } -} \ No newline at end of file +} diff --git a/apps/docs/package.json b/apps/docs/package.json index 97d0a20c912..7e53fb277c3 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -7,6 +7,6 @@ "dev": "mintlify dev --port 3050" }, "devDependencies": { - "mintlify": "^2.0.15" + "mintlify": "^2.0.16" } -} \ No newline at end of file +} diff --git a/apps/docs/welcome.mdx b/apps/docs/welcome.mdx index 7f4e32d62c6..98c6b3043e9 100644 --- a/apps/docs/welcome.mdx +++ b/apps/docs/welcome.mdx @@ -11,6 +11,16 @@ Workflows live in your codebase so you can use your existing types, functions, v _A workflow in action:_ ![Test a run](/images/workflow-demo.gif) + + Quickly get up and running with Trigger.dev by following our quick start diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 419b1b00d54..edb916e6231 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,9 +31,9 @@ importers: apps/docs: specifiers: - mintlify: ^2.0.15 + mintlify: ^2.0.16 devDependencies: - mintlify: 2.0.15 + mintlify: 2.0.16 apps/webapp: specifiers: @@ -4303,8 +4303,8 @@ packages: globby: 11.1.0 read-yaml-file: 1.1.0 - /@mintlify/validation/0.1.4: - resolution: {integrity: sha512-O0WCLeFuAeUHeZuHntvZ0Pz5xBJLPoWspJa3teIX+C7IxrpW/I3hKa82CA2NRttmciud/DFWHgY7q1BomoRr9w==} + /@mintlify/validation/0.1.5: + resolution: {integrity: sha512-eXt/SVpoqrOb54HgsI4KVYlctJAAMtfU3iw0OvQBoO5EZiTXb9fsesFEPoWRgextpdEZua1Kw6tCUcgzuaBylg==} dependencies: zod: 3.20.2 zod-to-json-schema: 3.20.2_zod@3.20.2 @@ -6552,7 +6552,7 @@ packages: /axios/1.2.2: resolution: {integrity: sha512-bz/J4gS2S3I7mpN/YZfGFTqhXTYzRho8Ay38w2otuuDR322KzFIWm/4W2K6gIwvWaws5n+mnb7D1lN9uD+QH6Q==} dependencies: - follow-redirects: 1.15.2_debug@4.3.4 + follow-redirects: 1.15.2 form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -9651,6 +9651,15 @@ packages: engines: {node: '>=0.4.0'} dev: true + /follow-redirects/1.15.2: + resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + /follow-redirects/1.15.2_debug@4.3.4: resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} engines: {node: '>=4.0'} @@ -12539,13 +12548,13 @@ packages: yallist: 4.0.0 dev: true - /mintlify/2.0.15: - resolution: {integrity: sha512-GM/rXnEJunAVRsHbk/3utKgF0BO7l9wj6z3VH0Csp18sRKlb7GjucxeVzUX+jXPoKC+t9JX02WbQg28MHJ/etA==} + /mintlify/2.0.16: + resolution: {integrity: sha512-8SppN2c2F6rt2QlYkDIqZZV9S2jXuUUbWo75eDGURMRfWxpFKGCRxsueY0Oerq/yO/Mlzg5ZNHutJHRipCgLcg==} engines: {node: '>=18.0.0'} hasBin: true dependencies: '@apidevtools/swagger-parser': 10.1.0_openapi-types@12.1.0 - '@mintlify/validation': 0.1.4 + '@mintlify/validation': 0.1.5 '@octokit/rest': 19.0.7 axios: 1.2.2 chalk: 5.2.0