Back to Skills

trigger-realtime

Subscribe to Trigger.dev task runs in real-time from frontend and backend. Use when building progress indicators, live dashboards, streaming AI/LLM responses, or React components that display task status.

27stars5forksUpdated 6/19/2026

Security Assessment

Low Risk(70/100)

Detected risks:

Secret Exposure([SKILL.md] Token =, [references/realtime.md] Token =)
Security Score70/100

About trigger-realtime

The trigger-realtime skill enables developers to subscribe to Trigger.dev task runs in real-time from both frontend and backend applications. It solves the challenge of monitoring long-running background tasks by providing live updates on task status, progress, and output without polling. This is particularly valuable for tasks that take significant time to complete, where users need immediate feedback on progress rather than waiting for the entire operation to finish.

The skill provides comprehensive features including backend subscription APIs for monitoring task runs, React hooks for seamless frontend integration, and streaming capabilities for AI/LLM responses. It supports multiple subscription patterns: individual run monitoring, batch run tracking, and tag-based subscriptions for grouping related tasks. Authentication is handled through scoped public access tokens that can be configured for read-only access or task triggering, with customizable expiration times for security.

This skill is ideal for developers building interactive web applications with long-running operations such as data processing pipelines, AI model inference, report generation, or any workflow requiring user approval steps. Frontend developers can use the React hooks to create live progress indicators and status dashboards, while backend developers can orchestrate complex workflows that wait for task completion. The streaming API is particularly useful for modern AI applications that need to display incremental results from language models or other generative AI systems.

FAQ

What authentication tokens do I need for frontend realtime subscriptions?

You need to create a public access token on the backend using auth.createPublicToken() with appropriate scopes for reading runs and tasks. For frontend triggering, use auth.createTriggerPublicToken(). Both support configurable expiration times for security.

Can I monitor multiple task runs simultaneously?

Yes, you can subscribe to multiple runs using tags with runs.subscribeToRunsWithTag() or subscribeToBatch() for batch operations. In React, use the useRealtimeRunsWithTag hook to monitor all runs with a specific tag.

What frameworks and environments are supported?

The skill supports both backend Node.js/TypeScript environments using the @trigger.dev/sdk package and React frontend applications using the @trigger.dev/react-hooks package. The React hooks work with modern React including Next.js client components.

How do I stream AI/LLM responses in real-time?

Define a stream using streams.define(), pipe data to it within your task, then subscribe to the stream from your frontend or backend using the appropriate subscription method. This allows incremental results to be sent as they're generated.

What information is available during task execution?

Real-time subscriptions provide access to task status, custom metadata (like progress percentages), and final output upon completion. You can also track errors and monitor state transitions throughout the task lifecycle.

All Files

2 files
SKILL.md6.6 KB
View
references/realtime.md6.1 KB
View

Install trigger-realtime

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill