This demo shows off a variety of features of Trigger.dev Realtime
Copy the .env.local.example
file to .env.local
and fill in the values for the various services, including Trigger.dev.
If you haven't already, create a project on Trigger.dev and copy the project ref into the trigger.config.ts
file.
Then, run the Next.js development server and the Trigger.dev dev CLI command in a separate terminal.
npm install
npm run dev
npm run dev:trigger # Run this in a separate terminal
Open http://localhost:3000/weather with your browser to see the result.
realtime-streams-demo_1.mp4
- View the Trigger.dev task code in the src/trigger/ai.ts file.
- View the frontend code in the src/app/weather/page.tsx file and the src/components/GetStreamingWeatherButton.tsx file.
To learn more about Trigger.dev Realtime, take a look at the following resources:
- Trigger.dev Documentation - learn about Trigger.dev and its features.
- Realtime docs - learn about the Realtime feature of Trigger.dev.
- React hooks - learn about the React hooks provided by Trigger.dev.