trigger-realtime

Subscribe to Trigger.dev task runs and stream real-time updates to React frontends and backends.

Updated Sep 6, 2026
One-click install
npx skills add https://github.com/inventashif/helpful-code-sidekick --skill trigger-realtime-inventashif
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trigger-realtime
Source: https://github.com/inventashif/helpful-code-sidekick/tree/main/scripts/hackerai/.agents/skills/trigger-realtime
Command: npx skills add https://github.com/inventashif/helpful-code-sidekick --skill trigger-realtime-inventashif

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @trigger.dev/sdk, @trigger.dev/react-hooks, and includes references (resource) components.

What problem does it solve? Long-running background tasks leave users staring at static screens with no visibility into progress. This Skill shows how to subscribe to Trigger.dev task runs in real time, so you can display live status, progress, and streamed AI output in your app. ## Core Features & Use Cases - Run Subscriptions: Subscribe to individual runs, tagged runs, or batches from the backend using async iterators. - React Hooks: Use useRealtimeTaskTrigger, useRealtimeRun, and useRealtimeRunsWithTag to trigger and monitor tasks from components. - Realtime Streams: Pipe LLM completions from tasks and render streamed tokens in React with useRealtimeStream. - Wait Tokens: Pause tasks for human approval and complete them from the frontend with useWaitToken. - Use Case: Build a dashboard where users trigger an AI report generation task and watch the response stream in live with a progress indicator. ## Quick Start Ask the AI to add a React component that triggers a Trigger.dev task and displays its live status and progress using a public access token.

Frequently Asked Questions about trigger-realtime

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I subscribe to a Trigger.dev task run in real time?

Use runs.subscribeToRun from @trigger.dev/sdk on the backend with an async iterator, or the useRealtimeRun hook from @trigger.dev/react-hooks in React. Both require a public access token scoped to the run.

How to stream LLM responses from Trigger.dev tasks to React?

Define a stream with streams.define, pipe the OpenAI completion inside the task with aiStream.pipe, then read it in React using useRealtimeStream with the run ID and access token. Use throttleInMs to control re-render frequency.

How do I trigger a Trigger.dev task from a React component?

Create a trigger token on the backend with auth.createTriggerPublicToken, pass it to the frontend, and call submit from useRealtimeTaskTrigger. The hook returns the run object so you can display live status immediately.

Can I pause a Trigger.dev task for human approval?

Yes, use wait.forToken inside the task to pause execution until a token is completed. From React, call complete from the useWaitToken hook with the approval payload to resume the task.

What are the security best practices for Trigger.dev public tokens?

Scope tokens narrowly to only the runs or tasks needed, and always set short expiration times such as 15 minutes to 1 hour. Never expose full API keys to the frontend; use createPublicToken for read-only access.