Skip to content

Latest commit

 

History

History
92 lines (62 loc) · 2.14 KB

File metadata and controls

92 lines (62 loc) · 2.14 KB
title Next.js Quick Start
sidebarTitle Next.js
description Start creating Jobs in 5 minutes in your Next.js project.

This quick start guide will get you up and running with Trigger.dev.

No problem, create a blank project by running the `create-next-app` command in your terminal then continue with this quickstart guide as normal:
npx create-next-app@latest

Trigger.dev works with either the Pages or App Router configuration.

Instructions of how to resolve any issues due to middleware [here](https://trigger.dev/docs/documentation/guides/platforms/nextjs#middleware) You can modify your `package.json` to run both the Next.js server and the CLI `dev` command together.
  1. Install the concurrently package:
npm install concurrently --save-dev
pnpm install concurrently --save-dev
yarn add concurrently --dev
  1. Modify your package.json file's dev script.
...
"scripts": {
  "dev": "concurrently --kill-others npm:dev:*",
  "dev:next": "next dev",
  "dev:trigger": "npx @trigger.dev/cli dev",
  //...
}
...

The CLI init command created a simple Job for you. There will be a new file either src/jobs/examples.(ts/js) or jobs/examples.(ts/js).

In there is this Job:

If you navigate to your Trigger.dev project you will see this Job in the "Jobs" section:

Your first Job