This is a working proof-of-concept Next.js project with Inngest integration to help you get started with Inngest functions.
Follow these steps to get the project running:
git clone git@github.com:dubscode/inngest-guide.git
cd inngest-guide
npm installYou'll need two terminals running simultaneously:
Terminal 1 - Start Next.js development server:
npm run devTerminal 2 - Start Inngest development server:
npm run inngestOnce both servers are running, open your browser and navigate to:
http://localhost:8288/functions
You should see the Inngest development dashboard with your hello-world function listed.
There are two ways to test the hello-world function:
Click the "Invoke" button next to the hello-world function and use this payload:
{
"data": {
"name": "Ali"
}
}Use curl to trigger the function from code:
curl -X POST http://localhost:3000/api/helloThis will:
- Send a POST request to your Next.js API route
- The API route will trigger the Inngest function with the event
test/hello.world - Return
{ "message": "Event sent!" } - You can see the function execution in the Inngest dashboard
Both methods will result in the function:
- Waiting for 5 seconds (demonstrating Inngest's step functionality)
- Returning a personalized greeting:
"Hello Ali!"
- Next.js App: Basic Next.js application with App Router
- Inngest Function: A simple
hello-worldfunction that demonstrates:- Event-driven execution
- Step functions (with a 5-second sleep)
- Data processing from event payload
- API Routes:
/api/inngest- Inngest webhook endpoint/api/hello- Example route that triggers Inngest functions
src/
├── app/
│ └── api/
│ ├── hello/ # Example API route that triggers functions
│ └── inngest/ # Inngest webhook endpoint
└── inngest/
├── client.ts # Inngest client configuration
└── functions.ts # Your Inngest functions
This POC demonstrates the basics of Inngest. You can:
- Add more functions to
src/inngest/functions.ts - Trigger functions from your Next.js application
- Explore Inngest's step functions, retries, and scheduling features
- Deploy to production with your preferred hosting platform
