Trigger realtime and frontend

From code-with-antonio/browser-automation-app · View interactive version

Trigger realtime and frontend is an AI agent skill from the GitHub repository code-with-antonio/browser-automation-app. Trigger.dev client/frontend surface: subscribe to runs in realtime (runs.subscribeToRun and the @trigger.dev/react-hooks hook useRealtimeRun), consume metadata and AI/text streams in React (useRealtimeStream), trigger tasks from the browser (useTaskTrigger, useRealtimeTaskTrigger), and mint scoped f

How to use this skill

Skill file

Realtime and Frontend

The full, version-pinned reference ships inside your installed @trigger.dev/sdk. Read it before writing code — it always matches the SDK version in this project, so it never drifts:

If those paths don't exist, @trigger.dev/sdk isn't installed yet — install it first. In a non-hoisted layout, resolve the package with node -p "require.resolve('@trigger.dev/sdk/package.json')" and read skills/ + docs/ beside it.

Common mistakes

  1. CRITICAL: Triggering from the browser with a Public Access Token. The

read token from createPublicToken cannot trigger tasks.

  1. Token with no scopes. A scopeless token authorizes nothing, so every subscribe 403s.
  1. Polling with useRun/SWR for live updates. useRun is the SWR-based

management-API hook (not recommended for live state); set refreshInterval: 0

to stop polling if you do use it.

  1. Forgetting "use client". Realtime/trigger hooks cannot run in a server component.
  1. Shipping payload/output you do not render.
  1. Subscribing before the handle exists.

References

Sibling skills: trigger-authoring-tasks (the task side: streams.define(), metadata.set(), wait.createToken), trigger-authoring-chat-agent and trigger-chat-agent-advanced (chat agents build on these realtime streams).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.