[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-trigger-dev-trigger-realtime-and-frontend":3,"mdc--5pytl5-key":48,"related-repo-trigger-dev-trigger-realtime-and-frontend":5302,"related-org-trigger-dev-trigger-realtime-and-frontend":5347},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":43,"sourceUrl":46,"mdContent":47},"trigger-realtime-and-frontend","subscribe to Trigger.dev runs in realtime","Trigger.dev client\u002Ffrontend surface: subscribe to runs in realtime (runs.subscribeToRun and the @trigger.dev\u002Freact-hooks hook useRealtimeRun), consume metadata and AI\u002Ftext streams in React (useRealtimeStream), trigger tasks from the browser (useTaskTrigger, useRealtimeTaskTrigger), and mint scoped frontend credentials with auth.createPublicToken \u002F auth.createTriggerPublicToken. Load when wiring a frontend (React\u002FNext.js\u002FRemix) or backend-for-frontend to show live run progress, status badges, token streams, trigger buttons, or wait-token approval UIs. NOT for writing the backend task itself (streams.define \u002F metadata.set is trigger-authoring-tasks territory); this is the consumer side.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"trigger-dev","Trigger.dev","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftrigger-dev.jpg","triggerdotdev",[13,17,18,21],{"name":14,"slug":15,"type":16},"React","react","tag",{"name":9,"slug":8,"type":16},{"name":19,"slug":20,"type":16},"Real-time","real-time",{"name":22,"slug":23,"type":16},"Frontend","frontend",14401,"https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Ftrigger.dev","2026-07-02T17:12:49.717706",null,1131,[30,31,32,33,34,35,36,37,38,39,40,41,42],"ai","ai-agent-framework","ai-agents","automation","background-jobs","mcp","mcp-server","nextjs","orchestration","scheduler","serverless","workflow-automation","workflows",{"repoUrl":25,"stars":24,"forks":28,"topics":44,"description":45},[30,31,32,33,34,35,36,37,38,39,40,41,42],"Trigger.dev – build and deploy fully‑managed AI agents and workflows","https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Ftrigger.dev\u002Ftree\u002FHEAD\u002Fpackages\u002Ftrigger-sdk\u002Fskills\u002Ftrigger-realtime-and-frontend","---\nname: trigger-realtime-and-frontend\ndescription: >\n  Trigger.dev client\u002Ffrontend surface: subscribe to runs in realtime\n  (runs.subscribeToRun and the @trigger.dev\u002Freact-hooks hook useRealtimeRun),\n  consume metadata and AI\u002Ftext streams in React (useRealtimeStream), trigger\n  tasks from the browser (useTaskTrigger, useRealtimeTaskTrigger), and mint\n  scoped frontend credentials with auth.createPublicToken \u002F\n  auth.createTriggerPublicToken.\n  Load when wiring a frontend (React\u002FNext.js\u002FRemix) or backend-for-frontend to\n  show live run progress, status badges, token streams, trigger buttons, or\n  wait-token approval UIs. NOT for writing the backend task itself (streams.define\n  \u002F metadata.set is trigger-authoring-tasks territory); this is the consumer side.\ntype: core\nlibrary: trigger.dev\nsources:\n  - docs\u002Frealtime\u002Foverview.mdx\n  - docs\u002Frealtime\u002Fhow-it-works.mdx\n  - docs\u002Frealtime\u002Fauth.mdx\n  - docs\u002Frealtime\u002Frun-object.mdx\n  - docs\u002Frealtime\u002Freact-hooks\u002Foverview.mdx\n  - docs\u002Frealtime\u002Freact-hooks\u002Fsubscribe.mdx\n  - docs\u002Frealtime\u002Freact-hooks\u002Ftriggering.mdx\n  - docs\u002Frealtime\u002Freact-hooks\u002Fstreams.mdx\n  - docs\u002Frealtime\u002Freact-hooks\u002Fswr.mdx\n  - docs\u002Frealtime\u002Freact-hooks\u002Fuse-wait-token.mdx\n  - docs\u002Frealtime\u002Fbackend\u002Fsubscribe.mdx\n---\n\n# Realtime and Frontend\n\nThe consumer side of Trigger.dev's run state and streams: read live run\nupdates, render AI\u002Ftext streams, and trigger tasks from a browser. Hooks come\nfrom `@trigger.dev\u002Freact-hooks`; token minting and backend subscription come\nfrom `@trigger.dev\u002Fsdk`.\n\n## Setup\n\n```bash\nnpm add @trigger.dev\u002Freact-hooks   # frontend hooks (React\u002FNext.js\u002FRemix)\n# @trigger.dev\u002Fsdk is already installed for the backend\n```\n\nThe flow is always: mint a scoped token in the backend, pass it to the\nfrontend, subscribe with a hook.\n\n```ts\n\u002F\u002F backend (API route \u002F server action)\nimport { auth } from \"@trigger.dev\u002Fsdk\";\n\nconst publicAccessToken = await auth.createPublicToken({\n  scopes: { read: { runs: [\"run_1234\"] } }, \u002F\u002F a token with no scopes is useless\n});\n```\n\n```tsx\n\u002F\u002F frontend\n\"use client\";\nimport { useRealtimeRun } from \"@trigger.dev\u002Freact-hooks\";\n\nexport function RunStatus({ runId, publicAccessToken }: { runId: string; publicAccessToken: string }) {\n  const { run, error } = useRealtimeRun(runId, { accessToken: publicAccessToken });\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n  if (!run) return \u003Cdiv>Loading...\u003C\u002Fdiv>;\n  return \u003Cdiv>Run: {run.status}\u003C\u002Fdiv>;\n}\n```\n\nThere are two token kinds: Public Access Tokens (read\u002Fsubscribe, from\n`auth.createPublicToken`) and Trigger Tokens (trigger-from-browser, single-use,\nfrom `auth.createTriggerPublicToken`). Both default to a 15 minute expiry.\n\n## Core patterns\n\n### 1. Subscribe to a run and render metadata progress\n\n`metadata` is `Record\u003Cstring, DeserializedJson>`, so nested values need a cast.\n\n```tsx\n\"use client\";\nimport { useRealtimeRun } from \"@trigger.dev\u002Freact-hooks\";\nimport type { myTask } from \"@\u002Ftrigger\u002FmyTask\";\n\nexport function Progress({ runId, publicAccessToken }: { runId: string; publicAccessToken: string }) {\n  const { run, error } = useRealtimeRun\u003Ctypeof myTask>(runId, { accessToken: publicAccessToken });\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n  if (!run) return \u003Cdiv>Loading...\u003C\u002Fdiv>;\n  const progress = run.metadata?.progress as { percentage?: number } | undefined;\n  return \u003Cdiv>{run.status}: {progress?.percentage ?? 0}%\u003C\u002Fdiv>;\n}\n```\n\nPass `onComplete: (run, error) => {}` to react when the run finishes.\n\n### 2. Status-only subscription with `skipColumns`\n\nFor a badge or progress bar you do not need `payload`\u002F`output`. Skipping them\nreduces wire size and avoids \"Large HTTP Payload\" warnings.\n\n```tsx\nconst { run } = useRealtimeRun(runId, {\n  accessToken: publicAccessToken,\n  skipColumns: [\"payload\", \"output\"],\n});\n```\n\nYou can skip any of: `payload`, `output`, `metadata`, `startedAt`, `delayUntil`,\n`queuedAt`, `expiredAt`, `completedAt`, `number`, `isTest`, `usageDurationMs`,\n`costInCents`, `baseCostInCents`, `ttl`, `payloadType`, `outputType`, `runTags`,\n`error`.\n\n### 3. Trigger from the browser with a Trigger Token\n\n`accessToken` here is a Trigger Token (`auth.createTriggerPublicToken`), not a\nPublic Access Token.\n\n```tsx\n\"use client\";\nimport { useTaskTrigger } from \"@trigger.dev\u002Freact-hooks\";\nimport type { myTask } from \"@\u002Ftrigger\u002FmyTask\";\n\nexport function TriggerButton({ triggerToken }: { triggerToken: string }) {\n  const { submit, handle, isLoading } = useTaskTrigger\u003Ctypeof myTask>(\"my-task\", {\n    accessToken: triggerToken,\n  });\n  if (handle) return \u003Cdiv>Run ID: {handle.id}\u003C\u002Fdiv>;\n  return (\n    \u003Cbutton onClick={() => submit({ foo: \"bar\" }, { tags: [\"user:123\"] })} disabled={isLoading}>\n      {isLoading ? \"Triggering...\" : \"Run\"}\n    \u003C\u002Fbutton>\n  );\n}\n```\n\n`submit(payload, options?)` takes the same options as a backend `trigger` call.\n\n### 4. Trigger and subscribe in one hook\n\n```tsx\n\"use client\";\nimport { useRealtimeTaskTrigger } from \"@trigger.dev\u002Freact-hooks\";\nimport type { myTask } from \"@\u002Ftrigger\u002FmyTask\";\n\nexport function Runner({ publicAccessToken }: { publicAccessToken: string }) {\n  const { submit, run, isLoading } = useRealtimeTaskTrigger\u003Ctypeof myTask>(\"my-task\", {\n    accessToken: publicAccessToken,\n  });\n  if (run) return \u003Cdiv>{run.status}\u003C\u002Fdiv>;\n  return \u003Cbutton onClick={() => submit({ foo: \"bar\" })} disabled={isLoading}>Run\u003C\u002Fbutton>;\n}\n```\n\nUse `useRealtimeTaskTriggerWithStreams\u003Ctypeof myTask, STREAMS>` when you also\nwant the task's streams (it returns `{ submit, run, streams, error, isLoading }`).\n\n### 5. Consume an AI\u002Ftext stream (SDK 4.1.0+, recommended)\n\n`useRealtimeStream` takes a defined stream for full type safety, or a `runId`\nplus optional stream key. Returns `{ parts, error }`.\n\n```tsx\n\"use client\";\nimport { useRealtimeStream } from \"@trigger.dev\u002Freact-hooks\";\nimport { aiStream } from \"@\u002Ftrigger\u002Fstreams\"; \u002F\u002F a defined stream -> typed parts\n\nexport function StreamView({ runId, publicAccessToken }: { runId: string; publicAccessToken: string }) {\n  const { parts, error } = useRealtimeStream(aiStream, runId, {\n    accessToken: publicAccessToken,\n    timeoutInSeconds: 300, \u002F\u002F default 60\n    onData: (chunk) => console.log(chunk),\n  });\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n  if (!parts) return \u003Cdiv>Loading...\u003C\u002Fdiv>;\n  return \u003Cdiv>{parts.join(\"\")}\u003C\u002Fdiv>;\n}\n```\n\nWithout a defined stream: `useRealtimeStream\u003Cstring>(runId, \"ai-output\", { accessToken })`,\nor omit the key to use the default stream. Other options: `baseURL`, `startIndex`,\n`throttleInMs` (default 16). The legacy `useRealtimeRunWithStreams(runId, options)`\nhook is still supported when you need both the run and all its streams at once.\n\n### 6. Send input back into a running task\n\n```tsx\n\"use client\";\nimport { useInputStreamSend } from \"@trigger.dev\u002Freact-hooks\";\nimport { approval } from \"@\u002Ftrigger\u002Fstreams\";\n\nexport function ApprovalForm({ runId, accessToken }: { runId: string; accessToken: string }) {\n  const { send, isLoading, isReady } = useInputStreamSend(approval.id, runId, { accessToken });\n  return (\n    \u003Cbutton disabled={!isReady || isLoading} onClick={() => send({ approved: true })}>\n      Approve\n    \u003C\u002Fbutton>\n  );\n}\n```\n\n### 7. Complete a wait token from React\n\n```ts\n\u002F\u002F backend: create the token, return id + publicAccessToken to the frontend\nimport { wait } from \"@trigger.dev\u002Fsdk\";\nconst token = await wait.createToken({ timeout: \"10m\" });\nreturn { tokenId: token.id, publicToken: token.publicAccessToken };\n```\n\n```tsx\n\"use client\";\nimport { useWaitToken } from \"@trigger.dev\u002Freact-hooks\";\n\nexport function Approve({ tokenId, publicToken }: { tokenId: string; publicToken: string }) {\n  const { complete } = useWaitToken(tokenId, { accessToken: publicToken });\n  return \u003Cbutton onClick={() => complete({ approved: true })}>Approve\u003C\u002Fbutton>;\n}\n```\n\n### 8. Subscribe from the backend (async iterators)\n\n```ts\nimport { runs, tasks } from \"@trigger.dev\u002Fsdk\";\nimport type { myTask } from \".\u002Ftrigger\u002Fmy-task\";\n\nconst handle = await tasks.trigger(\"my-task\", { some: \"data\" });\nfor await (const run of runs.subscribeToRun\u003Ctypeof myTask>(handle.id)) {\n  console.log(run.payload.some, run.output?.some); \u002F\u002F typed\n}\n```\n\n`runs.subscribeToRun` completes when the run finishes, so the loop exits on its own.\n\n## Common mistakes\n\n1. **CRITICAL: Triggering from the browser with a Public Access Token.** The\n   read token from `createPublicToken` cannot trigger tasks.\n   - Wrong: `useTaskTrigger(\"my-task\", { accessToken: publicAccessTokenFromCreatePublicToken })`\n   - Correct: mint a single-use Trigger Token with `auth.createTriggerPublicToken(\"my-task\")` and pass that.\n\n2. **Token with no scopes.** A scopeless token authorizes nothing, so every subscribe 403s.\n   - Wrong: `await auth.createPublicToken()`\n   - Correct: `await auth.createPublicToken({ scopes: { read: { runs: [\"run_1234\"] } } })`\n\n3. **Polling with `useRun`\u002FSWR for live updates.** `useRun` is the SWR-based\n   management-API hook (not recommended for live state); set `refreshInterval: 0`\n   to stop polling if you do use it.\n   - Wrong: `useRun(runId, { refreshInterval: 1000 })` to track progress\n   - Correct: `useRealtimeRun(runId, { accessToken })` (no polling, no WebSocket setup)\n\n4. **Forgetting `\"use client\"`.** Realtime\u002Ftrigger hooks cannot run in a server component.\n   - Wrong: a Next.js App Router server component using `useRealtimeRun`\n   - Correct: put `\"use client\";` at the top of any component using these hooks.\n\n5. **Shipping `payload`\u002F`output` you do not render.**\n   - Wrong: `useRealtimeRun(runId, { accessToken })` for a status badge (large payloads over the wire)\n   - Correct: `useRealtimeRun(runId, { accessToken, skipColumns: [\"payload\", \"output\"] })`\n\n6. **Subscribing before the handle exists.**\n   - Wrong: `useRealtimeRun(handle, { accessToken: handle?.publicAccessToken })` with no guard\n   - Correct: add `enabled: !!handle` so it subscribes only once the trigger returns a handle.\n\n## References\n\nSibling skills:\n- `trigger-authoring-tasks` for the task side: `streams.define()`, `metadata.set()`, and `wait.createToken`.\n- `trigger-authoring-chat-agent` and `trigger-chat-agent-advanced` for chat agents, which build on these realtime streams.\n\nReference docs ship beside this skill in the same package, read them locally (no network), pinned to your installed version. The `sources:` frontmatter above lists every doc this skill draws from, all under `@trigger.dev\u002Fsdk\u002Fdocs\u002F`. Start with:\n- `@trigger.dev\u002Fsdk\u002Fdocs\u002Frealtime\u002Freact-hooks\u002Fsubscribe.mdx`\n- `@trigger.dev\u002Fsdk\u002Fdocs\u002Frealtime\u002Freact-hooks\u002Fstreams.mdx`\n- `@trigger.dev\u002Fsdk\u002Fdocs\u002Frealtime\u002Fauth.mdx`\n- `@trigger.dev\u002Fsdk\u002Fdocs\u002Frealtime\u002Frun-object.mdx` (the realtime run object differs from the management-API object returned by `useRun`)\n\n## Version\n\nThis skill is bundled inside `@trigger.dev\u002Fsdk` and read directly from `node_modules`, so it always matches your installed SDK version (see the adjacent `package.json`). The full documentation for these APIs ships alongside it under `@trigger.dev\u002Fsdk\u002Fdocs\u002F`.\n",{"data":49,"body":64},{"name":4,"description":6,"type":50,"library":51,"sources":52},"core","trigger.dev",[53,54,55,56,57,58,59,60,61,62,63],"docs\u002Frealtime\u002Foverview.mdx","docs\u002Frealtime\u002Fhow-it-works.mdx","docs\u002Frealtime\u002Fauth.mdx","docs\u002Frealtime\u002Frun-object.mdx","docs\u002Frealtime\u002Freact-hooks\u002Foverview.mdx","docs\u002Frealtime\u002Freact-hooks\u002Fsubscribe.mdx","docs\u002Frealtime\u002Freact-hooks\u002Ftriggering.mdx","docs\u002Frealtime\u002Freact-hooks\u002Fstreams.mdx","docs\u002Frealtime\u002Freact-hooks\u002Fswr.mdx","docs\u002Frealtime\u002Freact-hooks\u002Fuse-wait-token.mdx","docs\u002Frealtime\u002Fbackend\u002Fsubscribe.mdx",{"type":65,"children":66},"root",[67,76,99,106,155,160,382,840,861,867,874,893,1475,1488,1500,1521,1658,1786,1792,1810,2406,2425,2431,2882,2903,2909,2934,3496,3539,3545,3971,3977,4171,4476,4482,4835,4846,4852,5122,5128,5133,5188,5209,5256,5262,5296],{"type":68,"tag":69,"props":70,"children":72},"element","h1",{"id":71},"realtime-and-frontend",[73],{"type":74,"value":75},"text","Realtime and Frontend",{"type":68,"tag":77,"props":78,"children":79},"p",{},[80,82,89,91,97],{"type":74,"value":81},"The consumer side of Trigger.dev's run state and streams: read live run\nupdates, render AI\u002Ftext streams, and trigger tasks from a browser. Hooks come\nfrom ",{"type":68,"tag":83,"props":84,"children":86},"code",{"className":85},[],[87],{"type":74,"value":88},"@trigger.dev\u002Freact-hooks",{"type":74,"value":90},"; token minting and backend subscription come\nfrom ",{"type":68,"tag":83,"props":92,"children":94},{"className":93},[],[95],{"type":74,"value":96},"@trigger.dev\u002Fsdk",{"type":74,"value":98},".",{"type":68,"tag":100,"props":101,"children":103},"h2",{"id":102},"setup",[104],{"type":74,"value":105},"Setup",{"type":68,"tag":107,"props":108,"children":113},"pre",{"className":109,"code":110,"language":111,"meta":112,"style":112},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm add @trigger.dev\u002Freact-hooks   # frontend hooks (React\u002FNext.js\u002FRemix)\n# @trigger.dev\u002Fsdk is already installed for the backend\n","bash","",[114],{"type":68,"tag":83,"props":115,"children":116},{"__ignoreMap":112},[117,146],{"type":68,"tag":118,"props":119,"children":122},"span",{"class":120,"line":121},"line",1,[123,129,135,140],{"type":68,"tag":118,"props":124,"children":126},{"style":125},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[127],{"type":74,"value":128},"npm",{"type":68,"tag":118,"props":130,"children":132},{"style":131},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[133],{"type":74,"value":134}," add",{"type":68,"tag":118,"props":136,"children":137},{"style":131},[138],{"type":74,"value":139}," @trigger.dev\u002Freact-hooks",{"type":68,"tag":118,"props":141,"children":143},{"style":142},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[144],{"type":74,"value":145},"   # frontend hooks (React\u002FNext.js\u002FRemix)\n",{"type":68,"tag":118,"props":147,"children":149},{"class":120,"line":148},2,[150],{"type":68,"tag":118,"props":151,"children":152},{"style":142},[153],{"type":74,"value":154},"# @trigger.dev\u002Fsdk is already installed for the backend\n",{"type":68,"tag":77,"props":156,"children":157},{},[158],{"type":74,"value":159},"The flow is always: mint a scoped token in the backend, pass it to the\nfrontend, subscribe with a hook.",{"type":68,"tag":107,"props":161,"children":165},{"className":162,"code":163,"language":164,"meta":112,"style":112},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F backend (API route \u002F server action)\nimport { auth } from \"@trigger.dev\u002Fsdk\";\n\nconst publicAccessToken = await auth.createPublicToken({\n  scopes: { read: { runs: [\"run_1234\"] } }, \u002F\u002F a token with no scopes is useless\n});\n","ts",[166],{"type":68,"tag":83,"props":167,"children":168},{"__ignoreMap":112},[169,177,227,237,286,365],{"type":68,"tag":118,"props":170,"children":171},{"class":120,"line":121},[172],{"type":68,"tag":118,"props":173,"children":174},{"style":142},[175],{"type":74,"value":176},"\u002F\u002F backend (API route \u002F server action)\n",{"type":68,"tag":118,"props":178,"children":179},{"class":120,"line":148},[180,186,192,198,203,208,213,217,222],{"type":68,"tag":118,"props":181,"children":183},{"style":182},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[184],{"type":74,"value":185},"import",{"type":68,"tag":118,"props":187,"children":189},{"style":188},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[190],{"type":74,"value":191}," {",{"type":68,"tag":118,"props":193,"children":195},{"style":194},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[196],{"type":74,"value":197}," auth",{"type":68,"tag":118,"props":199,"children":200},{"style":188},[201],{"type":74,"value":202}," }",{"type":68,"tag":118,"props":204,"children":205},{"style":182},[206],{"type":74,"value":207}," from",{"type":68,"tag":118,"props":209,"children":210},{"style":188},[211],{"type":74,"value":212}," \"",{"type":68,"tag":118,"props":214,"children":215},{"style":131},[216],{"type":74,"value":96},{"type":68,"tag":118,"props":218,"children":219},{"style":188},[220],{"type":74,"value":221},"\"",{"type":68,"tag":118,"props":223,"children":224},{"style":188},[225],{"type":74,"value":226},";\n",{"type":68,"tag":118,"props":228,"children":230},{"class":120,"line":229},3,[231],{"type":68,"tag":118,"props":232,"children":234},{"emptyLinePlaceholder":233},true,[235],{"type":74,"value":236},"\n",{"type":68,"tag":118,"props":238,"children":240},{"class":120,"line":239},4,[241,247,252,257,262,266,270,276,281],{"type":68,"tag":118,"props":242,"children":244},{"style":243},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[245],{"type":74,"value":246},"const",{"type":68,"tag":118,"props":248,"children":249},{"style":194},[250],{"type":74,"value":251}," publicAccessToken ",{"type":68,"tag":118,"props":253,"children":254},{"style":188},[255],{"type":74,"value":256},"=",{"type":68,"tag":118,"props":258,"children":259},{"style":182},[260],{"type":74,"value":261}," await",{"type":68,"tag":118,"props":263,"children":264},{"style":194},[265],{"type":74,"value":197},{"type":68,"tag":118,"props":267,"children":268},{"style":188},[269],{"type":74,"value":98},{"type":68,"tag":118,"props":271,"children":273},{"style":272},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[274],{"type":74,"value":275},"createPublicToken",{"type":68,"tag":118,"props":277,"children":278},{"style":194},[279],{"type":74,"value":280},"(",{"type":68,"tag":118,"props":282,"children":283},{"style":188},[284],{"type":74,"value":285},"{\n",{"type":68,"tag":118,"props":287,"children":289},{"class":120,"line":288},5,[290,296,301,305,310,314,318,323,327,332,336,341,345,350,355,360],{"type":68,"tag":118,"props":291,"children":293},{"style":292},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[294],{"type":74,"value":295},"  scopes",{"type":68,"tag":118,"props":297,"children":298},{"style":188},[299],{"type":74,"value":300},":",{"type":68,"tag":118,"props":302,"children":303},{"style":188},[304],{"type":74,"value":191},{"type":68,"tag":118,"props":306,"children":307},{"style":292},[308],{"type":74,"value":309}," read",{"type":68,"tag":118,"props":311,"children":312},{"style":188},[313],{"type":74,"value":300},{"type":68,"tag":118,"props":315,"children":316},{"style":188},[317],{"type":74,"value":191},{"type":68,"tag":118,"props":319,"children":320},{"style":292},[321],{"type":74,"value":322}," runs",{"type":68,"tag":118,"props":324,"children":325},{"style":188},[326],{"type":74,"value":300},{"type":68,"tag":118,"props":328,"children":329},{"style":194},[330],{"type":74,"value":331}," [",{"type":68,"tag":118,"props":333,"children":334},{"style":188},[335],{"type":74,"value":221},{"type":68,"tag":118,"props":337,"children":338},{"style":131},[339],{"type":74,"value":340},"run_1234",{"type":68,"tag":118,"props":342,"children":343},{"style":188},[344],{"type":74,"value":221},{"type":68,"tag":118,"props":346,"children":347},{"style":194},[348],{"type":74,"value":349},"] ",{"type":68,"tag":118,"props":351,"children":352},{"style":188},[353],{"type":74,"value":354},"}",{"type":68,"tag":118,"props":356,"children":357},{"style":188},[358],{"type":74,"value":359}," },",{"type":68,"tag":118,"props":361,"children":362},{"style":142},[363],{"type":74,"value":364}," \u002F\u002F a token with no scopes is useless\n",{"type":68,"tag":118,"props":366,"children":368},{"class":120,"line":367},6,[369,373,378],{"type":68,"tag":118,"props":370,"children":371},{"style":188},[372],{"type":74,"value":354},{"type":68,"tag":118,"props":374,"children":375},{"style":194},[376],{"type":74,"value":377},")",{"type":68,"tag":118,"props":379,"children":380},{"style":188},[381],{"type":74,"value":226},{"type":68,"tag":107,"props":383,"children":387},{"className":384,"code":385,"language":386,"meta":112,"style":112},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F frontend\n\"use client\";\nimport { useRealtimeRun } from \"@trigger.dev\u002Freact-hooks\";\n\nexport function RunStatus({ runId, publicAccessToken }: { runId: string; publicAccessToken: string }) {\n  const { run, error } = useRealtimeRun(runId, { accessToken: publicAccessToken });\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n  if (!run) return \u003Cdiv>Loading...\u003C\u002Fdiv>;\n  return \u003Cdiv>Run: {run.status}\u003C\u002Fdiv>;\n}\n","tsx",[388],{"type":68,"tag":83,"props":389,"children":390},{"__ignoreMap":112},[391,399,419,459,466,554,635,716,776,831],{"type":68,"tag":118,"props":392,"children":393},{"class":120,"line":121},[394],{"type":68,"tag":118,"props":395,"children":396},{"style":142},[397],{"type":74,"value":398},"\u002F\u002F frontend\n",{"type":68,"tag":118,"props":400,"children":401},{"class":120,"line":148},[402,406,411,415],{"type":68,"tag":118,"props":403,"children":404},{"style":188},[405],{"type":74,"value":221},{"type":68,"tag":118,"props":407,"children":408},{"style":131},[409],{"type":74,"value":410},"use client",{"type":68,"tag":118,"props":412,"children":413},{"style":188},[414],{"type":74,"value":221},{"type":68,"tag":118,"props":416,"children":417},{"style":188},[418],{"type":74,"value":226},{"type":68,"tag":118,"props":420,"children":421},{"class":120,"line":229},[422,426,430,435,439,443,447,451,455],{"type":68,"tag":118,"props":423,"children":424},{"style":182},[425],{"type":74,"value":185},{"type":68,"tag":118,"props":427,"children":428},{"style":188},[429],{"type":74,"value":191},{"type":68,"tag":118,"props":431,"children":432},{"style":194},[433],{"type":74,"value":434}," useRealtimeRun",{"type":68,"tag":118,"props":436,"children":437},{"style":188},[438],{"type":74,"value":202},{"type":68,"tag":118,"props":440,"children":441},{"style":182},[442],{"type":74,"value":207},{"type":68,"tag":118,"props":444,"children":445},{"style":188},[446],{"type":74,"value":212},{"type":68,"tag":118,"props":448,"children":449},{"style":131},[450],{"type":74,"value":88},{"type":68,"tag":118,"props":452,"children":453},{"style":188},[454],{"type":74,"value":221},{"type":68,"tag":118,"props":456,"children":457},{"style":188},[458],{"type":74,"value":226},{"type":68,"tag":118,"props":460,"children":461},{"class":120,"line":239},[462],{"type":68,"tag":118,"props":463,"children":464},{"emptyLinePlaceholder":233},[465],{"type":74,"value":236},{"type":68,"tag":118,"props":467,"children":468},{"class":120,"line":288},[469,474,479,484,489,495,500,505,510,514,518,522,527,532,536,540,544,549],{"type":68,"tag":118,"props":470,"children":471},{"style":182},[472],{"type":74,"value":473},"export",{"type":68,"tag":118,"props":475,"children":476},{"style":243},[477],{"type":74,"value":478}," function",{"type":68,"tag":118,"props":480,"children":481},{"style":272},[482],{"type":74,"value":483}," RunStatus",{"type":68,"tag":118,"props":485,"children":486},{"style":188},[487],{"type":74,"value":488},"({",{"type":68,"tag":118,"props":490,"children":492},{"style":491},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[493],{"type":74,"value":494}," runId",{"type":68,"tag":118,"props":496,"children":497},{"style":188},[498],{"type":74,"value":499},",",{"type":68,"tag":118,"props":501,"children":502},{"style":491},[503],{"type":74,"value":504}," publicAccessToken",{"type":68,"tag":118,"props":506,"children":507},{"style":188},[508],{"type":74,"value":509}," }:",{"type":68,"tag":118,"props":511,"children":512},{"style":188},[513],{"type":74,"value":191},{"type":68,"tag":118,"props":515,"children":516},{"style":292},[517],{"type":74,"value":494},{"type":68,"tag":118,"props":519,"children":520},{"style":188},[521],{"type":74,"value":300},{"type":68,"tag":118,"props":523,"children":524},{"style":125},[525],{"type":74,"value":526}," string",{"type":68,"tag":118,"props":528,"children":529},{"style":188},[530],{"type":74,"value":531},";",{"type":68,"tag":118,"props":533,"children":534},{"style":292},[535],{"type":74,"value":504},{"type":68,"tag":118,"props":537,"children":538},{"style":188},[539],{"type":74,"value":300},{"type":68,"tag":118,"props":541,"children":542},{"style":125},[543],{"type":74,"value":526},{"type":68,"tag":118,"props":545,"children":546},{"style":188},[547],{"type":74,"value":548}," })",{"type":68,"tag":118,"props":550,"children":551},{"style":188},[552],{"type":74,"value":553}," {\n",{"type":68,"tag":118,"props":555,"children":556},{"class":120,"line":367},[557,562,566,571,575,580,584,589,593,597,602,606,610,615,619,623,627,631],{"type":68,"tag":118,"props":558,"children":559},{"style":243},[560],{"type":74,"value":561},"  const",{"type":68,"tag":118,"props":563,"children":564},{"style":188},[565],{"type":74,"value":191},{"type":68,"tag":118,"props":567,"children":568},{"style":194},[569],{"type":74,"value":570}," run",{"type":68,"tag":118,"props":572,"children":573},{"style":188},[574],{"type":74,"value":499},{"type":68,"tag":118,"props":576,"children":577},{"style":194},[578],{"type":74,"value":579}," error",{"type":68,"tag":118,"props":581,"children":582},{"style":188},[583],{"type":74,"value":202},{"type":68,"tag":118,"props":585,"children":586},{"style":188},[587],{"type":74,"value":588}," =",{"type":68,"tag":118,"props":590,"children":591},{"style":272},[592],{"type":74,"value":434},{"type":68,"tag":118,"props":594,"children":595},{"style":292},[596],{"type":74,"value":280},{"type":68,"tag":118,"props":598,"children":599},{"style":194},[600],{"type":74,"value":601},"runId",{"type":68,"tag":118,"props":603,"children":604},{"style":188},[605],{"type":74,"value":499},{"type":68,"tag":118,"props":607,"children":608},{"style":188},[609],{"type":74,"value":191},{"type":68,"tag":118,"props":611,"children":612},{"style":292},[613],{"type":74,"value":614}," accessToken",{"type":68,"tag":118,"props":616,"children":617},{"style":188},[618],{"type":74,"value":300},{"type":68,"tag":118,"props":620,"children":621},{"style":194},[622],{"type":74,"value":504},{"type":68,"tag":118,"props":624,"children":625},{"style":188},[626],{"type":74,"value":202},{"type":68,"tag":118,"props":628,"children":629},{"style":292},[630],{"type":74,"value":377},{"type":68,"tag":118,"props":632,"children":633},{"style":188},[634],{"type":74,"value":226},{"type":68,"tag":118,"props":636,"children":638},{"class":120,"line":637},7,[639,644,649,654,659,664,669,674,679,684,689,693,697,702,707,711],{"type":68,"tag":118,"props":640,"children":641},{"style":182},[642],{"type":74,"value":643},"  if",{"type":68,"tag":118,"props":645,"children":646},{"style":292},[647],{"type":74,"value":648}," (",{"type":68,"tag":118,"props":650,"children":651},{"style":194},[652],{"type":74,"value":653},"error",{"type":68,"tag":118,"props":655,"children":656},{"style":292},[657],{"type":74,"value":658},") ",{"type":68,"tag":118,"props":660,"children":661},{"style":182},[662],{"type":74,"value":663},"return",{"type":68,"tag":118,"props":665,"children":666},{"style":188},[667],{"type":74,"value":668}," \u003C",{"type":68,"tag":118,"props":670,"children":671},{"style":292},[672],{"type":74,"value":673},"div",{"type":68,"tag":118,"props":675,"children":676},{"style":188},[677],{"type":74,"value":678},">",{"type":68,"tag":118,"props":680,"children":681},{"style":194},[682],{"type":74,"value":683},"Error: ",{"type":68,"tag":118,"props":685,"children":686},{"style":188},[687],{"type":74,"value":688},"{",{"type":68,"tag":118,"props":690,"children":691},{"style":194},[692],{"type":74,"value":653},{"type":68,"tag":118,"props":694,"children":695},{"style":188},[696],{"type":74,"value":98},{"type":68,"tag":118,"props":698,"children":699},{"style":194},[700],{"type":74,"value":701},"message",{"type":68,"tag":118,"props":703,"children":704},{"style":188},[705],{"type":74,"value":706},"}\u003C\u002F",{"type":68,"tag":118,"props":708,"children":709},{"style":292},[710],{"type":74,"value":673},{"type":68,"tag":118,"props":712,"children":713},{"style":188},[714],{"type":74,"value":715},">;\n",{"type":68,"tag":118,"props":717,"children":719},{"class":120,"line":718},8,[720,724,728,733,738,742,746,750,754,758,763,768,772],{"type":68,"tag":118,"props":721,"children":722},{"style":182},[723],{"type":74,"value":643},{"type":68,"tag":118,"props":725,"children":726},{"style":292},[727],{"type":74,"value":648},{"type":68,"tag":118,"props":729,"children":730},{"style":188},[731],{"type":74,"value":732},"!",{"type":68,"tag":118,"props":734,"children":735},{"style":194},[736],{"type":74,"value":737},"run",{"type":68,"tag":118,"props":739,"children":740},{"style":292},[741],{"type":74,"value":658},{"type":68,"tag":118,"props":743,"children":744},{"style":182},[745],{"type":74,"value":663},{"type":68,"tag":118,"props":747,"children":748},{"style":188},[749],{"type":74,"value":668},{"type":68,"tag":118,"props":751,"children":752},{"style":292},[753],{"type":74,"value":673},{"type":68,"tag":118,"props":755,"children":756},{"style":188},[757],{"type":74,"value":678},{"type":68,"tag":118,"props":759,"children":760},{"style":194},[761],{"type":74,"value":762},"Loading...",{"type":68,"tag":118,"props":764,"children":765},{"style":188},[766],{"type":74,"value":767},"\u003C\u002F",{"type":68,"tag":118,"props":769,"children":770},{"style":292},[771],{"type":74,"value":673},{"type":68,"tag":118,"props":773,"children":774},{"style":188},[775],{"type":74,"value":715},{"type":68,"tag":118,"props":777,"children":779},{"class":120,"line":778},9,[780,785,789,793,797,802,806,810,814,819,823,827],{"type":68,"tag":118,"props":781,"children":782},{"style":182},[783],{"type":74,"value":784},"  return",{"type":68,"tag":118,"props":786,"children":787},{"style":188},[788],{"type":74,"value":668},{"type":68,"tag":118,"props":790,"children":791},{"style":292},[792],{"type":74,"value":673},{"type":68,"tag":118,"props":794,"children":795},{"style":188},[796],{"type":74,"value":678},{"type":68,"tag":118,"props":798,"children":799},{"style":194},[800],{"type":74,"value":801},"Run: ",{"type":68,"tag":118,"props":803,"children":804},{"style":188},[805],{"type":74,"value":688},{"type":68,"tag":118,"props":807,"children":808},{"style":194},[809],{"type":74,"value":737},{"type":68,"tag":118,"props":811,"children":812},{"style":188},[813],{"type":74,"value":98},{"type":68,"tag":118,"props":815,"children":816},{"style":194},[817],{"type":74,"value":818},"status",{"type":68,"tag":118,"props":820,"children":821},{"style":188},[822],{"type":74,"value":706},{"type":68,"tag":118,"props":824,"children":825},{"style":292},[826],{"type":74,"value":673},{"type":68,"tag":118,"props":828,"children":829},{"style":188},[830],{"type":74,"value":715},{"type":68,"tag":118,"props":832,"children":834},{"class":120,"line":833},10,[835],{"type":68,"tag":118,"props":836,"children":837},{"style":188},[838],{"type":74,"value":839},"}\n",{"type":68,"tag":77,"props":841,"children":842},{},[843,845,851,853,859],{"type":74,"value":844},"There are two token kinds: Public Access Tokens (read\u002Fsubscribe, from\n",{"type":68,"tag":83,"props":846,"children":848},{"className":847},[],[849],{"type":74,"value":850},"auth.createPublicToken",{"type":74,"value":852},") and Trigger Tokens (trigger-from-browser, single-use,\nfrom ",{"type":68,"tag":83,"props":854,"children":856},{"className":855},[],[857],{"type":74,"value":858},"auth.createTriggerPublicToken",{"type":74,"value":860},"). Both default to a 15 minute expiry.",{"type":68,"tag":100,"props":862,"children":864},{"id":863},"core-patterns",[865],{"type":74,"value":866},"Core patterns",{"type":68,"tag":868,"props":869,"children":871},"h3",{"id":870},"_1-subscribe-to-a-run-and-render-metadata-progress",[872],{"type":74,"value":873},"1. Subscribe to a run and render metadata progress",{"type":68,"tag":77,"props":875,"children":876},{},[877,883,885,891],{"type":68,"tag":83,"props":878,"children":880},{"className":879},[],[881],{"type":74,"value":882},"metadata",{"type":74,"value":884}," is ",{"type":68,"tag":83,"props":886,"children":888},{"className":887},[],[889],{"type":74,"value":890},"Record\u003Cstring, DeserializedJson>",{"type":74,"value":892},", so nested values need a cast.",{"type":68,"tag":107,"props":894,"children":896},{"className":384,"code":895,"language":386,"meta":112,"style":112},"\"use client\";\nimport { useRealtimeRun } from \"@trigger.dev\u002Freact-hooks\";\nimport type { myTask } from \"@\u002Ftrigger\u002FmyTask\";\n\nexport function Progress({ runId, publicAccessToken }: { runId: string; publicAccessToken: string }) {\n  const { run, error } = useRealtimeRun\u003Ctypeof myTask>(runId, { accessToken: publicAccessToken });\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n  if (!run) return \u003Cdiv>Loading...\u003C\u002Fdiv>;\n  const progress = run.metadata?.progress as { percentage?: number } | undefined;\n  return \u003Cdiv>{run.status}: {progress?.percentage ?? 0}%\u003C\u002Fdiv>;\n}\n",[897],{"type":68,"tag":83,"props":898,"children":899},{"__ignoreMap":112},[900,919,958,1004,1011,1087,1175,1242,1297,1377,1467],{"type":68,"tag":118,"props":901,"children":902},{"class":120,"line":121},[903,907,911,915],{"type":68,"tag":118,"props":904,"children":905},{"style":188},[906],{"type":74,"value":221},{"type":68,"tag":118,"props":908,"children":909},{"style":131},[910],{"type":74,"value":410},{"type":68,"tag":118,"props":912,"children":913},{"style":188},[914],{"type":74,"value":221},{"type":68,"tag":118,"props":916,"children":917},{"style":188},[918],{"type":74,"value":226},{"type":68,"tag":118,"props":920,"children":921},{"class":120,"line":148},[922,926,930,934,938,942,946,950,954],{"type":68,"tag":118,"props":923,"children":924},{"style":182},[925],{"type":74,"value":185},{"type":68,"tag":118,"props":927,"children":928},{"style":188},[929],{"type":74,"value":191},{"type":68,"tag":118,"props":931,"children":932},{"style":194},[933],{"type":74,"value":434},{"type":68,"tag":118,"props":935,"children":936},{"style":188},[937],{"type":74,"value":202},{"type":68,"tag":118,"props":939,"children":940},{"style":182},[941],{"type":74,"value":207},{"type":68,"tag":118,"props":943,"children":944},{"style":188},[945],{"type":74,"value":212},{"type":68,"tag":118,"props":947,"children":948},{"style":131},[949],{"type":74,"value":88},{"type":68,"tag":118,"props":951,"children":952},{"style":188},[953],{"type":74,"value":221},{"type":68,"tag":118,"props":955,"children":956},{"style":188},[957],{"type":74,"value":226},{"type":68,"tag":118,"props":959,"children":960},{"class":120,"line":229},[961,965,970,974,979,983,987,991,996,1000],{"type":68,"tag":118,"props":962,"children":963},{"style":182},[964],{"type":74,"value":185},{"type":68,"tag":118,"props":966,"children":967},{"style":182},[968],{"type":74,"value":969}," type",{"type":68,"tag":118,"props":971,"children":972},{"style":188},[973],{"type":74,"value":191},{"type":68,"tag":118,"props":975,"children":976},{"style":194},[977],{"type":74,"value":978}," myTask",{"type":68,"tag":118,"props":980,"children":981},{"style":188},[982],{"type":74,"value":202},{"type":68,"tag":118,"props":984,"children":985},{"style":182},[986],{"type":74,"value":207},{"type":68,"tag":118,"props":988,"children":989},{"style":188},[990],{"type":74,"value":212},{"type":68,"tag":118,"props":992,"children":993},{"style":131},[994],{"type":74,"value":995},"@\u002Ftrigger\u002FmyTask",{"type":68,"tag":118,"props":997,"children":998},{"style":188},[999],{"type":74,"value":221},{"type":68,"tag":118,"props":1001,"children":1002},{"style":188},[1003],{"type":74,"value":226},{"type":68,"tag":118,"props":1005,"children":1006},{"class":120,"line":239},[1007],{"type":68,"tag":118,"props":1008,"children":1009},{"emptyLinePlaceholder":233},[1010],{"type":74,"value":236},{"type":68,"tag":118,"props":1012,"children":1013},{"class":120,"line":288},[1014,1018,1022,1027,1031,1035,1039,1043,1047,1051,1055,1059,1063,1067,1071,1075,1079,1083],{"type":68,"tag":118,"props":1015,"children":1016},{"style":182},[1017],{"type":74,"value":473},{"type":68,"tag":118,"props":1019,"children":1020},{"style":243},[1021],{"type":74,"value":478},{"type":68,"tag":118,"props":1023,"children":1024},{"style":272},[1025],{"type":74,"value":1026}," Progress",{"type":68,"tag":118,"props":1028,"children":1029},{"style":188},[1030],{"type":74,"value":488},{"type":68,"tag":118,"props":1032,"children":1033},{"style":491},[1034],{"type":74,"value":494},{"type":68,"tag":118,"props":1036,"children":1037},{"style":188},[1038],{"type":74,"value":499},{"type":68,"tag":118,"props":1040,"children":1041},{"style":491},[1042],{"type":74,"value":504},{"type":68,"tag":118,"props":1044,"children":1045},{"style":188},[1046],{"type":74,"value":509},{"type":68,"tag":118,"props":1048,"children":1049},{"style":188},[1050],{"type":74,"value":191},{"type":68,"tag":118,"props":1052,"children":1053},{"style":292},[1054],{"type":74,"value":494},{"type":68,"tag":118,"props":1056,"children":1057},{"style":188},[1058],{"type":74,"value":300},{"type":68,"tag":118,"props":1060,"children":1061},{"style":125},[1062],{"type":74,"value":526},{"type":68,"tag":118,"props":1064,"children":1065},{"style":188},[1066],{"type":74,"value":531},{"type":68,"tag":118,"props":1068,"children":1069},{"style":292},[1070],{"type":74,"value":504},{"type":68,"tag":118,"props":1072,"children":1073},{"style":188},[1074],{"type":74,"value":300},{"type":68,"tag":118,"props":1076,"children":1077},{"style":125},[1078],{"type":74,"value":526},{"type":68,"tag":118,"props":1080,"children":1081},{"style":188},[1082],{"type":74,"value":548},{"type":68,"tag":118,"props":1084,"children":1085},{"style":188},[1086],{"type":74,"value":553},{"type":68,"tag":118,"props":1088,"children":1089},{"class":120,"line":367},[1090,1094,1098,1102,1106,1110,1114,1118,1122,1127,1131,1135,1139,1143,1147,1151,1155,1159,1163,1167,1171],{"type":68,"tag":118,"props":1091,"children":1092},{"style":243},[1093],{"type":74,"value":561},{"type":68,"tag":118,"props":1095,"children":1096},{"style":188},[1097],{"type":74,"value":191},{"type":68,"tag":118,"props":1099,"children":1100},{"style":194},[1101],{"type":74,"value":570},{"type":68,"tag":118,"props":1103,"children":1104},{"style":188},[1105],{"type":74,"value":499},{"type":68,"tag":118,"props":1107,"children":1108},{"style":194},[1109],{"type":74,"value":579},{"type":68,"tag":118,"props":1111,"children":1112},{"style":188},[1113],{"type":74,"value":202},{"type":68,"tag":118,"props":1115,"children":1116},{"style":188},[1117],{"type":74,"value":588},{"type":68,"tag":118,"props":1119,"children":1120},{"style":272},[1121],{"type":74,"value":434},{"type":68,"tag":118,"props":1123,"children":1124},{"style":188},[1125],{"type":74,"value":1126},"\u003Ctypeof",{"type":68,"tag":118,"props":1128,"children":1129},{"style":194},[1130],{"type":74,"value":978},{"type":68,"tag":118,"props":1132,"children":1133},{"style":188},[1134],{"type":74,"value":678},{"type":68,"tag":118,"props":1136,"children":1137},{"style":292},[1138],{"type":74,"value":280},{"type":68,"tag":118,"props":1140,"children":1141},{"style":194},[1142],{"type":74,"value":601},{"type":68,"tag":118,"props":1144,"children":1145},{"style":188},[1146],{"type":74,"value":499},{"type":68,"tag":118,"props":1148,"children":1149},{"style":188},[1150],{"type":74,"value":191},{"type":68,"tag":118,"props":1152,"children":1153},{"style":292},[1154],{"type":74,"value":614},{"type":68,"tag":118,"props":1156,"children":1157},{"style":188},[1158],{"type":74,"value":300},{"type":68,"tag":118,"props":1160,"children":1161},{"style":194},[1162],{"type":74,"value":504},{"type":68,"tag":118,"props":1164,"children":1165},{"style":188},[1166],{"type":74,"value":202},{"type":68,"tag":118,"props":1168,"children":1169},{"style":292},[1170],{"type":74,"value":377},{"type":68,"tag":118,"props":1172,"children":1173},{"style":188},[1174],{"type":74,"value":226},{"type":68,"tag":118,"props":1176,"children":1177},{"class":120,"line":637},[1178,1182,1186,1190,1194,1198,1202,1206,1210,1214,1218,1222,1226,1230,1234,1238],{"type":68,"tag":118,"props":1179,"children":1180},{"style":182},[1181],{"type":74,"value":643},{"type":68,"tag":118,"props":1183,"children":1184},{"style":292},[1185],{"type":74,"value":648},{"type":68,"tag":118,"props":1187,"children":1188},{"style":194},[1189],{"type":74,"value":653},{"type":68,"tag":118,"props":1191,"children":1192},{"style":292},[1193],{"type":74,"value":658},{"type":68,"tag":118,"props":1195,"children":1196},{"style":182},[1197],{"type":74,"value":663},{"type":68,"tag":118,"props":1199,"children":1200},{"style":188},[1201],{"type":74,"value":668},{"type":68,"tag":118,"props":1203,"children":1204},{"style":292},[1205],{"type":74,"value":673},{"type":68,"tag":118,"props":1207,"children":1208},{"style":188},[1209],{"type":74,"value":678},{"type":68,"tag":118,"props":1211,"children":1212},{"style":194},[1213],{"type":74,"value":683},{"type":68,"tag":118,"props":1215,"children":1216},{"style":188},[1217],{"type":74,"value":688},{"type":68,"tag":118,"props":1219,"children":1220},{"style":194},[1221],{"type":74,"value":653},{"type":68,"tag":118,"props":1223,"children":1224},{"style":188},[1225],{"type":74,"value":98},{"type":68,"tag":118,"props":1227,"children":1228},{"style":194},[1229],{"type":74,"value":701},{"type":68,"tag":118,"props":1231,"children":1232},{"style":188},[1233],{"type":74,"value":706},{"type":68,"tag":118,"props":1235,"children":1236},{"style":292},[1237],{"type":74,"value":673},{"type":68,"tag":118,"props":1239,"children":1240},{"style":188},[1241],{"type":74,"value":715},{"type":68,"tag":118,"props":1243,"children":1244},{"class":120,"line":718},[1245,1249,1253,1257,1261,1265,1269,1273,1277,1281,1285,1289,1293],{"type":68,"tag":118,"props":1246,"children":1247},{"style":182},[1248],{"type":74,"value":643},{"type":68,"tag":118,"props":1250,"children":1251},{"style":292},[1252],{"type":74,"value":648},{"type":68,"tag":118,"props":1254,"children":1255},{"style":188},[1256],{"type":74,"value":732},{"type":68,"tag":118,"props":1258,"children":1259},{"style":194},[1260],{"type":74,"value":737},{"type":68,"tag":118,"props":1262,"children":1263},{"style":292},[1264],{"type":74,"value":658},{"type":68,"tag":118,"props":1266,"children":1267},{"style":182},[1268],{"type":74,"value":663},{"type":68,"tag":118,"props":1270,"children":1271},{"style":188},[1272],{"type":74,"value":668},{"type":68,"tag":118,"props":1274,"children":1275},{"style":292},[1276],{"type":74,"value":673},{"type":68,"tag":118,"props":1278,"children":1279},{"style":188},[1280],{"type":74,"value":678},{"type":68,"tag":118,"props":1282,"children":1283},{"style":194},[1284],{"type":74,"value":762},{"type":68,"tag":118,"props":1286,"children":1287},{"style":188},[1288],{"type":74,"value":767},{"type":68,"tag":118,"props":1290,"children":1291},{"style":292},[1292],{"type":74,"value":673},{"type":68,"tag":118,"props":1294,"children":1295},{"style":188},[1296],{"type":74,"value":715},{"type":68,"tag":118,"props":1298,"children":1299},{"class":120,"line":778},[1300,1304,1309,1313,1317,1321,1325,1330,1335,1340,1344,1349,1354,1359,1363,1368,1373],{"type":68,"tag":118,"props":1301,"children":1302},{"style":243},[1303],{"type":74,"value":561},{"type":68,"tag":118,"props":1305,"children":1306},{"style":194},[1307],{"type":74,"value":1308}," progress",{"type":68,"tag":118,"props":1310,"children":1311},{"style":188},[1312],{"type":74,"value":588},{"type":68,"tag":118,"props":1314,"children":1315},{"style":194},[1316],{"type":74,"value":570},{"type":68,"tag":118,"props":1318,"children":1319},{"style":188},[1320],{"type":74,"value":98},{"type":68,"tag":118,"props":1322,"children":1323},{"style":194},[1324],{"type":74,"value":882},{"type":68,"tag":118,"props":1326,"children":1327},{"style":188},[1328],{"type":74,"value":1329},"?.",{"type":68,"tag":118,"props":1331,"children":1332},{"style":194},[1333],{"type":74,"value":1334},"progress",{"type":68,"tag":118,"props":1336,"children":1337},{"style":182},[1338],{"type":74,"value":1339}," as",{"type":68,"tag":118,"props":1341,"children":1342},{"style":188},[1343],{"type":74,"value":191},{"type":68,"tag":118,"props":1345,"children":1346},{"style":292},[1347],{"type":74,"value":1348}," percentage",{"type":68,"tag":118,"props":1350,"children":1351},{"style":188},[1352],{"type":74,"value":1353},"?:",{"type":68,"tag":118,"props":1355,"children":1356},{"style":125},[1357],{"type":74,"value":1358}," number",{"type":68,"tag":118,"props":1360,"children":1361},{"style":188},[1362],{"type":74,"value":202},{"type":68,"tag":118,"props":1364,"children":1365},{"style":188},[1366],{"type":74,"value":1367}," |",{"type":68,"tag":118,"props":1369,"children":1370},{"style":125},[1371],{"type":74,"value":1372}," undefined",{"type":68,"tag":118,"props":1374,"children":1375},{"style":188},[1376],{"type":74,"value":226},{"type":68,"tag":118,"props":1378,"children":1379},{"class":120,"line":833},[1380,1384,1388,1392,1397,1401,1405,1409,1413,1418,1422,1426,1430,1435,1440,1446,1450,1455,1459,1463],{"type":68,"tag":118,"props":1381,"children":1382},{"style":182},[1383],{"type":74,"value":784},{"type":68,"tag":118,"props":1385,"children":1386},{"style":188},[1387],{"type":74,"value":668},{"type":68,"tag":118,"props":1389,"children":1390},{"style":292},[1391],{"type":74,"value":673},{"type":68,"tag":118,"props":1393,"children":1394},{"style":188},[1395],{"type":74,"value":1396},">{",{"type":68,"tag":118,"props":1398,"children":1399},{"style":194},[1400],{"type":74,"value":737},{"type":68,"tag":118,"props":1402,"children":1403},{"style":188},[1404],{"type":74,"value":98},{"type":68,"tag":118,"props":1406,"children":1407},{"style":194},[1408],{"type":74,"value":818},{"type":68,"tag":118,"props":1410,"children":1411},{"style":188},[1412],{"type":74,"value":354},{"type":68,"tag":118,"props":1414,"children":1415},{"style":194},[1416],{"type":74,"value":1417},": ",{"type":68,"tag":118,"props":1419,"children":1420},{"style":188},[1421],{"type":74,"value":688},{"type":68,"tag":118,"props":1423,"children":1424},{"style":194},[1425],{"type":74,"value":1334},{"type":68,"tag":118,"props":1427,"children":1428},{"style":188},[1429],{"type":74,"value":1329},{"type":68,"tag":118,"props":1431,"children":1432},{"style":194},[1433],{"type":74,"value":1434},"percentage ",{"type":68,"tag":118,"props":1436,"children":1437},{"style":188},[1438],{"type":74,"value":1439},"??",{"type":68,"tag":118,"props":1441,"children":1443},{"style":1442},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1444],{"type":74,"value":1445}," 0",{"type":68,"tag":118,"props":1447,"children":1448},{"style":188},[1449],{"type":74,"value":354},{"type":68,"tag":118,"props":1451,"children":1452},{"style":194},[1453],{"type":74,"value":1454},"%",{"type":68,"tag":118,"props":1456,"children":1457},{"style":188},[1458],{"type":74,"value":767},{"type":68,"tag":118,"props":1460,"children":1461},{"style":292},[1462],{"type":74,"value":673},{"type":68,"tag":118,"props":1464,"children":1465},{"style":188},[1466],{"type":74,"value":715},{"type":68,"tag":118,"props":1468,"children":1470},{"class":120,"line":1469},11,[1471],{"type":68,"tag":118,"props":1472,"children":1473},{"style":188},[1474],{"type":74,"value":839},{"type":68,"tag":77,"props":1476,"children":1477},{},[1478,1480,1486],{"type":74,"value":1479},"Pass ",{"type":68,"tag":83,"props":1481,"children":1483},{"className":1482},[],[1484],{"type":74,"value":1485},"onComplete: (run, error) => {}",{"type":74,"value":1487}," to react when the run finishes.",{"type":68,"tag":868,"props":1489,"children":1491},{"id":1490},"_2-status-only-subscription-with-skipcolumns",[1492,1494],{"type":74,"value":1493},"2. Status-only subscription with ",{"type":68,"tag":83,"props":1495,"children":1497},{"className":1496},[],[1498],{"type":74,"value":1499},"skipColumns",{"type":68,"tag":77,"props":1501,"children":1502},{},[1503,1505,1511,1513,1519],{"type":74,"value":1504},"For a badge or progress bar you do not need ",{"type":68,"tag":83,"props":1506,"children":1508},{"className":1507},[],[1509],{"type":74,"value":1510},"payload",{"type":74,"value":1512},"\u002F",{"type":68,"tag":83,"props":1514,"children":1516},{"className":1515},[],[1517],{"type":74,"value":1518},"output",{"type":74,"value":1520},". Skipping them\nreduces wire size and avoids \"Large HTTP Payload\" warnings.",{"type":68,"tag":107,"props":1522,"children":1524},{"className":384,"code":1523,"language":386,"meta":112,"style":112},"const { run } = useRealtimeRun(runId, {\n  accessToken: publicAccessToken,\n  skipColumns: [\"payload\", \"output\"],\n});\n",[1525],{"type":68,"tag":83,"props":1526,"children":1527},{"__ignoreMap":112},[1528,1569,1590,1643],{"type":68,"tag":118,"props":1529,"children":1530},{"class":120,"line":121},[1531,1535,1539,1544,1548,1552,1556,1561,1565],{"type":68,"tag":118,"props":1532,"children":1533},{"style":243},[1534],{"type":74,"value":246},{"type":68,"tag":118,"props":1536,"children":1537},{"style":188},[1538],{"type":74,"value":191},{"type":68,"tag":118,"props":1540,"children":1541},{"style":194},[1542],{"type":74,"value":1543}," run ",{"type":68,"tag":118,"props":1545,"children":1546},{"style":188},[1547],{"type":74,"value":354},{"type":68,"tag":118,"props":1549,"children":1550},{"style":188},[1551],{"type":74,"value":588},{"type":68,"tag":118,"props":1553,"children":1554},{"style":272},[1555],{"type":74,"value":434},{"type":68,"tag":118,"props":1557,"children":1558},{"style":194},[1559],{"type":74,"value":1560},"(runId",{"type":68,"tag":118,"props":1562,"children":1563},{"style":188},[1564],{"type":74,"value":499},{"type":68,"tag":118,"props":1566,"children":1567},{"style":188},[1568],{"type":74,"value":553},{"type":68,"tag":118,"props":1570,"children":1571},{"class":120,"line":148},[1572,1577,1581,1585],{"type":68,"tag":118,"props":1573,"children":1574},{"style":292},[1575],{"type":74,"value":1576},"  accessToken",{"type":68,"tag":118,"props":1578,"children":1579},{"style":188},[1580],{"type":74,"value":300},{"type":68,"tag":118,"props":1582,"children":1583},{"style":194},[1584],{"type":74,"value":504},{"type":68,"tag":118,"props":1586,"children":1587},{"style":188},[1588],{"type":74,"value":1589},",\n",{"type":68,"tag":118,"props":1591,"children":1592},{"class":120,"line":229},[1593,1598,1602,1606,1610,1614,1618,1622,1626,1630,1634,1639],{"type":68,"tag":118,"props":1594,"children":1595},{"style":292},[1596],{"type":74,"value":1597},"  skipColumns",{"type":68,"tag":118,"props":1599,"children":1600},{"style":188},[1601],{"type":74,"value":300},{"type":68,"tag":118,"props":1603,"children":1604},{"style":194},[1605],{"type":74,"value":331},{"type":68,"tag":118,"props":1607,"children":1608},{"style":188},[1609],{"type":74,"value":221},{"type":68,"tag":118,"props":1611,"children":1612},{"style":131},[1613],{"type":74,"value":1510},{"type":68,"tag":118,"props":1615,"children":1616},{"style":188},[1617],{"type":74,"value":221},{"type":68,"tag":118,"props":1619,"children":1620},{"style":188},[1621],{"type":74,"value":499},{"type":68,"tag":118,"props":1623,"children":1624},{"style":188},[1625],{"type":74,"value":212},{"type":68,"tag":118,"props":1627,"children":1628},{"style":131},[1629],{"type":74,"value":1518},{"type":68,"tag":118,"props":1631,"children":1632},{"style":188},[1633],{"type":74,"value":221},{"type":68,"tag":118,"props":1635,"children":1636},{"style":194},[1637],{"type":74,"value":1638},"]",{"type":68,"tag":118,"props":1640,"children":1641},{"style":188},[1642],{"type":74,"value":1589},{"type":68,"tag":118,"props":1644,"children":1645},{"class":120,"line":239},[1646,1650,1654],{"type":68,"tag":118,"props":1647,"children":1648},{"style":188},[1649],{"type":74,"value":354},{"type":68,"tag":118,"props":1651,"children":1652},{"style":194},[1653],{"type":74,"value":377},{"type":68,"tag":118,"props":1655,"children":1656},{"style":188},[1657],{"type":74,"value":226},{"type":68,"tag":77,"props":1659,"children":1660},{},[1661,1663,1668,1670,1675,1676,1681,1682,1688,1689,1695,1696,1702,1703,1709,1710,1716,1717,1723,1724,1730,1731,1737,1738,1744,1745,1751,1752,1758,1759,1765,1766,1772,1773,1779,1780,1785],{"type":74,"value":1662},"You can skip any of: ",{"type":68,"tag":83,"props":1664,"children":1666},{"className":1665},[],[1667],{"type":74,"value":1510},{"type":74,"value":1669},", ",{"type":68,"tag":83,"props":1671,"children":1673},{"className":1672},[],[1674],{"type":74,"value":1518},{"type":74,"value":1669},{"type":68,"tag":83,"props":1677,"children":1679},{"className":1678},[],[1680],{"type":74,"value":882},{"type":74,"value":1669},{"type":68,"tag":83,"props":1683,"children":1685},{"className":1684},[],[1686],{"type":74,"value":1687},"startedAt",{"type":74,"value":1669},{"type":68,"tag":83,"props":1690,"children":1692},{"className":1691},[],[1693],{"type":74,"value":1694},"delayUntil",{"type":74,"value":1589},{"type":68,"tag":83,"props":1697,"children":1699},{"className":1698},[],[1700],{"type":74,"value":1701},"queuedAt",{"type":74,"value":1669},{"type":68,"tag":83,"props":1704,"children":1706},{"className":1705},[],[1707],{"type":74,"value":1708},"expiredAt",{"type":74,"value":1669},{"type":68,"tag":83,"props":1711,"children":1713},{"className":1712},[],[1714],{"type":74,"value":1715},"completedAt",{"type":74,"value":1669},{"type":68,"tag":83,"props":1718,"children":1720},{"className":1719},[],[1721],{"type":74,"value":1722},"number",{"type":74,"value":1669},{"type":68,"tag":83,"props":1725,"children":1727},{"className":1726},[],[1728],{"type":74,"value":1729},"isTest",{"type":74,"value":1669},{"type":68,"tag":83,"props":1732,"children":1734},{"className":1733},[],[1735],{"type":74,"value":1736},"usageDurationMs",{"type":74,"value":1589},{"type":68,"tag":83,"props":1739,"children":1741},{"className":1740},[],[1742],{"type":74,"value":1743},"costInCents",{"type":74,"value":1669},{"type":68,"tag":83,"props":1746,"children":1748},{"className":1747},[],[1749],{"type":74,"value":1750},"baseCostInCents",{"type":74,"value":1669},{"type":68,"tag":83,"props":1753,"children":1755},{"className":1754},[],[1756],{"type":74,"value":1757},"ttl",{"type":74,"value":1669},{"type":68,"tag":83,"props":1760,"children":1762},{"className":1761},[],[1763],{"type":74,"value":1764},"payloadType",{"type":74,"value":1669},{"type":68,"tag":83,"props":1767,"children":1769},{"className":1768},[],[1770],{"type":74,"value":1771},"outputType",{"type":74,"value":1669},{"type":68,"tag":83,"props":1774,"children":1776},{"className":1775},[],[1777],{"type":74,"value":1778},"runTags",{"type":74,"value":1589},{"type":68,"tag":83,"props":1781,"children":1783},{"className":1782},[],[1784],{"type":74,"value":653},{"type":74,"value":98},{"type":68,"tag":868,"props":1787,"children":1789},{"id":1788},"_3-trigger-from-the-browser-with-a-trigger-token",[1790],{"type":74,"value":1791},"3. Trigger from the browser with a Trigger Token",{"type":68,"tag":77,"props":1793,"children":1794},{},[1795,1801,1803,1808],{"type":68,"tag":83,"props":1796,"children":1798},{"className":1797},[],[1799],{"type":74,"value":1800},"accessToken",{"type":74,"value":1802}," here is a Trigger Token (",{"type":68,"tag":83,"props":1804,"children":1806},{"className":1805},[],[1807],{"type":74,"value":858},{"type":74,"value":1809},"), not a\nPublic Access Token.",{"type":68,"tag":107,"props":1811,"children":1813},{"className":384,"code":1812,"language":386,"meta":112,"style":112},"\"use client\";\nimport { useTaskTrigger } from \"@trigger.dev\u002Freact-hooks\";\nimport type { myTask } from \"@\u002Ftrigger\u002FmyTask\";\n\nexport function TriggerButton({ triggerToken }: { triggerToken: string }) {\n  const { submit, handle, isLoading } = useTaskTrigger\u003Ctypeof myTask>(\"my-task\", {\n    accessToken: triggerToken,\n  });\n  if (handle) return \u003Cdiv>Run ID: {handle.id}\u003C\u002Fdiv>;\n  return (\n    \u003Cbutton onClick={() => submit({ foo: \"bar\" }, { tags: [\"user:123\"] })} disabled={isLoading}>\n      {isLoading ? \"Triggering...\" : \"Run\"}\n    \u003C\u002Fbutton>\n  );\n}\n",[1814],{"type":68,"tag":83,"props":1815,"children":1816},{"__ignoreMap":112},[1817,1836,1876,1919,1926,1979,2062,2082,2098,2168,2180,2313,2367,2385,2398],{"type":68,"tag":118,"props":1818,"children":1819},{"class":120,"line":121},[1820,1824,1828,1832],{"type":68,"tag":118,"props":1821,"children":1822},{"style":188},[1823],{"type":74,"value":221},{"type":68,"tag":118,"props":1825,"children":1826},{"style":131},[1827],{"type":74,"value":410},{"type":68,"tag":118,"props":1829,"children":1830},{"style":188},[1831],{"type":74,"value":221},{"type":68,"tag":118,"props":1833,"children":1834},{"style":188},[1835],{"type":74,"value":226},{"type":68,"tag":118,"props":1837,"children":1838},{"class":120,"line":148},[1839,1843,1847,1852,1856,1860,1864,1868,1872],{"type":68,"tag":118,"props":1840,"children":1841},{"style":182},[1842],{"type":74,"value":185},{"type":68,"tag":118,"props":1844,"children":1845},{"style":188},[1846],{"type":74,"value":191},{"type":68,"tag":118,"props":1848,"children":1849},{"style":194},[1850],{"type":74,"value":1851}," useTaskTrigger",{"type":68,"tag":118,"props":1853,"children":1854},{"style":188},[1855],{"type":74,"value":202},{"type":68,"tag":118,"props":1857,"children":1858},{"style":182},[1859],{"type":74,"value":207},{"type":68,"tag":118,"props":1861,"children":1862},{"style":188},[1863],{"type":74,"value":212},{"type":68,"tag":118,"props":1865,"children":1866},{"style":131},[1867],{"type":74,"value":88},{"type":68,"tag":118,"props":1869,"children":1870},{"style":188},[1871],{"type":74,"value":221},{"type":68,"tag":118,"props":1873,"children":1874},{"style":188},[1875],{"type":74,"value":226},{"type":68,"tag":118,"props":1877,"children":1878},{"class":120,"line":229},[1879,1883,1887,1891,1895,1899,1903,1907,1911,1915],{"type":68,"tag":118,"props":1880,"children":1881},{"style":182},[1882],{"type":74,"value":185},{"type":68,"tag":118,"props":1884,"children":1885},{"style":182},[1886],{"type":74,"value":969},{"type":68,"tag":118,"props":1888,"children":1889},{"style":188},[1890],{"type":74,"value":191},{"type":68,"tag":118,"props":1892,"children":1893},{"style":194},[1894],{"type":74,"value":978},{"type":68,"tag":118,"props":1896,"children":1897},{"style":188},[1898],{"type":74,"value":202},{"type":68,"tag":118,"props":1900,"children":1901},{"style":182},[1902],{"type":74,"value":207},{"type":68,"tag":118,"props":1904,"children":1905},{"style":188},[1906],{"type":74,"value":212},{"type":68,"tag":118,"props":1908,"children":1909},{"style":131},[1910],{"type":74,"value":995},{"type":68,"tag":118,"props":1912,"children":1913},{"style":188},[1914],{"type":74,"value":221},{"type":68,"tag":118,"props":1916,"children":1917},{"style":188},[1918],{"type":74,"value":226},{"type":68,"tag":118,"props":1920,"children":1921},{"class":120,"line":239},[1922],{"type":68,"tag":118,"props":1923,"children":1924},{"emptyLinePlaceholder":233},[1925],{"type":74,"value":236},{"type":68,"tag":118,"props":1927,"children":1928},{"class":120,"line":288},[1929,1933,1937,1942,1946,1951,1955,1959,1963,1967,1971,1975],{"type":68,"tag":118,"props":1930,"children":1931},{"style":182},[1932],{"type":74,"value":473},{"type":68,"tag":118,"props":1934,"children":1935},{"style":243},[1936],{"type":74,"value":478},{"type":68,"tag":118,"props":1938,"children":1939},{"style":272},[1940],{"type":74,"value":1941}," TriggerButton",{"type":68,"tag":118,"props":1943,"children":1944},{"style":188},[1945],{"type":74,"value":488},{"type":68,"tag":118,"props":1947,"children":1948},{"style":491},[1949],{"type":74,"value":1950}," triggerToken",{"type":68,"tag":118,"props":1952,"children":1953},{"style":188},[1954],{"type":74,"value":509},{"type":68,"tag":118,"props":1956,"children":1957},{"style":188},[1958],{"type":74,"value":191},{"type":68,"tag":118,"props":1960,"children":1961},{"style":292},[1962],{"type":74,"value":1950},{"type":68,"tag":118,"props":1964,"children":1965},{"style":188},[1966],{"type":74,"value":300},{"type":68,"tag":118,"props":1968,"children":1969},{"style":125},[1970],{"type":74,"value":526},{"type":68,"tag":118,"props":1972,"children":1973},{"style":188},[1974],{"type":74,"value":548},{"type":68,"tag":118,"props":1976,"children":1977},{"style":188},[1978],{"type":74,"value":553},{"type":68,"tag":118,"props":1980,"children":1981},{"class":120,"line":367},[1982,1986,1990,1995,1999,2004,2008,2013,2017,2021,2025,2029,2033,2037,2041,2045,2050,2054,2058],{"type":68,"tag":118,"props":1983,"children":1984},{"style":243},[1985],{"type":74,"value":561},{"type":68,"tag":118,"props":1987,"children":1988},{"style":188},[1989],{"type":74,"value":191},{"type":68,"tag":118,"props":1991,"children":1992},{"style":194},[1993],{"type":74,"value":1994}," submit",{"type":68,"tag":118,"props":1996,"children":1997},{"style":188},[1998],{"type":74,"value":499},{"type":68,"tag":118,"props":2000,"children":2001},{"style":194},[2002],{"type":74,"value":2003}," handle",{"type":68,"tag":118,"props":2005,"children":2006},{"style":188},[2007],{"type":74,"value":499},{"type":68,"tag":118,"props":2009,"children":2010},{"style":194},[2011],{"type":74,"value":2012}," isLoading",{"type":68,"tag":118,"props":2014,"children":2015},{"style":188},[2016],{"type":74,"value":202},{"type":68,"tag":118,"props":2018,"children":2019},{"style":188},[2020],{"type":74,"value":588},{"type":68,"tag":118,"props":2022,"children":2023},{"style":272},[2024],{"type":74,"value":1851},{"type":68,"tag":118,"props":2026,"children":2027},{"style":188},[2028],{"type":74,"value":1126},{"type":68,"tag":118,"props":2030,"children":2031},{"style":194},[2032],{"type":74,"value":978},{"type":68,"tag":118,"props":2034,"children":2035},{"style":188},[2036],{"type":74,"value":678},{"type":68,"tag":118,"props":2038,"children":2039},{"style":292},[2040],{"type":74,"value":280},{"type":68,"tag":118,"props":2042,"children":2043},{"style":188},[2044],{"type":74,"value":221},{"type":68,"tag":118,"props":2046,"children":2047},{"style":131},[2048],{"type":74,"value":2049},"my-task",{"type":68,"tag":118,"props":2051,"children":2052},{"style":188},[2053],{"type":74,"value":221},{"type":68,"tag":118,"props":2055,"children":2056},{"style":188},[2057],{"type":74,"value":499},{"type":68,"tag":118,"props":2059,"children":2060},{"style":188},[2061],{"type":74,"value":553},{"type":68,"tag":118,"props":2063,"children":2064},{"class":120,"line":637},[2065,2070,2074,2078],{"type":68,"tag":118,"props":2066,"children":2067},{"style":292},[2068],{"type":74,"value":2069},"    accessToken",{"type":68,"tag":118,"props":2071,"children":2072},{"style":188},[2073],{"type":74,"value":300},{"type":68,"tag":118,"props":2075,"children":2076},{"style":194},[2077],{"type":74,"value":1950},{"type":68,"tag":118,"props":2079,"children":2080},{"style":188},[2081],{"type":74,"value":1589},{"type":68,"tag":118,"props":2083,"children":2084},{"class":120,"line":718},[2085,2090,2094],{"type":68,"tag":118,"props":2086,"children":2087},{"style":188},[2088],{"type":74,"value":2089},"  }",{"type":68,"tag":118,"props":2091,"children":2092},{"style":292},[2093],{"type":74,"value":377},{"type":68,"tag":118,"props":2095,"children":2096},{"style":188},[2097],{"type":74,"value":226},{"type":68,"tag":118,"props":2099,"children":2100},{"class":120,"line":778},[2101,2105,2109,2114,2118,2122,2126,2130,2134,2139,2143,2147,2151,2156,2160,2164],{"type":68,"tag":118,"props":2102,"children":2103},{"style":182},[2104],{"type":74,"value":643},{"type":68,"tag":118,"props":2106,"children":2107},{"style":292},[2108],{"type":74,"value":648},{"type":68,"tag":118,"props":2110,"children":2111},{"style":194},[2112],{"type":74,"value":2113},"handle",{"type":68,"tag":118,"props":2115,"children":2116},{"style":292},[2117],{"type":74,"value":658},{"type":68,"tag":118,"props":2119,"children":2120},{"style":182},[2121],{"type":74,"value":663},{"type":68,"tag":118,"props":2123,"children":2124},{"style":188},[2125],{"type":74,"value":668},{"type":68,"tag":118,"props":2127,"children":2128},{"style":292},[2129],{"type":74,"value":673},{"type":68,"tag":118,"props":2131,"children":2132},{"style":188},[2133],{"type":74,"value":678},{"type":68,"tag":118,"props":2135,"children":2136},{"style":194},[2137],{"type":74,"value":2138},"Run ID: ",{"type":68,"tag":118,"props":2140,"children":2141},{"style":188},[2142],{"type":74,"value":688},{"type":68,"tag":118,"props":2144,"children":2145},{"style":194},[2146],{"type":74,"value":2113},{"type":68,"tag":118,"props":2148,"children":2149},{"style":188},[2150],{"type":74,"value":98},{"type":68,"tag":118,"props":2152,"children":2153},{"style":194},[2154],{"type":74,"value":2155},"id",{"type":68,"tag":118,"props":2157,"children":2158},{"style":188},[2159],{"type":74,"value":706},{"type":68,"tag":118,"props":2161,"children":2162},{"style":292},[2163],{"type":74,"value":673},{"type":68,"tag":118,"props":2165,"children":2166},{"style":188},[2167],{"type":74,"value":715},{"type":68,"tag":118,"props":2169,"children":2170},{"class":120,"line":833},[2171,2175],{"type":68,"tag":118,"props":2172,"children":2173},{"style":182},[2174],{"type":74,"value":784},{"type":68,"tag":118,"props":2176,"children":2177},{"style":292},[2178],{"type":74,"value":2179}," (\n",{"type":68,"tag":118,"props":2181,"children":2182},{"class":120,"line":1469},[2183,2188,2193,2198,2203,2208,2212,2216,2220,2225,2229,2233,2238,2242,2246,2250,2255,2259,2263,2267,2272,2276,2280,2284,2288,2293,2298,2303,2308],{"type":68,"tag":118,"props":2184,"children":2185},{"style":188},[2186],{"type":74,"value":2187},"    \u003C",{"type":68,"tag":118,"props":2189,"children":2190},{"style":292},[2191],{"type":74,"value":2192},"button",{"type":68,"tag":118,"props":2194,"children":2195},{"style":243},[2196],{"type":74,"value":2197}," onClick",{"type":68,"tag":118,"props":2199,"children":2200},{"style":188},[2201],{"type":74,"value":2202},"={()",{"type":68,"tag":118,"props":2204,"children":2205},{"style":243},[2206],{"type":74,"value":2207}," =>",{"type":68,"tag":118,"props":2209,"children":2210},{"style":272},[2211],{"type":74,"value":1994},{"type":68,"tag":118,"props":2213,"children":2214},{"style":194},[2215],{"type":74,"value":280},{"type":68,"tag":118,"props":2217,"children":2218},{"style":188},[2219],{"type":74,"value":688},{"type":68,"tag":118,"props":2221,"children":2222},{"style":292},[2223],{"type":74,"value":2224}," foo",{"type":68,"tag":118,"props":2226,"children":2227},{"style":188},[2228],{"type":74,"value":300},{"type":68,"tag":118,"props":2230,"children":2231},{"style":188},[2232],{"type":74,"value":212},{"type":68,"tag":118,"props":2234,"children":2235},{"style":131},[2236],{"type":74,"value":2237},"bar",{"type":68,"tag":118,"props":2239,"children":2240},{"style":188},[2241],{"type":74,"value":221},{"type":68,"tag":118,"props":2243,"children":2244},{"style":188},[2245],{"type":74,"value":359},{"type":68,"tag":118,"props":2247,"children":2248},{"style":188},[2249],{"type":74,"value":191},{"type":68,"tag":118,"props":2251,"children":2252},{"style":292},[2253],{"type":74,"value":2254}," tags",{"type":68,"tag":118,"props":2256,"children":2257},{"style":188},[2258],{"type":74,"value":300},{"type":68,"tag":118,"props":2260,"children":2261},{"style":194},[2262],{"type":74,"value":331},{"type":68,"tag":118,"props":2264,"children":2265},{"style":188},[2266],{"type":74,"value":221},{"type":68,"tag":118,"props":2268,"children":2269},{"style":131},[2270],{"type":74,"value":2271},"user:123",{"type":68,"tag":118,"props":2273,"children":2274},{"style":188},[2275],{"type":74,"value":221},{"type":68,"tag":118,"props":2277,"children":2278},{"style":194},[2279],{"type":74,"value":349},{"type":68,"tag":118,"props":2281,"children":2282},{"style":188},[2283],{"type":74,"value":354},{"type":68,"tag":118,"props":2285,"children":2286},{"style":194},[2287],{"type":74,"value":377},{"type":68,"tag":118,"props":2289,"children":2290},{"style":188},[2291],{"type":74,"value":2292},"} ",{"type":68,"tag":118,"props":2294,"children":2295},{"style":243},[2296],{"type":74,"value":2297},"disabled",{"type":68,"tag":118,"props":2299,"children":2300},{"style":188},[2301],{"type":74,"value":2302},"={",{"type":68,"tag":118,"props":2304,"children":2305},{"style":194},[2306],{"type":74,"value":2307},"isLoading",{"type":68,"tag":118,"props":2309,"children":2310},{"style":188},[2311],{"type":74,"value":2312},"}>\n",{"type":68,"tag":118,"props":2314,"children":2316},{"class":120,"line":2315},12,[2317,2322,2327,2332,2336,2341,2345,2350,2354,2359,2363],{"type":68,"tag":118,"props":2318,"children":2319},{"style":188},[2320],{"type":74,"value":2321},"      {",{"type":68,"tag":118,"props":2323,"children":2324},{"style":194},[2325],{"type":74,"value":2326},"isLoading ",{"type":68,"tag":118,"props":2328,"children":2329},{"style":188},[2330],{"type":74,"value":2331},"?",{"type":68,"tag":118,"props":2333,"children":2334},{"style":188},[2335],{"type":74,"value":212},{"type":68,"tag":118,"props":2337,"children":2338},{"style":131},[2339],{"type":74,"value":2340},"Triggering...",{"type":68,"tag":118,"props":2342,"children":2343},{"style":188},[2344],{"type":74,"value":221},{"type":68,"tag":118,"props":2346,"children":2347},{"style":188},[2348],{"type":74,"value":2349}," :",{"type":68,"tag":118,"props":2351,"children":2352},{"style":188},[2353],{"type":74,"value":212},{"type":68,"tag":118,"props":2355,"children":2356},{"style":131},[2357],{"type":74,"value":2358},"Run",{"type":68,"tag":118,"props":2360,"children":2361},{"style":188},[2362],{"type":74,"value":221},{"type":68,"tag":118,"props":2364,"children":2365},{"style":188},[2366],{"type":74,"value":839},{"type":68,"tag":118,"props":2368,"children":2370},{"class":120,"line":2369},13,[2371,2376,2380],{"type":68,"tag":118,"props":2372,"children":2373},{"style":188},[2374],{"type":74,"value":2375},"    \u003C\u002F",{"type":68,"tag":118,"props":2377,"children":2378},{"style":292},[2379],{"type":74,"value":2192},{"type":68,"tag":118,"props":2381,"children":2382},{"style":188},[2383],{"type":74,"value":2384},">\n",{"type":68,"tag":118,"props":2386,"children":2388},{"class":120,"line":2387},14,[2389,2394],{"type":68,"tag":118,"props":2390,"children":2391},{"style":292},[2392],{"type":74,"value":2393},"  )",{"type":68,"tag":118,"props":2395,"children":2396},{"style":188},[2397],{"type":74,"value":226},{"type":68,"tag":118,"props":2399,"children":2401},{"class":120,"line":2400},15,[2402],{"type":68,"tag":118,"props":2403,"children":2404},{"style":188},[2405],{"type":74,"value":839},{"type":68,"tag":77,"props":2407,"children":2408},{},[2409,2415,2417,2423],{"type":68,"tag":83,"props":2410,"children":2412},{"className":2411},[],[2413],{"type":74,"value":2414},"submit(payload, options?)",{"type":74,"value":2416}," takes the same options as a backend ",{"type":68,"tag":83,"props":2418,"children":2420},{"className":2419},[],[2421],{"type":74,"value":2422},"trigger",{"type":74,"value":2424}," call.",{"type":68,"tag":868,"props":2426,"children":2428},{"id":2427},"_4-trigger-and-subscribe-in-one-hook",[2429],{"type":74,"value":2430},"4. Trigger and subscribe in one hook",{"type":68,"tag":107,"props":2432,"children":2434},{"className":384,"code":2433,"language":386,"meta":112,"style":112},"\"use client\";\nimport { useRealtimeTaskTrigger } from \"@trigger.dev\u002Freact-hooks\";\nimport type { myTask } from \"@\u002Ftrigger\u002FmyTask\";\n\nexport function Runner({ publicAccessToken }: { publicAccessToken: string }) {\n  const { submit, run, isLoading } = useRealtimeTaskTrigger\u003Ctypeof myTask>(\"my-task\", {\n    accessToken: publicAccessToken,\n  });\n  if (run) return \u003Cdiv>{run.status}\u003C\u002Fdiv>;\n  return \u003Cbutton onClick={() => submit({ foo: \"bar\" })} disabled={isLoading}>Run\u003C\u002Fbutton>;\n}\n",[2435],{"type":68,"tag":83,"props":2436,"children":2437},{"__ignoreMap":112},[2438,2457,2497,2540,2547,2599,2678,2697,2712,2771,2875],{"type":68,"tag":118,"props":2439,"children":2440},{"class":120,"line":121},[2441,2445,2449,2453],{"type":68,"tag":118,"props":2442,"children":2443},{"style":188},[2444],{"type":74,"value":221},{"type":68,"tag":118,"props":2446,"children":2447},{"style":131},[2448],{"type":74,"value":410},{"type":68,"tag":118,"props":2450,"children":2451},{"style":188},[2452],{"type":74,"value":221},{"type":68,"tag":118,"props":2454,"children":2455},{"style":188},[2456],{"type":74,"value":226},{"type":68,"tag":118,"props":2458,"children":2459},{"class":120,"line":148},[2460,2464,2468,2473,2477,2481,2485,2489,2493],{"type":68,"tag":118,"props":2461,"children":2462},{"style":182},[2463],{"type":74,"value":185},{"type":68,"tag":118,"props":2465,"children":2466},{"style":188},[2467],{"type":74,"value":191},{"type":68,"tag":118,"props":2469,"children":2470},{"style":194},[2471],{"type":74,"value":2472}," useRealtimeTaskTrigger",{"type":68,"tag":118,"props":2474,"children":2475},{"style":188},[2476],{"type":74,"value":202},{"type":68,"tag":118,"props":2478,"children":2479},{"style":182},[2480],{"type":74,"value":207},{"type":68,"tag":118,"props":2482,"children":2483},{"style":188},[2484],{"type":74,"value":212},{"type":68,"tag":118,"props":2486,"children":2487},{"style":131},[2488],{"type":74,"value":88},{"type":68,"tag":118,"props":2490,"children":2491},{"style":188},[2492],{"type":74,"value":221},{"type":68,"tag":118,"props":2494,"children":2495},{"style":188},[2496],{"type":74,"value":226},{"type":68,"tag":118,"props":2498,"children":2499},{"class":120,"line":229},[2500,2504,2508,2512,2516,2520,2524,2528,2532,2536],{"type":68,"tag":118,"props":2501,"children":2502},{"style":182},[2503],{"type":74,"value":185},{"type":68,"tag":118,"props":2505,"children":2506},{"style":182},[2507],{"type":74,"value":969},{"type":68,"tag":118,"props":2509,"children":2510},{"style":188},[2511],{"type":74,"value":191},{"type":68,"tag":118,"props":2513,"children":2514},{"style":194},[2515],{"type":74,"value":978},{"type":68,"tag":118,"props":2517,"children":2518},{"style":188},[2519],{"type":74,"value":202},{"type":68,"tag":118,"props":2521,"children":2522},{"style":182},[2523],{"type":74,"value":207},{"type":68,"tag":118,"props":2525,"children":2526},{"style":188},[2527],{"type":74,"value":212},{"type":68,"tag":118,"props":2529,"children":2530},{"style":131},[2531],{"type":74,"value":995},{"type":68,"tag":118,"props":2533,"children":2534},{"style":188},[2535],{"type":74,"value":221},{"type":68,"tag":118,"props":2537,"children":2538},{"style":188},[2539],{"type":74,"value":226},{"type":68,"tag":118,"props":2541,"children":2542},{"class":120,"line":239},[2543],{"type":68,"tag":118,"props":2544,"children":2545},{"emptyLinePlaceholder":233},[2546],{"type":74,"value":236},{"type":68,"tag":118,"props":2548,"children":2549},{"class":120,"line":288},[2550,2554,2558,2563,2567,2571,2575,2579,2583,2587,2591,2595],{"type":68,"tag":118,"props":2551,"children":2552},{"style":182},[2553],{"type":74,"value":473},{"type":68,"tag":118,"props":2555,"children":2556},{"style":243},[2557],{"type":74,"value":478},{"type":68,"tag":118,"props":2559,"children":2560},{"style":272},[2561],{"type":74,"value":2562}," Runner",{"type":68,"tag":118,"props":2564,"children":2565},{"style":188},[2566],{"type":74,"value":488},{"type":68,"tag":118,"props":2568,"children":2569},{"style":491},[2570],{"type":74,"value":504},{"type":68,"tag":118,"props":2572,"children":2573},{"style":188},[2574],{"type":74,"value":509},{"type":68,"tag":118,"props":2576,"children":2577},{"style":188},[2578],{"type":74,"value":191},{"type":68,"tag":118,"props":2580,"children":2581},{"style":292},[2582],{"type":74,"value":504},{"type":68,"tag":118,"props":2584,"children":2585},{"style":188},[2586],{"type":74,"value":300},{"type":68,"tag":118,"props":2588,"children":2589},{"style":125},[2590],{"type":74,"value":526},{"type":68,"tag":118,"props":2592,"children":2593},{"style":188},[2594],{"type":74,"value":548},{"type":68,"tag":118,"props":2596,"children":2597},{"style":188},[2598],{"type":74,"value":553},{"type":68,"tag":118,"props":2600,"children":2601},{"class":120,"line":367},[2602,2606,2610,2614,2618,2622,2626,2630,2634,2638,2642,2646,2650,2654,2658,2662,2666,2670,2674],{"type":68,"tag":118,"props":2603,"children":2604},{"style":243},[2605],{"type":74,"value":561},{"type":68,"tag":118,"props":2607,"children":2608},{"style":188},[2609],{"type":74,"value":191},{"type":68,"tag":118,"props":2611,"children":2612},{"style":194},[2613],{"type":74,"value":1994},{"type":68,"tag":118,"props":2615,"children":2616},{"style":188},[2617],{"type":74,"value":499},{"type":68,"tag":118,"props":2619,"children":2620},{"style":194},[2621],{"type":74,"value":570},{"type":68,"tag":118,"props":2623,"children":2624},{"style":188},[2625],{"type":74,"value":499},{"type":68,"tag":118,"props":2627,"children":2628},{"style":194},[2629],{"type":74,"value":2012},{"type":68,"tag":118,"props":2631,"children":2632},{"style":188},[2633],{"type":74,"value":202},{"type":68,"tag":118,"props":2635,"children":2636},{"style":188},[2637],{"type":74,"value":588},{"type":68,"tag":118,"props":2639,"children":2640},{"style":272},[2641],{"type":74,"value":2472},{"type":68,"tag":118,"props":2643,"children":2644},{"style":188},[2645],{"type":74,"value":1126},{"type":68,"tag":118,"props":2647,"children":2648},{"style":194},[2649],{"type":74,"value":978},{"type":68,"tag":118,"props":2651,"children":2652},{"style":188},[2653],{"type":74,"value":678},{"type":68,"tag":118,"props":2655,"children":2656},{"style":292},[2657],{"type":74,"value":280},{"type":68,"tag":118,"props":2659,"children":2660},{"style":188},[2661],{"type":74,"value":221},{"type":68,"tag":118,"props":2663,"children":2664},{"style":131},[2665],{"type":74,"value":2049},{"type":68,"tag":118,"props":2667,"children":2668},{"style":188},[2669],{"type":74,"value":221},{"type":68,"tag":118,"props":2671,"children":2672},{"style":188},[2673],{"type":74,"value":499},{"type":68,"tag":118,"props":2675,"children":2676},{"style":188},[2677],{"type":74,"value":553},{"type":68,"tag":118,"props":2679,"children":2680},{"class":120,"line":637},[2681,2685,2689,2693],{"type":68,"tag":118,"props":2682,"children":2683},{"style":292},[2684],{"type":74,"value":2069},{"type":68,"tag":118,"props":2686,"children":2687},{"style":188},[2688],{"type":74,"value":300},{"type":68,"tag":118,"props":2690,"children":2691},{"style":194},[2692],{"type":74,"value":504},{"type":68,"tag":118,"props":2694,"children":2695},{"style":188},[2696],{"type":74,"value":1589},{"type":68,"tag":118,"props":2698,"children":2699},{"class":120,"line":718},[2700,2704,2708],{"type":68,"tag":118,"props":2701,"children":2702},{"style":188},[2703],{"type":74,"value":2089},{"type":68,"tag":118,"props":2705,"children":2706},{"style":292},[2707],{"type":74,"value":377},{"type":68,"tag":118,"props":2709,"children":2710},{"style":188},[2711],{"type":74,"value":226},{"type":68,"tag":118,"props":2713,"children":2714},{"class":120,"line":778},[2715,2719,2723,2727,2731,2735,2739,2743,2747,2751,2755,2759,2763,2767],{"type":68,"tag":118,"props":2716,"children":2717},{"style":182},[2718],{"type":74,"value":643},{"type":68,"tag":118,"props":2720,"children":2721},{"style":292},[2722],{"type":74,"value":648},{"type":68,"tag":118,"props":2724,"children":2725},{"style":194},[2726],{"type":74,"value":737},{"type":68,"tag":118,"props":2728,"children":2729},{"style":292},[2730],{"type":74,"value":658},{"type":68,"tag":118,"props":2732,"children":2733},{"style":182},[2734],{"type":74,"value":663},{"type":68,"tag":118,"props":2736,"children":2737},{"style":188},[2738],{"type":74,"value":668},{"type":68,"tag":118,"props":2740,"children":2741},{"style":292},[2742],{"type":74,"value":673},{"type":68,"tag":118,"props":2744,"children":2745},{"style":188},[2746],{"type":74,"value":1396},{"type":68,"tag":118,"props":2748,"children":2749},{"style":194},[2750],{"type":74,"value":737},{"type":68,"tag":118,"props":2752,"children":2753},{"style":188},[2754],{"type":74,"value":98},{"type":68,"tag":118,"props":2756,"children":2757},{"style":194},[2758],{"type":74,"value":818},{"type":68,"tag":118,"props":2760,"children":2761},{"style":188},[2762],{"type":74,"value":706},{"type":68,"tag":118,"props":2764,"children":2765},{"style":292},[2766],{"type":74,"value":673},{"type":68,"tag":118,"props":2768,"children":2769},{"style":188},[2770],{"type":74,"value":715},{"type":68,"tag":118,"props":2772,"children":2773},{"class":120,"line":833},[2774,2778,2782,2786,2790,2794,2798,2802,2806,2810,2814,2818,2822,2826,2830,2834,2838,2842,2846,2850,2854,2859,2863,2867,2871],{"type":68,"tag":118,"props":2775,"children":2776},{"style":182},[2777],{"type":74,"value":784},{"type":68,"tag":118,"props":2779,"children":2780},{"style":188},[2781],{"type":74,"value":668},{"type":68,"tag":118,"props":2783,"children":2784},{"style":292},[2785],{"type":74,"value":2192},{"type":68,"tag":118,"props":2787,"children":2788},{"style":243},[2789],{"type":74,"value":2197},{"type":68,"tag":118,"props":2791,"children":2792},{"style":188},[2793],{"type":74,"value":2202},{"type":68,"tag":118,"props":2795,"children":2796},{"style":243},[2797],{"type":74,"value":2207},{"type":68,"tag":118,"props":2799,"children":2800},{"style":272},[2801],{"type":74,"value":1994},{"type":68,"tag":118,"props":2803,"children":2804},{"style":194},[2805],{"type":74,"value":280},{"type":68,"tag":118,"props":2807,"children":2808},{"style":188},[2809],{"type":74,"value":688},{"type":68,"tag":118,"props":2811,"children":2812},{"style":292},[2813],{"type":74,"value":2224},{"type":68,"tag":118,"props":2815,"children":2816},{"style":188},[2817],{"type":74,"value":300},{"type":68,"tag":118,"props":2819,"children":2820},{"style":188},[2821],{"type":74,"value":212},{"type":68,"tag":118,"props":2823,"children":2824},{"style":131},[2825],{"type":74,"value":2237},{"type":68,"tag":118,"props":2827,"children":2828},{"style":188},[2829],{"type":74,"value":221},{"type":68,"tag":118,"props":2831,"children":2832},{"style":188},[2833],{"type":74,"value":202},{"type":68,"tag":118,"props":2835,"children":2836},{"style":194},[2837],{"type":74,"value":377},{"type":68,"tag":118,"props":2839,"children":2840},{"style":188},[2841],{"type":74,"value":2292},{"type":68,"tag":118,"props":2843,"children":2844},{"style":243},[2845],{"type":74,"value":2297},{"type":68,"tag":118,"props":2847,"children":2848},{"style":188},[2849],{"type":74,"value":2302},{"type":68,"tag":118,"props":2851,"children":2852},{"style":194},[2853],{"type":74,"value":2307},{"type":68,"tag":118,"props":2855,"children":2856},{"style":188},[2857],{"type":74,"value":2858},"}>",{"type":68,"tag":118,"props":2860,"children":2861},{"style":194},[2862],{"type":74,"value":2358},{"type":68,"tag":118,"props":2864,"children":2865},{"style":188},[2866],{"type":74,"value":767},{"type":68,"tag":118,"props":2868,"children":2869},{"style":292},[2870],{"type":74,"value":2192},{"type":68,"tag":118,"props":2872,"children":2873},{"style":188},[2874],{"type":74,"value":715},{"type":68,"tag":118,"props":2876,"children":2877},{"class":120,"line":1469},[2878],{"type":68,"tag":118,"props":2879,"children":2880},{"style":188},[2881],{"type":74,"value":839},{"type":68,"tag":77,"props":2883,"children":2884},{},[2885,2887,2893,2895,2901],{"type":74,"value":2886},"Use ",{"type":68,"tag":83,"props":2888,"children":2890},{"className":2889},[],[2891],{"type":74,"value":2892},"useRealtimeTaskTriggerWithStreams\u003Ctypeof myTask, STREAMS>",{"type":74,"value":2894}," when you also\nwant the task's streams (it returns ",{"type":68,"tag":83,"props":2896,"children":2898},{"className":2897},[],[2899],{"type":74,"value":2900},"{ submit, run, streams, error, isLoading }",{"type":74,"value":2902},").",{"type":68,"tag":868,"props":2904,"children":2906},{"id":2905},"_5-consume-an-aitext-stream-sdk-410-recommended",[2907],{"type":74,"value":2908},"5. Consume an AI\u002Ftext stream (SDK 4.1.0+, recommended)",{"type":68,"tag":77,"props":2910,"children":2911},{},[2912,2918,2920,2925,2927,2933],{"type":68,"tag":83,"props":2913,"children":2915},{"className":2914},[],[2916],{"type":74,"value":2917},"useRealtimeStream",{"type":74,"value":2919}," takes a defined stream for full type safety, or a ",{"type":68,"tag":83,"props":2921,"children":2923},{"className":2922},[],[2924],{"type":74,"value":601},{"type":74,"value":2926},"\nplus optional stream key. Returns ",{"type":68,"tag":83,"props":2928,"children":2930},{"className":2929},[],[2931],{"type":74,"value":2932},"{ parts, error }",{"type":74,"value":98},{"type":68,"tag":107,"props":2935,"children":2937},{"className":384,"code":2936,"language":386,"meta":112,"style":112},"\"use client\";\nimport { useRealtimeStream } from \"@trigger.dev\u002Freact-hooks\";\nimport { aiStream } from \"@\u002Ftrigger\u002Fstreams\"; \u002F\u002F a defined stream -> typed parts\n\nexport function StreamView({ runId, publicAccessToken }: { runId: string; publicAccessToken: string }) {\n  const { parts, error } = useRealtimeStream(aiStream, runId, {\n    accessToken: publicAccessToken,\n    timeoutInSeconds: 300, \u002F\u002F default 60\n    onData: (chunk) => console.log(chunk),\n  });\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n  if (!parts) return \u003Cdiv>Loading...\u003C\u002Fdiv>;\n  return \u003Cdiv>{parts.join(\"\")}\u003C\u002Fdiv>;\n}\n",[2938],{"type":68,"tag":83,"props":2939,"children":2940},{"__ignoreMap":112},[2941,2960,3000,3046,3053,3129,3190,3209,3235,3294,3309,3376,3432,3489],{"type":68,"tag":118,"props":2942,"children":2943},{"class":120,"line":121},[2944,2948,2952,2956],{"type":68,"tag":118,"props":2945,"children":2946},{"style":188},[2947],{"type":74,"value":221},{"type":68,"tag":118,"props":2949,"children":2950},{"style":131},[2951],{"type":74,"value":410},{"type":68,"tag":118,"props":2953,"children":2954},{"style":188},[2955],{"type":74,"value":221},{"type":68,"tag":118,"props":2957,"children":2958},{"style":188},[2959],{"type":74,"value":226},{"type":68,"tag":118,"props":2961,"children":2962},{"class":120,"line":148},[2963,2967,2971,2976,2980,2984,2988,2992,2996],{"type":68,"tag":118,"props":2964,"children":2965},{"style":182},[2966],{"type":74,"value":185},{"type":68,"tag":118,"props":2968,"children":2969},{"style":188},[2970],{"type":74,"value":191},{"type":68,"tag":118,"props":2972,"children":2973},{"style":194},[2974],{"type":74,"value":2975}," useRealtimeStream",{"type":68,"tag":118,"props":2977,"children":2978},{"style":188},[2979],{"type":74,"value":202},{"type":68,"tag":118,"props":2981,"children":2982},{"style":182},[2983],{"type":74,"value":207},{"type":68,"tag":118,"props":2985,"children":2986},{"style":188},[2987],{"type":74,"value":212},{"type":68,"tag":118,"props":2989,"children":2990},{"style":131},[2991],{"type":74,"value":88},{"type":68,"tag":118,"props":2993,"children":2994},{"style":188},[2995],{"type":74,"value":221},{"type":68,"tag":118,"props":2997,"children":2998},{"style":188},[2999],{"type":74,"value":226},{"type":68,"tag":118,"props":3001,"children":3002},{"class":120,"line":229},[3003,3007,3011,3016,3020,3024,3028,3033,3037,3041],{"type":68,"tag":118,"props":3004,"children":3005},{"style":182},[3006],{"type":74,"value":185},{"type":68,"tag":118,"props":3008,"children":3009},{"style":188},[3010],{"type":74,"value":191},{"type":68,"tag":118,"props":3012,"children":3013},{"style":194},[3014],{"type":74,"value":3015}," aiStream",{"type":68,"tag":118,"props":3017,"children":3018},{"style":188},[3019],{"type":74,"value":202},{"type":68,"tag":118,"props":3021,"children":3022},{"style":182},[3023],{"type":74,"value":207},{"type":68,"tag":118,"props":3025,"children":3026},{"style":188},[3027],{"type":74,"value":212},{"type":68,"tag":118,"props":3029,"children":3030},{"style":131},[3031],{"type":74,"value":3032},"@\u002Ftrigger\u002Fstreams",{"type":68,"tag":118,"props":3034,"children":3035},{"style":188},[3036],{"type":74,"value":221},{"type":68,"tag":118,"props":3038,"children":3039},{"style":188},[3040],{"type":74,"value":531},{"type":68,"tag":118,"props":3042,"children":3043},{"style":142},[3044],{"type":74,"value":3045}," \u002F\u002F a defined stream -> typed parts\n",{"type":68,"tag":118,"props":3047,"children":3048},{"class":120,"line":239},[3049],{"type":68,"tag":118,"props":3050,"children":3051},{"emptyLinePlaceholder":233},[3052],{"type":74,"value":236},{"type":68,"tag":118,"props":3054,"children":3055},{"class":120,"line":288},[3056,3060,3064,3069,3073,3077,3081,3085,3089,3093,3097,3101,3105,3109,3113,3117,3121,3125],{"type":68,"tag":118,"props":3057,"children":3058},{"style":182},[3059],{"type":74,"value":473},{"type":68,"tag":118,"props":3061,"children":3062},{"style":243},[3063],{"type":74,"value":478},{"type":68,"tag":118,"props":3065,"children":3066},{"style":272},[3067],{"type":74,"value":3068}," StreamView",{"type":68,"tag":118,"props":3070,"children":3071},{"style":188},[3072],{"type":74,"value":488},{"type":68,"tag":118,"props":3074,"children":3075},{"style":491},[3076],{"type":74,"value":494},{"type":68,"tag":118,"props":3078,"children":3079},{"style":188},[3080],{"type":74,"value":499},{"type":68,"tag":118,"props":3082,"children":3083},{"style":491},[3084],{"type":74,"value":504},{"type":68,"tag":118,"props":3086,"children":3087},{"style":188},[3088],{"type":74,"value":509},{"type":68,"tag":118,"props":3090,"children":3091},{"style":188},[3092],{"type":74,"value":191},{"type":68,"tag":118,"props":3094,"children":3095},{"style":292},[3096],{"type":74,"value":494},{"type":68,"tag":118,"props":3098,"children":3099},{"style":188},[3100],{"type":74,"value":300},{"type":68,"tag":118,"props":3102,"children":3103},{"style":125},[3104],{"type":74,"value":526},{"type":68,"tag":118,"props":3106,"children":3107},{"style":188},[3108],{"type":74,"value":531},{"type":68,"tag":118,"props":3110,"children":3111},{"style":292},[3112],{"type":74,"value":504},{"type":68,"tag":118,"props":3114,"children":3115},{"style":188},[3116],{"type":74,"value":300},{"type":68,"tag":118,"props":3118,"children":3119},{"style":125},[3120],{"type":74,"value":526},{"type":68,"tag":118,"props":3122,"children":3123},{"style":188},[3124],{"type":74,"value":548},{"type":68,"tag":118,"props":3126,"children":3127},{"style":188},[3128],{"type":74,"value":553},{"type":68,"tag":118,"props":3130,"children":3131},{"class":120,"line":367},[3132,3136,3140,3145,3149,3153,3157,3161,3165,3169,3174,3178,3182,3186],{"type":68,"tag":118,"props":3133,"children":3134},{"style":243},[3135],{"type":74,"value":561},{"type":68,"tag":118,"props":3137,"children":3138},{"style":188},[3139],{"type":74,"value":191},{"type":68,"tag":118,"props":3141,"children":3142},{"style":194},[3143],{"type":74,"value":3144}," parts",{"type":68,"tag":118,"props":3146,"children":3147},{"style":188},[3148],{"type":74,"value":499},{"type":68,"tag":118,"props":3150,"children":3151},{"style":194},[3152],{"type":74,"value":579},{"type":68,"tag":118,"props":3154,"children":3155},{"style":188},[3156],{"type":74,"value":202},{"type":68,"tag":118,"props":3158,"children":3159},{"style":188},[3160],{"type":74,"value":588},{"type":68,"tag":118,"props":3162,"children":3163},{"style":272},[3164],{"type":74,"value":2975},{"type":68,"tag":118,"props":3166,"children":3167},{"style":292},[3168],{"type":74,"value":280},{"type":68,"tag":118,"props":3170,"children":3171},{"style":194},[3172],{"type":74,"value":3173},"aiStream",{"type":68,"tag":118,"props":3175,"children":3176},{"style":188},[3177],{"type":74,"value":499},{"type":68,"tag":118,"props":3179,"children":3180},{"style":194},[3181],{"type":74,"value":494},{"type":68,"tag":118,"props":3183,"children":3184},{"style":188},[3185],{"type":74,"value":499},{"type":68,"tag":118,"props":3187,"children":3188},{"style":188},[3189],{"type":74,"value":553},{"type":68,"tag":118,"props":3191,"children":3192},{"class":120,"line":637},[3193,3197,3201,3205],{"type":68,"tag":118,"props":3194,"children":3195},{"style":292},[3196],{"type":74,"value":2069},{"type":68,"tag":118,"props":3198,"children":3199},{"style":188},[3200],{"type":74,"value":300},{"type":68,"tag":118,"props":3202,"children":3203},{"style":194},[3204],{"type":74,"value":504},{"type":68,"tag":118,"props":3206,"children":3207},{"style":188},[3208],{"type":74,"value":1589},{"type":68,"tag":118,"props":3210,"children":3211},{"class":120,"line":718},[3212,3217,3221,3226,3230],{"type":68,"tag":118,"props":3213,"children":3214},{"style":292},[3215],{"type":74,"value":3216},"    timeoutInSeconds",{"type":68,"tag":118,"props":3218,"children":3219},{"style":188},[3220],{"type":74,"value":300},{"type":68,"tag":118,"props":3222,"children":3223},{"style":1442},[3224],{"type":74,"value":3225}," 300",{"type":68,"tag":118,"props":3227,"children":3228},{"style":188},[3229],{"type":74,"value":499},{"type":68,"tag":118,"props":3231,"children":3232},{"style":142},[3233],{"type":74,"value":3234}," \u002F\u002F default 60\n",{"type":68,"tag":118,"props":3236,"children":3237},{"class":120,"line":778},[3238,3243,3247,3251,3256,3260,3264,3269,3273,3278,3282,3286,3290],{"type":68,"tag":118,"props":3239,"children":3240},{"style":272},[3241],{"type":74,"value":3242},"    onData",{"type":68,"tag":118,"props":3244,"children":3245},{"style":188},[3246],{"type":74,"value":300},{"type":68,"tag":118,"props":3248,"children":3249},{"style":188},[3250],{"type":74,"value":648},{"type":68,"tag":118,"props":3252,"children":3253},{"style":491},[3254],{"type":74,"value":3255},"chunk",{"type":68,"tag":118,"props":3257,"children":3258},{"style":188},[3259],{"type":74,"value":377},{"type":68,"tag":118,"props":3261,"children":3262},{"style":243},[3263],{"type":74,"value":2207},{"type":68,"tag":118,"props":3265,"children":3266},{"style":194},[3267],{"type":74,"value":3268}," console",{"type":68,"tag":118,"props":3270,"children":3271},{"style":188},[3272],{"type":74,"value":98},{"type":68,"tag":118,"props":3274,"children":3275},{"style":272},[3276],{"type":74,"value":3277},"log",{"type":68,"tag":118,"props":3279,"children":3280},{"style":292},[3281],{"type":74,"value":280},{"type":68,"tag":118,"props":3283,"children":3284},{"style":194},[3285],{"type":74,"value":3255},{"type":68,"tag":118,"props":3287,"children":3288},{"style":292},[3289],{"type":74,"value":377},{"type":68,"tag":118,"props":3291,"children":3292},{"style":188},[3293],{"type":74,"value":1589},{"type":68,"tag":118,"props":3295,"children":3296},{"class":120,"line":833},[3297,3301,3305],{"type":68,"tag":118,"props":3298,"children":3299},{"style":188},[3300],{"type":74,"value":2089},{"type":68,"tag":118,"props":3302,"children":3303},{"style":292},[3304],{"type":74,"value":377},{"type":68,"tag":118,"props":3306,"children":3307},{"style":188},[3308],{"type":74,"value":226},{"type":68,"tag":118,"props":3310,"children":3311},{"class":120,"line":1469},[3312,3316,3320,3324,3328,3332,3336,3340,3344,3348,3352,3356,3360,3364,3368,3372],{"type":68,"tag":118,"props":3313,"children":3314},{"style":182},[3315],{"type":74,"value":643},{"type":68,"tag":118,"props":3317,"children":3318},{"style":292},[3319],{"type":74,"value":648},{"type":68,"tag":118,"props":3321,"children":3322},{"style":194},[3323],{"type":74,"value":653},{"type":68,"tag":118,"props":3325,"children":3326},{"style":292},[3327],{"type":74,"value":658},{"type":68,"tag":118,"props":3329,"children":3330},{"style":182},[3331],{"type":74,"value":663},{"type":68,"tag":118,"props":3333,"children":3334},{"style":188},[3335],{"type":74,"value":668},{"type":68,"tag":118,"props":3337,"children":3338},{"style":292},[3339],{"type":74,"value":673},{"type":68,"tag":118,"props":3341,"children":3342},{"style":188},[3343],{"type":74,"value":678},{"type":68,"tag":118,"props":3345,"children":3346},{"style":194},[3347],{"type":74,"value":683},{"type":68,"tag":118,"props":3349,"children":3350},{"style":188},[3351],{"type":74,"value":688},{"type":68,"tag":118,"props":3353,"children":3354},{"style":194},[3355],{"type":74,"value":653},{"type":68,"tag":118,"props":3357,"children":3358},{"style":188},[3359],{"type":74,"value":98},{"type":68,"tag":118,"props":3361,"children":3362},{"style":194},[3363],{"type":74,"value":701},{"type":68,"tag":118,"props":3365,"children":3366},{"style":188},[3367],{"type":74,"value":706},{"type":68,"tag":118,"props":3369,"children":3370},{"style":292},[3371],{"type":74,"value":673},{"type":68,"tag":118,"props":3373,"children":3374},{"style":188},[3375],{"type":74,"value":715},{"type":68,"tag":118,"props":3377,"children":3378},{"class":120,"line":2315},[3379,3383,3387,3391,3396,3400,3404,3408,3412,3416,3420,3424,3428],{"type":68,"tag":118,"props":3380,"children":3381},{"style":182},[3382],{"type":74,"value":643},{"type":68,"tag":118,"props":3384,"children":3385},{"style":292},[3386],{"type":74,"value":648},{"type":68,"tag":118,"props":3388,"children":3389},{"style":188},[3390],{"type":74,"value":732},{"type":68,"tag":118,"props":3392,"children":3393},{"style":194},[3394],{"type":74,"value":3395},"parts",{"type":68,"tag":118,"props":3397,"children":3398},{"style":292},[3399],{"type":74,"value":658},{"type":68,"tag":118,"props":3401,"children":3402},{"style":182},[3403],{"type":74,"value":663},{"type":68,"tag":118,"props":3405,"children":3406},{"style":188},[3407],{"type":74,"value":668},{"type":68,"tag":118,"props":3409,"children":3410},{"style":292},[3411],{"type":74,"value":673},{"type":68,"tag":118,"props":3413,"children":3414},{"style":188},[3415],{"type":74,"value":678},{"type":68,"tag":118,"props":3417,"children":3418},{"style":194},[3419],{"type":74,"value":762},{"type":68,"tag":118,"props":3421,"children":3422},{"style":188},[3423],{"type":74,"value":767},{"type":68,"tag":118,"props":3425,"children":3426},{"style":292},[3427],{"type":74,"value":673},{"type":68,"tag":118,"props":3429,"children":3430},{"style":188},[3431],{"type":74,"value":715},{"type":68,"tag":118,"props":3433,"children":3434},{"class":120,"line":2369},[3435,3439,3443,3447,3451,3455,3459,3464,3468,3473,3477,3481,3485],{"type":68,"tag":118,"props":3436,"children":3437},{"style":182},[3438],{"type":74,"value":784},{"type":68,"tag":118,"props":3440,"children":3441},{"style":188},[3442],{"type":74,"value":668},{"type":68,"tag":118,"props":3444,"children":3445},{"style":292},[3446],{"type":74,"value":673},{"type":68,"tag":118,"props":3448,"children":3449},{"style":188},[3450],{"type":74,"value":1396},{"type":68,"tag":118,"props":3452,"children":3453},{"style":194},[3454],{"type":74,"value":3395},{"type":68,"tag":118,"props":3456,"children":3457},{"style":188},[3458],{"type":74,"value":98},{"type":68,"tag":118,"props":3460,"children":3461},{"style":272},[3462],{"type":74,"value":3463},"join",{"type":68,"tag":118,"props":3465,"children":3466},{"style":194},[3467],{"type":74,"value":280},{"type":68,"tag":118,"props":3469,"children":3470},{"style":188},[3471],{"type":74,"value":3472},"\"\"",{"type":68,"tag":118,"props":3474,"children":3475},{"style":194},[3476],{"type":74,"value":377},{"type":68,"tag":118,"props":3478,"children":3479},{"style":188},[3480],{"type":74,"value":706},{"type":68,"tag":118,"props":3482,"children":3483},{"style":292},[3484],{"type":74,"value":673},{"type":68,"tag":118,"props":3486,"children":3487},{"style":188},[3488],{"type":74,"value":715},{"type":68,"tag":118,"props":3490,"children":3491},{"class":120,"line":2387},[3492],{"type":68,"tag":118,"props":3493,"children":3494},{"style":188},[3495],{"type":74,"value":839},{"type":68,"tag":77,"props":3497,"children":3498},{},[3499,3501,3507,3509,3515,3516,3522,3523,3529,3531,3537],{"type":74,"value":3500},"Without a defined stream: ",{"type":68,"tag":83,"props":3502,"children":3504},{"className":3503},[],[3505],{"type":74,"value":3506},"useRealtimeStream\u003Cstring>(runId, \"ai-output\", { accessToken })",{"type":74,"value":3508},",\nor omit the key to use the default stream. Other options: ",{"type":68,"tag":83,"props":3510,"children":3512},{"className":3511},[],[3513],{"type":74,"value":3514},"baseURL",{"type":74,"value":1669},{"type":68,"tag":83,"props":3517,"children":3519},{"className":3518},[],[3520],{"type":74,"value":3521},"startIndex",{"type":74,"value":1589},{"type":68,"tag":83,"props":3524,"children":3526},{"className":3525},[],[3527],{"type":74,"value":3528},"throttleInMs",{"type":74,"value":3530}," (default 16). The legacy ",{"type":68,"tag":83,"props":3532,"children":3534},{"className":3533},[],[3535],{"type":74,"value":3536},"useRealtimeRunWithStreams(runId, options)",{"type":74,"value":3538},"\nhook is still supported when you need both the run and all its streams at once.",{"type":68,"tag":868,"props":3540,"children":3542},{"id":3541},"_6-send-input-back-into-a-running-task",[3543],{"type":74,"value":3544},"6. Send input back into a running task",{"type":68,"tag":107,"props":3546,"children":3548},{"className":384,"code":3547,"language":386,"meta":112,"style":112},"\"use client\";\nimport { useInputStreamSend } from \"@trigger.dev\u002Freact-hooks\";\nimport { approval } from \"@\u002Ftrigger\u002Fstreams\";\n\nexport function ApprovalForm({ runId, accessToken }: { runId: string; accessToken: string }) {\n  const { send, isLoading, isReady } = useInputStreamSend(approval.id, runId, { accessToken });\n  return (\n    \u003Cbutton disabled={!isReady || isLoading} onClick={() => send({ approved: true })}>\n      Approve\n    \u003C\u002Fbutton>\n  );\n}\n",[3549],{"type":68,"tag":83,"props":3550,"children":3551},{"__ignoreMap":112},[3552,3571,3611,3651,3658,3734,3828,3839,3930,3938,3953,3964],{"type":68,"tag":118,"props":3553,"children":3554},{"class":120,"line":121},[3555,3559,3563,3567],{"type":68,"tag":118,"props":3556,"children":3557},{"style":188},[3558],{"type":74,"value":221},{"type":68,"tag":118,"props":3560,"children":3561},{"style":131},[3562],{"type":74,"value":410},{"type":68,"tag":118,"props":3564,"children":3565},{"style":188},[3566],{"type":74,"value":221},{"type":68,"tag":118,"props":3568,"children":3569},{"style":188},[3570],{"type":74,"value":226},{"type":68,"tag":118,"props":3572,"children":3573},{"class":120,"line":148},[3574,3578,3582,3587,3591,3595,3599,3603,3607],{"type":68,"tag":118,"props":3575,"children":3576},{"style":182},[3577],{"type":74,"value":185},{"type":68,"tag":118,"props":3579,"children":3580},{"style":188},[3581],{"type":74,"value":191},{"type":68,"tag":118,"props":3583,"children":3584},{"style":194},[3585],{"type":74,"value":3586}," useInputStreamSend",{"type":68,"tag":118,"props":3588,"children":3589},{"style":188},[3590],{"type":74,"value":202},{"type":68,"tag":118,"props":3592,"children":3593},{"style":182},[3594],{"type":74,"value":207},{"type":68,"tag":118,"props":3596,"children":3597},{"style":188},[3598],{"type":74,"value":212},{"type":68,"tag":118,"props":3600,"children":3601},{"style":131},[3602],{"type":74,"value":88},{"type":68,"tag":118,"props":3604,"children":3605},{"style":188},[3606],{"type":74,"value":221},{"type":68,"tag":118,"props":3608,"children":3609},{"style":188},[3610],{"type":74,"value":226},{"type":68,"tag":118,"props":3612,"children":3613},{"class":120,"line":229},[3614,3618,3622,3627,3631,3635,3639,3643,3647],{"type":68,"tag":118,"props":3615,"children":3616},{"style":182},[3617],{"type":74,"value":185},{"type":68,"tag":118,"props":3619,"children":3620},{"style":188},[3621],{"type":74,"value":191},{"type":68,"tag":118,"props":3623,"children":3624},{"style":194},[3625],{"type":74,"value":3626}," approval",{"type":68,"tag":118,"props":3628,"children":3629},{"style":188},[3630],{"type":74,"value":202},{"type":68,"tag":118,"props":3632,"children":3633},{"style":182},[3634],{"type":74,"value":207},{"type":68,"tag":118,"props":3636,"children":3637},{"style":188},[3638],{"type":74,"value":212},{"type":68,"tag":118,"props":3640,"children":3641},{"style":131},[3642],{"type":74,"value":3032},{"type":68,"tag":118,"props":3644,"children":3645},{"style":188},[3646],{"type":74,"value":221},{"type":68,"tag":118,"props":3648,"children":3649},{"style":188},[3650],{"type":74,"value":226},{"type":68,"tag":118,"props":3652,"children":3653},{"class":120,"line":239},[3654],{"type":68,"tag":118,"props":3655,"children":3656},{"emptyLinePlaceholder":233},[3657],{"type":74,"value":236},{"type":68,"tag":118,"props":3659,"children":3660},{"class":120,"line":288},[3661,3665,3669,3674,3678,3682,3686,3690,3694,3698,3702,3706,3710,3714,3718,3722,3726,3730],{"type":68,"tag":118,"props":3662,"children":3663},{"style":182},[3664],{"type":74,"value":473},{"type":68,"tag":118,"props":3666,"children":3667},{"style":243},[3668],{"type":74,"value":478},{"type":68,"tag":118,"props":3670,"children":3671},{"style":272},[3672],{"type":74,"value":3673}," ApprovalForm",{"type":68,"tag":118,"props":3675,"children":3676},{"style":188},[3677],{"type":74,"value":488},{"type":68,"tag":118,"props":3679,"children":3680},{"style":491},[3681],{"type":74,"value":494},{"type":68,"tag":118,"props":3683,"children":3684},{"style":188},[3685],{"type":74,"value":499},{"type":68,"tag":118,"props":3687,"children":3688},{"style":491},[3689],{"type":74,"value":614},{"type":68,"tag":118,"props":3691,"children":3692},{"style":188},[3693],{"type":74,"value":509},{"type":68,"tag":118,"props":3695,"children":3696},{"style":188},[3697],{"type":74,"value":191},{"type":68,"tag":118,"props":3699,"children":3700},{"style":292},[3701],{"type":74,"value":494},{"type":68,"tag":118,"props":3703,"children":3704},{"style":188},[3705],{"type":74,"value":300},{"type":68,"tag":118,"props":3707,"children":3708},{"style":125},[3709],{"type":74,"value":526},{"type":68,"tag":118,"props":3711,"children":3712},{"style":188},[3713],{"type":74,"value":531},{"type":68,"tag":118,"props":3715,"children":3716},{"style":292},[3717],{"type":74,"value":614},{"type":68,"tag":118,"props":3719,"children":3720},{"style":188},[3721],{"type":74,"value":300},{"type":68,"tag":118,"props":3723,"children":3724},{"style":125},[3725],{"type":74,"value":526},{"type":68,"tag":118,"props":3727,"children":3728},{"style":188},[3729],{"type":74,"value":548},{"type":68,"tag":118,"props":3731,"children":3732},{"style":188},[3733],{"type":74,"value":553},{"type":68,"tag":118,"props":3735,"children":3736},{"class":120,"line":367},[3737,3741,3745,3750,3754,3758,3762,3767,3771,3775,3779,3783,3788,3792,3796,3800,3804,3808,3812,3816,3820,3824],{"type":68,"tag":118,"props":3738,"children":3739},{"style":243},[3740],{"type":74,"value":561},{"type":68,"tag":118,"props":3742,"children":3743},{"style":188},[3744],{"type":74,"value":191},{"type":68,"tag":118,"props":3746,"children":3747},{"style":194},[3748],{"type":74,"value":3749}," send",{"type":68,"tag":118,"props":3751,"children":3752},{"style":188},[3753],{"type":74,"value":499},{"type":68,"tag":118,"props":3755,"children":3756},{"style":194},[3757],{"type":74,"value":2012},{"type":68,"tag":118,"props":3759,"children":3760},{"style":188},[3761],{"type":74,"value":499},{"type":68,"tag":118,"props":3763,"children":3764},{"style":194},[3765],{"type":74,"value":3766}," isReady",{"type":68,"tag":118,"props":3768,"children":3769},{"style":188},[3770],{"type":74,"value":202},{"type":68,"tag":118,"props":3772,"children":3773},{"style":188},[3774],{"type":74,"value":588},{"type":68,"tag":118,"props":3776,"children":3777},{"style":272},[3778],{"type":74,"value":3586},{"type":68,"tag":118,"props":3780,"children":3781},{"style":292},[3782],{"type":74,"value":280},{"type":68,"tag":118,"props":3784,"children":3785},{"style":194},[3786],{"type":74,"value":3787},"approval",{"type":68,"tag":118,"props":3789,"children":3790},{"style":188},[3791],{"type":74,"value":98},{"type":68,"tag":118,"props":3793,"children":3794},{"style":194},[3795],{"type":74,"value":2155},{"type":68,"tag":118,"props":3797,"children":3798},{"style":188},[3799],{"type":74,"value":499},{"type":68,"tag":118,"props":3801,"children":3802},{"style":194},[3803],{"type":74,"value":494},{"type":68,"tag":118,"props":3805,"children":3806},{"style":188},[3807],{"type":74,"value":499},{"type":68,"tag":118,"props":3809,"children":3810},{"style":188},[3811],{"type":74,"value":191},{"type":68,"tag":118,"props":3813,"children":3814},{"style":194},[3815],{"type":74,"value":614},{"type":68,"tag":118,"props":3817,"children":3818},{"style":188},[3819],{"type":74,"value":202},{"type":68,"tag":118,"props":3821,"children":3822},{"style":292},[3823],{"type":74,"value":377},{"type":68,"tag":118,"props":3825,"children":3826},{"style":188},[3827],{"type":74,"value":226},{"type":68,"tag":118,"props":3829,"children":3830},{"class":120,"line":637},[3831,3835],{"type":68,"tag":118,"props":3832,"children":3833},{"style":182},[3834],{"type":74,"value":784},{"type":68,"tag":118,"props":3836,"children":3837},{"style":292},[3838],{"type":74,"value":2179},{"type":68,"tag":118,"props":3840,"children":3841},{"class":120,"line":718},[3842,3846,3850,3855,3860,3865,3870,3874,3878,3883,3887,3891,3895,3899,3903,3908,3912,3918,3922,3926],{"type":68,"tag":118,"props":3843,"children":3844},{"style":188},[3845],{"type":74,"value":2187},{"type":68,"tag":118,"props":3847,"children":3848},{"style":292},[3849],{"type":74,"value":2192},{"type":68,"tag":118,"props":3851,"children":3852},{"style":243},[3853],{"type":74,"value":3854}," disabled",{"type":68,"tag":118,"props":3856,"children":3857},{"style":188},[3858],{"type":74,"value":3859},"={!",{"type":68,"tag":118,"props":3861,"children":3862},{"style":194},[3863],{"type":74,"value":3864},"isReady ",{"type":68,"tag":118,"props":3866,"children":3867},{"style":188},[3868],{"type":74,"value":3869},"||",{"type":68,"tag":118,"props":3871,"children":3872},{"style":194},[3873],{"type":74,"value":2012},{"type":68,"tag":118,"props":3875,"children":3876},{"style":188},[3877],{"type":74,"value":2292},{"type":68,"tag":118,"props":3879,"children":3880},{"style":243},[3881],{"type":74,"value":3882},"onClick",{"type":68,"tag":118,"props":3884,"children":3885},{"style":188},[3886],{"type":74,"value":2202},{"type":68,"tag":118,"props":3888,"children":3889},{"style":243},[3890],{"type":74,"value":2207},{"type":68,"tag":118,"props":3892,"children":3893},{"style":272},[3894],{"type":74,"value":3749},{"type":68,"tag":118,"props":3896,"children":3897},{"style":194},[3898],{"type":74,"value":280},{"type":68,"tag":118,"props":3900,"children":3901},{"style":188},[3902],{"type":74,"value":688},{"type":68,"tag":118,"props":3904,"children":3905},{"style":292},[3906],{"type":74,"value":3907}," approved",{"type":68,"tag":118,"props":3909,"children":3910},{"style":188},[3911],{"type":74,"value":300},{"type":68,"tag":118,"props":3913,"children":3915},{"style":3914},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[3916],{"type":74,"value":3917}," true",{"type":68,"tag":118,"props":3919,"children":3920},{"style":188},[3921],{"type":74,"value":202},{"type":68,"tag":118,"props":3923,"children":3924},{"style":194},[3925],{"type":74,"value":377},{"type":68,"tag":118,"props":3927,"children":3928},{"style":188},[3929],{"type":74,"value":2312},{"type":68,"tag":118,"props":3931,"children":3932},{"class":120,"line":778},[3933],{"type":68,"tag":118,"props":3934,"children":3935},{"style":194},[3936],{"type":74,"value":3937},"      Approve\n",{"type":68,"tag":118,"props":3939,"children":3940},{"class":120,"line":833},[3941,3945,3949],{"type":68,"tag":118,"props":3942,"children":3943},{"style":188},[3944],{"type":74,"value":2375},{"type":68,"tag":118,"props":3946,"children":3947},{"style":292},[3948],{"type":74,"value":2192},{"type":68,"tag":118,"props":3950,"children":3951},{"style":188},[3952],{"type":74,"value":2384},{"type":68,"tag":118,"props":3954,"children":3955},{"class":120,"line":1469},[3956,3960],{"type":68,"tag":118,"props":3957,"children":3958},{"style":292},[3959],{"type":74,"value":2393},{"type":68,"tag":118,"props":3961,"children":3962},{"style":188},[3963],{"type":74,"value":226},{"type":68,"tag":118,"props":3965,"children":3966},{"class":120,"line":2315},[3967],{"type":68,"tag":118,"props":3968,"children":3969},{"style":188},[3970],{"type":74,"value":839},{"type":68,"tag":868,"props":3972,"children":3974},{"id":3973},"_7-complete-a-wait-token-from-react",[3975],{"type":74,"value":3976},"7. Complete a wait token from React",{"type":68,"tag":107,"props":3978,"children":3980},{"className":162,"code":3979,"language":164,"meta":112,"style":112},"\u002F\u002F backend: create the token, return id + publicAccessToken to the frontend\nimport { wait } from \"@trigger.dev\u002Fsdk\";\nconst token = await wait.createToken({ timeout: \"10m\" });\nreturn { tokenId: token.id, publicToken: token.publicAccessToken };\n",[3981],{"type":68,"tag":83,"props":3982,"children":3983},{"__ignoreMap":112},[3984,3992,4032,4107],{"type":68,"tag":118,"props":3985,"children":3986},{"class":120,"line":121},[3987],{"type":68,"tag":118,"props":3988,"children":3989},{"style":142},[3990],{"type":74,"value":3991},"\u002F\u002F backend: create the token, return id + publicAccessToken to the frontend\n",{"type":68,"tag":118,"props":3993,"children":3994},{"class":120,"line":148},[3995,3999,4003,4008,4012,4016,4020,4024,4028],{"type":68,"tag":118,"props":3996,"children":3997},{"style":182},[3998],{"type":74,"value":185},{"type":68,"tag":118,"props":4000,"children":4001},{"style":188},[4002],{"type":74,"value":191},{"type":68,"tag":118,"props":4004,"children":4005},{"style":194},[4006],{"type":74,"value":4007}," wait",{"type":68,"tag":118,"props":4009,"children":4010},{"style":188},[4011],{"type":74,"value":202},{"type":68,"tag":118,"props":4013,"children":4014},{"style":182},[4015],{"type":74,"value":207},{"type":68,"tag":118,"props":4017,"children":4018},{"style":188},[4019],{"type":74,"value":212},{"type":68,"tag":118,"props":4021,"children":4022},{"style":131},[4023],{"type":74,"value":96},{"type":68,"tag":118,"props":4025,"children":4026},{"style":188},[4027],{"type":74,"value":221},{"type":68,"tag":118,"props":4029,"children":4030},{"style":188},[4031],{"type":74,"value":226},{"type":68,"tag":118,"props":4033,"children":4034},{"class":120,"line":229},[4035,4039,4044,4048,4052,4056,4060,4065,4069,4073,4078,4082,4086,4091,4095,4099,4103],{"type":68,"tag":118,"props":4036,"children":4037},{"style":243},[4038],{"type":74,"value":246},{"type":68,"tag":118,"props":4040,"children":4041},{"style":194},[4042],{"type":74,"value":4043}," token ",{"type":68,"tag":118,"props":4045,"children":4046},{"style":188},[4047],{"type":74,"value":256},{"type":68,"tag":118,"props":4049,"children":4050},{"style":182},[4051],{"type":74,"value":261},{"type":68,"tag":118,"props":4053,"children":4054},{"style":194},[4055],{"type":74,"value":4007},{"type":68,"tag":118,"props":4057,"children":4058},{"style":188},[4059],{"type":74,"value":98},{"type":68,"tag":118,"props":4061,"children":4062},{"style":272},[4063],{"type":74,"value":4064},"createToken",{"type":68,"tag":118,"props":4066,"children":4067},{"style":194},[4068],{"type":74,"value":280},{"type":68,"tag":118,"props":4070,"children":4071},{"style":188},[4072],{"type":74,"value":688},{"type":68,"tag":118,"props":4074,"children":4075},{"style":292},[4076],{"type":74,"value":4077}," timeout",{"type":68,"tag":118,"props":4079,"children":4080},{"style":188},[4081],{"type":74,"value":300},{"type":68,"tag":118,"props":4083,"children":4084},{"style":188},[4085],{"type":74,"value":212},{"type":68,"tag":118,"props":4087,"children":4088},{"style":131},[4089],{"type":74,"value":4090},"10m",{"type":68,"tag":118,"props":4092,"children":4093},{"style":188},[4094],{"type":74,"value":221},{"type":68,"tag":118,"props":4096,"children":4097},{"style":188},[4098],{"type":74,"value":202},{"type":68,"tag":118,"props":4100,"children":4101},{"style":194},[4102],{"type":74,"value":377},{"type":68,"tag":118,"props":4104,"children":4105},{"style":188},[4106],{"type":74,"value":226},{"type":68,"tag":118,"props":4108,"children":4109},{"class":120,"line":239},[4110,4114,4118,4123,4127,4132,4136,4140,4144,4149,4153,4157,4161,4166],{"type":68,"tag":118,"props":4111,"children":4112},{"style":182},[4113],{"type":74,"value":663},{"type":68,"tag":118,"props":4115,"children":4116},{"style":188},[4117],{"type":74,"value":191},{"type":68,"tag":118,"props":4119,"children":4120},{"style":292},[4121],{"type":74,"value":4122}," tokenId",{"type":68,"tag":118,"props":4124,"children":4125},{"style":188},[4126],{"type":74,"value":300},{"type":68,"tag":118,"props":4128,"children":4129},{"style":194},[4130],{"type":74,"value":4131}," token",{"type":68,"tag":118,"props":4133,"children":4134},{"style":188},[4135],{"type":74,"value":98},{"type":68,"tag":118,"props":4137,"children":4138},{"style":194},[4139],{"type":74,"value":2155},{"type":68,"tag":118,"props":4141,"children":4142},{"style":188},[4143],{"type":74,"value":499},{"type":68,"tag":118,"props":4145,"children":4146},{"style":292},[4147],{"type":74,"value":4148}," publicToken",{"type":68,"tag":118,"props":4150,"children":4151},{"style":188},[4152],{"type":74,"value":300},{"type":68,"tag":118,"props":4154,"children":4155},{"style":194},[4156],{"type":74,"value":4131},{"type":68,"tag":118,"props":4158,"children":4159},{"style":188},[4160],{"type":74,"value":98},{"type":68,"tag":118,"props":4162,"children":4163},{"style":194},[4164],{"type":74,"value":4165},"publicAccessToken ",{"type":68,"tag":118,"props":4167,"children":4168},{"style":188},[4169],{"type":74,"value":4170},"};\n",{"type":68,"tag":107,"props":4172,"children":4174},{"className":384,"code":4173,"language":386,"meta":112,"style":112},"\"use client\";\nimport { useWaitToken } from \"@trigger.dev\u002Freact-hooks\";\n\nexport function Approve({ tokenId, publicToken }: { tokenId: string; publicToken: string }) {\n  const { complete } = useWaitToken(tokenId, { accessToken: publicToken });\n  return \u003Cbutton onClick={() => complete({ approved: true })}>Approve\u003C\u002Fbutton>;\n}\n",[4175],{"type":68,"tag":83,"props":4176,"children":4177},{"__ignoreMap":112},[4178,4197,4237,4244,4320,4389,4469],{"type":68,"tag":118,"props":4179,"children":4180},{"class":120,"line":121},[4181,4185,4189,4193],{"type":68,"tag":118,"props":4182,"children":4183},{"style":188},[4184],{"type":74,"value":221},{"type":68,"tag":118,"props":4186,"children":4187},{"style":131},[4188],{"type":74,"value":410},{"type":68,"tag":118,"props":4190,"children":4191},{"style":188},[4192],{"type":74,"value":221},{"type":68,"tag":118,"props":4194,"children":4195},{"style":188},[4196],{"type":74,"value":226},{"type":68,"tag":118,"props":4198,"children":4199},{"class":120,"line":148},[4200,4204,4208,4213,4217,4221,4225,4229,4233],{"type":68,"tag":118,"props":4201,"children":4202},{"style":182},[4203],{"type":74,"value":185},{"type":68,"tag":118,"props":4205,"children":4206},{"style":188},[4207],{"type":74,"value":191},{"type":68,"tag":118,"props":4209,"children":4210},{"style":194},[4211],{"type":74,"value":4212}," useWaitToken",{"type":68,"tag":118,"props":4214,"children":4215},{"style":188},[4216],{"type":74,"value":202},{"type":68,"tag":118,"props":4218,"children":4219},{"style":182},[4220],{"type":74,"value":207},{"type":68,"tag":118,"props":4222,"children":4223},{"style":188},[4224],{"type":74,"value":212},{"type":68,"tag":118,"props":4226,"children":4227},{"style":131},[4228],{"type":74,"value":88},{"type":68,"tag":118,"props":4230,"children":4231},{"style":188},[4232],{"type":74,"value":221},{"type":68,"tag":118,"props":4234,"children":4235},{"style":188},[4236],{"type":74,"value":226},{"type":68,"tag":118,"props":4238,"children":4239},{"class":120,"line":229},[4240],{"type":68,"tag":118,"props":4241,"children":4242},{"emptyLinePlaceholder":233},[4243],{"type":74,"value":236},{"type":68,"tag":118,"props":4245,"children":4246},{"class":120,"line":239},[4247,4251,4255,4260,4264,4268,4272,4276,4280,4284,4288,4292,4296,4300,4304,4308,4312,4316],{"type":68,"tag":118,"props":4248,"children":4249},{"style":182},[4250],{"type":74,"value":473},{"type":68,"tag":118,"props":4252,"children":4253},{"style":243},[4254],{"type":74,"value":478},{"type":68,"tag":118,"props":4256,"children":4257},{"style":272},[4258],{"type":74,"value":4259}," Approve",{"type":68,"tag":118,"props":4261,"children":4262},{"style":188},[4263],{"type":74,"value":488},{"type":68,"tag":118,"props":4265,"children":4266},{"style":491},[4267],{"type":74,"value":4122},{"type":68,"tag":118,"props":4269,"children":4270},{"style":188},[4271],{"type":74,"value":499},{"type":68,"tag":118,"props":4273,"children":4274},{"style":491},[4275],{"type":74,"value":4148},{"type":68,"tag":118,"props":4277,"children":4278},{"style":188},[4279],{"type":74,"value":509},{"type":68,"tag":118,"props":4281,"children":4282},{"style":188},[4283],{"type":74,"value":191},{"type":68,"tag":118,"props":4285,"children":4286},{"style":292},[4287],{"type":74,"value":4122},{"type":68,"tag":118,"props":4289,"children":4290},{"style":188},[4291],{"type":74,"value":300},{"type":68,"tag":118,"props":4293,"children":4294},{"style":125},[4295],{"type":74,"value":526},{"type":68,"tag":118,"props":4297,"children":4298},{"style":188},[4299],{"type":74,"value":531},{"type":68,"tag":118,"props":4301,"children":4302},{"style":292},[4303],{"type":74,"value":4148},{"type":68,"tag":118,"props":4305,"children":4306},{"style":188},[4307],{"type":74,"value":300},{"type":68,"tag":118,"props":4309,"children":4310},{"style":125},[4311],{"type":74,"value":526},{"type":68,"tag":118,"props":4313,"children":4314},{"style":188},[4315],{"type":74,"value":548},{"type":68,"tag":118,"props":4317,"children":4318},{"style":188},[4319],{"type":74,"value":553},{"type":68,"tag":118,"props":4321,"children":4322},{"class":120,"line":288},[4323,4327,4331,4336,4340,4344,4348,4352,4357,4361,4365,4369,4373,4377,4381,4385],{"type":68,"tag":118,"props":4324,"children":4325},{"style":243},[4326],{"type":74,"value":561},{"type":68,"tag":118,"props":4328,"children":4329},{"style":188},[4330],{"type":74,"value":191},{"type":68,"tag":118,"props":4332,"children":4333},{"style":194},[4334],{"type":74,"value":4335}," complete",{"type":68,"tag":118,"props":4337,"children":4338},{"style":188},[4339],{"type":74,"value":202},{"type":68,"tag":118,"props":4341,"children":4342},{"style":188},[4343],{"type":74,"value":588},{"type":68,"tag":118,"props":4345,"children":4346},{"style":272},[4347],{"type":74,"value":4212},{"type":68,"tag":118,"props":4349,"children":4350},{"style":292},[4351],{"type":74,"value":280},{"type":68,"tag":118,"props":4353,"children":4354},{"style":194},[4355],{"type":74,"value":4356},"tokenId",{"type":68,"tag":118,"props":4358,"children":4359},{"style":188},[4360],{"type":74,"value":499},{"type":68,"tag":118,"props":4362,"children":4363},{"style":188},[4364],{"type":74,"value":191},{"type":68,"tag":118,"props":4366,"children":4367},{"style":292},[4368],{"type":74,"value":614},{"type":68,"tag":118,"props":4370,"children":4371},{"style":188},[4372],{"type":74,"value":300},{"type":68,"tag":118,"props":4374,"children":4375},{"style":194},[4376],{"type":74,"value":4148},{"type":68,"tag":118,"props":4378,"children":4379},{"style":188},[4380],{"type":74,"value":202},{"type":68,"tag":118,"props":4382,"children":4383},{"style":292},[4384],{"type":74,"value":377},{"type":68,"tag":118,"props":4386,"children":4387},{"style":188},[4388],{"type":74,"value":226},{"type":68,"tag":118,"props":4390,"children":4391},{"class":120,"line":367},[4392,4396,4400,4404,4408,4412,4416,4420,4424,4428,4432,4436,4440,4444,4448,4452,4457,4461,4465],{"type":68,"tag":118,"props":4393,"children":4394},{"style":182},[4395],{"type":74,"value":784},{"type":68,"tag":118,"props":4397,"children":4398},{"style":188},[4399],{"type":74,"value":668},{"type":68,"tag":118,"props":4401,"children":4402},{"style":292},[4403],{"type":74,"value":2192},{"type":68,"tag":118,"props":4405,"children":4406},{"style":243},[4407],{"type":74,"value":2197},{"type":68,"tag":118,"props":4409,"children":4410},{"style":188},[4411],{"type":74,"value":2202},{"type":68,"tag":118,"props":4413,"children":4414},{"style":243},[4415],{"type":74,"value":2207},{"type":68,"tag":118,"props":4417,"children":4418},{"style":272},[4419],{"type":74,"value":4335},{"type":68,"tag":118,"props":4421,"children":4422},{"style":194},[4423],{"type":74,"value":280},{"type":68,"tag":118,"props":4425,"children":4426},{"style":188},[4427],{"type":74,"value":688},{"type":68,"tag":118,"props":4429,"children":4430},{"style":292},[4431],{"type":74,"value":3907},{"type":68,"tag":118,"props":4433,"children":4434},{"style":188},[4435],{"type":74,"value":300},{"type":68,"tag":118,"props":4437,"children":4438},{"style":3914},[4439],{"type":74,"value":3917},{"type":68,"tag":118,"props":4441,"children":4442},{"style":188},[4443],{"type":74,"value":202},{"type":68,"tag":118,"props":4445,"children":4446},{"style":194},[4447],{"type":74,"value":377},{"type":68,"tag":118,"props":4449,"children":4450},{"style":188},[4451],{"type":74,"value":2858},{"type":68,"tag":118,"props":4453,"children":4454},{"style":194},[4455],{"type":74,"value":4456},"Approve",{"type":68,"tag":118,"props":4458,"children":4459},{"style":188},[4460],{"type":74,"value":767},{"type":68,"tag":118,"props":4462,"children":4463},{"style":292},[4464],{"type":74,"value":2192},{"type":68,"tag":118,"props":4466,"children":4467},{"style":188},[4468],{"type":74,"value":715},{"type":68,"tag":118,"props":4470,"children":4471},{"class":120,"line":637},[4472],{"type":68,"tag":118,"props":4473,"children":4474},{"style":188},[4475],{"type":74,"value":839},{"type":68,"tag":868,"props":4477,"children":4479},{"id":4478},"_8-subscribe-from-the-backend-async-iterators",[4480],{"type":74,"value":4481},"8. Subscribe from the backend (async iterators)",{"type":68,"tag":107,"props":4483,"children":4485},{"className":162,"code":4484,"language":164,"meta":112,"style":112},"import { runs, tasks } from \"@trigger.dev\u002Fsdk\";\nimport type { myTask } from \".\u002Ftrigger\u002Fmy-task\";\n\nconst handle = await tasks.trigger(\"my-task\", { some: \"data\" });\nfor await (const run of runs.subscribeToRun\u003Ctypeof myTask>(handle.id)) {\n  console.log(run.payload.some, run.output?.some); \u002F\u002F typed\n}\n",[4486],{"type":68,"tag":83,"props":4487,"children":4488},{"__ignoreMap":112},[4489,4537,4581,4588,4678,4750,4828],{"type":68,"tag":118,"props":4490,"children":4491},{"class":120,"line":121},[4492,4496,4500,4504,4508,4513,4517,4521,4525,4529,4533],{"type":68,"tag":118,"props":4493,"children":4494},{"style":182},[4495],{"type":74,"value":185},{"type":68,"tag":118,"props":4497,"children":4498},{"style":188},[4499],{"type":74,"value":191},{"type":68,"tag":118,"props":4501,"children":4502},{"style":194},[4503],{"type":74,"value":322},{"type":68,"tag":118,"props":4505,"children":4506},{"style":188},[4507],{"type":74,"value":499},{"type":68,"tag":118,"props":4509,"children":4510},{"style":194},[4511],{"type":74,"value":4512}," tasks",{"type":68,"tag":118,"props":4514,"children":4515},{"style":188},[4516],{"type":74,"value":202},{"type":68,"tag":118,"props":4518,"children":4519},{"style":182},[4520],{"type":74,"value":207},{"type":68,"tag":118,"props":4522,"children":4523},{"style":188},[4524],{"type":74,"value":212},{"type":68,"tag":118,"props":4526,"children":4527},{"style":131},[4528],{"type":74,"value":96},{"type":68,"tag":118,"props":4530,"children":4531},{"style":188},[4532],{"type":74,"value":221},{"type":68,"tag":118,"props":4534,"children":4535},{"style":188},[4536],{"type":74,"value":226},{"type":68,"tag":118,"props":4538,"children":4539},{"class":120,"line":148},[4540,4544,4548,4552,4556,4560,4564,4568,4573,4577],{"type":68,"tag":118,"props":4541,"children":4542},{"style":182},[4543],{"type":74,"value":185},{"type":68,"tag":118,"props":4545,"children":4546},{"style":182},[4547],{"type":74,"value":969},{"type":68,"tag":118,"props":4549,"children":4550},{"style":188},[4551],{"type":74,"value":191},{"type":68,"tag":118,"props":4553,"children":4554},{"style":194},[4555],{"type":74,"value":978},{"type":68,"tag":118,"props":4557,"children":4558},{"style":188},[4559],{"type":74,"value":202},{"type":68,"tag":118,"props":4561,"children":4562},{"style":182},[4563],{"type":74,"value":207},{"type":68,"tag":118,"props":4565,"children":4566},{"style":188},[4567],{"type":74,"value":212},{"type":68,"tag":118,"props":4569,"children":4570},{"style":131},[4571],{"type":74,"value":4572},".\u002Ftrigger\u002Fmy-task",{"type":68,"tag":118,"props":4574,"children":4575},{"style":188},[4576],{"type":74,"value":221},{"type":68,"tag":118,"props":4578,"children":4579},{"style":188},[4580],{"type":74,"value":226},{"type":68,"tag":118,"props":4582,"children":4583},{"class":120,"line":229},[4584],{"type":68,"tag":118,"props":4585,"children":4586},{"emptyLinePlaceholder":233},[4587],{"type":74,"value":236},{"type":68,"tag":118,"props":4589,"children":4590},{"class":120,"line":239},[4591,4595,4600,4604,4608,4612,4616,4620,4624,4628,4632,4636,4640,4644,4649,4653,4657,4662,4666,4670,4674],{"type":68,"tag":118,"props":4592,"children":4593},{"style":243},[4594],{"type":74,"value":246},{"type":68,"tag":118,"props":4596,"children":4597},{"style":194},[4598],{"type":74,"value":4599}," handle ",{"type":68,"tag":118,"props":4601,"children":4602},{"style":188},[4603],{"type":74,"value":256},{"type":68,"tag":118,"props":4605,"children":4606},{"style":182},[4607],{"type":74,"value":261},{"type":68,"tag":118,"props":4609,"children":4610},{"style":194},[4611],{"type":74,"value":4512},{"type":68,"tag":118,"props":4613,"children":4614},{"style":188},[4615],{"type":74,"value":98},{"type":68,"tag":118,"props":4617,"children":4618},{"style":272},[4619],{"type":74,"value":2422},{"type":68,"tag":118,"props":4621,"children":4622},{"style":194},[4623],{"type":74,"value":280},{"type":68,"tag":118,"props":4625,"children":4626},{"style":188},[4627],{"type":74,"value":221},{"type":68,"tag":118,"props":4629,"children":4630},{"style":131},[4631],{"type":74,"value":2049},{"type":68,"tag":118,"props":4633,"children":4634},{"style":188},[4635],{"type":74,"value":221},{"type":68,"tag":118,"props":4637,"children":4638},{"style":188},[4639],{"type":74,"value":499},{"type":68,"tag":118,"props":4641,"children":4642},{"style":188},[4643],{"type":74,"value":191},{"type":68,"tag":118,"props":4645,"children":4646},{"style":292},[4647],{"type":74,"value":4648}," some",{"type":68,"tag":118,"props":4650,"children":4651},{"style":188},[4652],{"type":74,"value":300},{"type":68,"tag":118,"props":4654,"children":4655},{"style":188},[4656],{"type":74,"value":212},{"type":68,"tag":118,"props":4658,"children":4659},{"style":131},[4660],{"type":74,"value":4661},"data",{"type":68,"tag":118,"props":4663,"children":4664},{"style":188},[4665],{"type":74,"value":221},{"type":68,"tag":118,"props":4667,"children":4668},{"style":188},[4669],{"type":74,"value":202},{"type":68,"tag":118,"props":4671,"children":4672},{"style":194},[4673],{"type":74,"value":377},{"type":68,"tag":118,"props":4675,"children":4676},{"style":188},[4677],{"type":74,"value":226},{"type":68,"tag":118,"props":4679,"children":4680},{"class":120,"line":288},[4681,4686,4690,4694,4698,4702,4707,4711,4715,4720,4724,4728,4732,4737,4741,4746],{"type":68,"tag":118,"props":4682,"children":4683},{"style":182},[4684],{"type":74,"value":4685},"for",{"type":68,"tag":118,"props":4687,"children":4688},{"style":182},[4689],{"type":74,"value":261},{"type":68,"tag":118,"props":4691,"children":4692},{"style":194},[4693],{"type":74,"value":648},{"type":68,"tag":118,"props":4695,"children":4696},{"style":243},[4697],{"type":74,"value":246},{"type":68,"tag":118,"props":4699,"children":4700},{"style":194},[4701],{"type":74,"value":1543},{"type":68,"tag":118,"props":4703,"children":4704},{"style":188},[4705],{"type":74,"value":4706},"of",{"type":68,"tag":118,"props":4708,"children":4709},{"style":194},[4710],{"type":74,"value":322},{"type":68,"tag":118,"props":4712,"children":4713},{"style":188},[4714],{"type":74,"value":98},{"type":68,"tag":118,"props":4716,"children":4717},{"style":272},[4718],{"type":74,"value":4719},"subscribeToRun",{"type":68,"tag":118,"props":4721,"children":4722},{"style":188},[4723],{"type":74,"value":1126},{"type":68,"tag":118,"props":4725,"children":4726},{"style":194},[4727],{"type":74,"value":978},{"type":68,"tag":118,"props":4729,"children":4730},{"style":188},[4731],{"type":74,"value":678},{"type":68,"tag":118,"props":4733,"children":4734},{"style":194},[4735],{"type":74,"value":4736},"(handle",{"type":68,"tag":118,"props":4738,"children":4739},{"style":188},[4740],{"type":74,"value":98},{"type":68,"tag":118,"props":4742,"children":4743},{"style":194},[4744],{"type":74,"value":4745},"id)) ",{"type":68,"tag":118,"props":4747,"children":4748},{"style":188},[4749],{"type":74,"value":285},{"type":68,"tag":118,"props":4751,"children":4752},{"class":120,"line":367},[4753,4758,4762,4766,4770,4774,4778,4782,4786,4791,4795,4799,4803,4807,4811,4815,4819,4823],{"type":68,"tag":118,"props":4754,"children":4755},{"style":194},[4756],{"type":74,"value":4757},"  console",{"type":68,"tag":118,"props":4759,"children":4760},{"style":188},[4761],{"type":74,"value":98},{"type":68,"tag":118,"props":4763,"children":4764},{"style":272},[4765],{"type":74,"value":3277},{"type":68,"tag":118,"props":4767,"children":4768},{"style":292},[4769],{"type":74,"value":280},{"type":68,"tag":118,"props":4771,"children":4772},{"style":194},[4773],{"type":74,"value":737},{"type":68,"tag":118,"props":4775,"children":4776},{"style":188},[4777],{"type":74,"value":98},{"type":68,"tag":118,"props":4779,"children":4780},{"style":194},[4781],{"type":74,"value":1510},{"type":68,"tag":118,"props":4783,"children":4784},{"style":188},[4785],{"type":74,"value":98},{"type":68,"tag":118,"props":4787,"children":4788},{"style":194},[4789],{"type":74,"value":4790},"some",{"type":68,"tag":118,"props":4792,"children":4793},{"style":188},[4794],{"type":74,"value":499},{"type":68,"tag":118,"props":4796,"children":4797},{"style":194},[4798],{"type":74,"value":570},{"type":68,"tag":118,"props":4800,"children":4801},{"style":188},[4802],{"type":74,"value":98},{"type":68,"tag":118,"props":4804,"children":4805},{"style":194},[4806],{"type":74,"value":1518},{"type":68,"tag":118,"props":4808,"children":4809},{"style":188},[4810],{"type":74,"value":1329},{"type":68,"tag":118,"props":4812,"children":4813},{"style":194},[4814],{"type":74,"value":4790},{"type":68,"tag":118,"props":4816,"children":4817},{"style":292},[4818],{"type":74,"value":377},{"type":68,"tag":118,"props":4820,"children":4821},{"style":188},[4822],{"type":74,"value":531},{"type":68,"tag":118,"props":4824,"children":4825},{"style":142},[4826],{"type":74,"value":4827}," \u002F\u002F typed\n",{"type":68,"tag":118,"props":4829,"children":4830},{"class":120,"line":637},[4831],{"type":68,"tag":118,"props":4832,"children":4833},{"style":188},[4834],{"type":74,"value":839},{"type":68,"tag":77,"props":4836,"children":4837},{},[4838,4844],{"type":68,"tag":83,"props":4839,"children":4841},{"className":4840},[],[4842],{"type":74,"value":4843},"runs.subscribeToRun",{"type":74,"value":4845}," completes when the run finishes, so the loop exits on its own.",{"type":68,"tag":100,"props":4847,"children":4849},{"id":4848},"common-mistakes",[4850],{"type":74,"value":4851},"Common mistakes",{"type":68,"tag":4853,"props":4854,"children":4855},"ol",{},[4856,4903,4937,4997,5041,5086],{"type":68,"tag":4857,"props":4858,"children":4859},"li",{},[4860,4866,4868,4873,4875],{"type":68,"tag":4861,"props":4862,"children":4863},"strong",{},[4864],{"type":74,"value":4865},"CRITICAL: Triggering from the browser with a Public Access Token.",{"type":74,"value":4867}," The\nread token from ",{"type":68,"tag":83,"props":4869,"children":4871},{"className":4870},[],[4872],{"type":74,"value":275},{"type":74,"value":4874}," cannot trigger tasks.",{"type":68,"tag":4876,"props":4877,"children":4878},"ul",{},[4879,4890],{"type":68,"tag":4857,"props":4880,"children":4881},{},[4882,4884],{"type":74,"value":4883},"Wrong: ",{"type":68,"tag":83,"props":4885,"children":4887},{"className":4886},[],[4888],{"type":74,"value":4889},"useTaskTrigger(\"my-task\", { accessToken: publicAccessTokenFromCreatePublicToken })",{"type":68,"tag":4857,"props":4891,"children":4892},{},[4893,4895,4901],{"type":74,"value":4894},"Correct: mint a single-use Trigger Token with ",{"type":68,"tag":83,"props":4896,"children":4898},{"className":4897},[],[4899],{"type":74,"value":4900},"auth.createTriggerPublicToken(\"my-task\")",{"type":74,"value":4902}," and pass that.",{"type":68,"tag":4857,"props":4904,"children":4905},{},[4906,4911,4913],{"type":68,"tag":4861,"props":4907,"children":4908},{},[4909],{"type":74,"value":4910},"Token with no scopes.",{"type":74,"value":4912}," A scopeless token authorizes nothing, so every subscribe 403s.",{"type":68,"tag":4876,"props":4914,"children":4915},{},[4916,4926],{"type":68,"tag":4857,"props":4917,"children":4918},{},[4919,4920],{"type":74,"value":4883},{"type":68,"tag":83,"props":4921,"children":4923},{"className":4922},[],[4924],{"type":74,"value":4925},"await auth.createPublicToken()",{"type":68,"tag":4857,"props":4927,"children":4928},{},[4929,4931],{"type":74,"value":4930},"Correct: ",{"type":68,"tag":83,"props":4932,"children":4934},{"className":4933},[],[4935],{"type":74,"value":4936},"await auth.createPublicToken({ scopes: { read: { runs: [\"run_1234\"] } } })",{"type":68,"tag":4857,"props":4938,"children":4939},{},[4940,4953,4955,4960,4962,4968,4970],{"type":68,"tag":4861,"props":4941,"children":4942},{},[4943,4945,4951],{"type":74,"value":4944},"Polling with ",{"type":68,"tag":83,"props":4946,"children":4948},{"className":4947},[],[4949],{"type":74,"value":4950},"useRun",{"type":74,"value":4952},"\u002FSWR for live updates.",{"type":74,"value":4954}," ",{"type":68,"tag":83,"props":4956,"children":4958},{"className":4957},[],[4959],{"type":74,"value":4950},{"type":74,"value":4961}," is the SWR-based\nmanagement-API hook (not recommended for live state); set ",{"type":68,"tag":83,"props":4963,"children":4965},{"className":4964},[],[4966],{"type":74,"value":4967},"refreshInterval: 0",{"type":74,"value":4969},"\nto stop polling if you do use it.",{"type":68,"tag":4876,"props":4971,"children":4972},{},[4973,4985],{"type":68,"tag":4857,"props":4974,"children":4975},{},[4976,4977,4983],{"type":74,"value":4883},{"type":68,"tag":83,"props":4978,"children":4980},{"className":4979},[],[4981],{"type":74,"value":4982},"useRun(runId, { refreshInterval: 1000 })",{"type":74,"value":4984}," to track progress",{"type":68,"tag":4857,"props":4986,"children":4987},{},[4988,4989,4995],{"type":74,"value":4930},{"type":68,"tag":83,"props":4990,"children":4992},{"className":4991},[],[4993],{"type":74,"value":4994},"useRealtimeRun(runId, { accessToken })",{"type":74,"value":4996}," (no polling, no WebSocket setup)",{"type":68,"tag":4857,"props":4998,"children":4999},{},[5000,5012,5014],{"type":68,"tag":4861,"props":5001,"children":5002},{},[5003,5005,5011],{"type":74,"value":5004},"Forgetting ",{"type":68,"tag":83,"props":5006,"children":5008},{"className":5007},[],[5009],{"type":74,"value":5010},"\"use client\"",{"type":74,"value":98},{"type":74,"value":5013}," Realtime\u002Ftrigger hooks cannot run in a server component.",{"type":68,"tag":4876,"props":5015,"children":5016},{},[5017,5028],{"type":68,"tag":4857,"props":5018,"children":5019},{},[5020,5022],{"type":74,"value":5021},"Wrong: a Next.js App Router server component using ",{"type":68,"tag":83,"props":5023,"children":5025},{"className":5024},[],[5026],{"type":74,"value":5027},"useRealtimeRun",{"type":68,"tag":4857,"props":5029,"children":5030},{},[5031,5033,5039],{"type":74,"value":5032},"Correct: put ",{"type":68,"tag":83,"props":5034,"children":5036},{"className":5035},[],[5037],{"type":74,"value":5038},"\"use client\";",{"type":74,"value":5040}," at the top of any component using these hooks.",{"type":68,"tag":4857,"props":5042,"children":5043},{},[5044,5062],{"type":68,"tag":4861,"props":5045,"children":5046},{},[5047,5049,5054,5055,5060],{"type":74,"value":5048},"Shipping ",{"type":68,"tag":83,"props":5050,"children":5052},{"className":5051},[],[5053],{"type":74,"value":1510},{"type":74,"value":1512},{"type":68,"tag":83,"props":5056,"children":5058},{"className":5057},[],[5059],{"type":74,"value":1518},{"type":74,"value":5061}," you do not render.",{"type":68,"tag":4876,"props":5063,"children":5064},{},[5065,5076],{"type":68,"tag":4857,"props":5066,"children":5067},{},[5068,5069,5074],{"type":74,"value":4883},{"type":68,"tag":83,"props":5070,"children":5072},{"className":5071},[],[5073],{"type":74,"value":4994},{"type":74,"value":5075}," for a status badge (large payloads over the wire)",{"type":68,"tag":4857,"props":5077,"children":5078},{},[5079,5080],{"type":74,"value":4930},{"type":68,"tag":83,"props":5081,"children":5083},{"className":5082},[],[5084],{"type":74,"value":5085},"useRealtimeRun(runId, { accessToken, skipColumns: [\"payload\", \"output\"] })",{"type":68,"tag":4857,"props":5087,"children":5088},{},[5089,5094],{"type":68,"tag":4861,"props":5090,"children":5091},{},[5092],{"type":74,"value":5093},"Subscribing before the handle exists.",{"type":68,"tag":4876,"props":5095,"children":5096},{},[5097,5109],{"type":68,"tag":4857,"props":5098,"children":5099},{},[5100,5101,5107],{"type":74,"value":4883},{"type":68,"tag":83,"props":5102,"children":5104},{"className":5103},[],[5105],{"type":74,"value":5106},"useRealtimeRun(handle, { accessToken: handle?.publicAccessToken })",{"type":74,"value":5108}," with no guard",{"type":68,"tag":4857,"props":5110,"children":5111},{},[5112,5114,5120],{"type":74,"value":5113},"Correct: add ",{"type":68,"tag":83,"props":5115,"children":5117},{"className":5116},[],[5118],{"type":74,"value":5119},"enabled: !!handle",{"type":74,"value":5121}," so it subscribes only once the trigger returns a handle.",{"type":68,"tag":100,"props":5123,"children":5125},{"id":5124},"references",[5126],{"type":74,"value":5127},"References",{"type":68,"tag":77,"props":5129,"children":5130},{},[5131],{"type":74,"value":5132},"Sibling skills:",{"type":68,"tag":4876,"props":5134,"children":5135},{},[5136,5169],{"type":68,"tag":4857,"props":5137,"children":5138},{},[5139,5145,5147,5153,5154,5160,5162,5168],{"type":68,"tag":83,"props":5140,"children":5142},{"className":5141},[],[5143],{"type":74,"value":5144},"trigger-authoring-tasks",{"type":74,"value":5146}," for the task side: ",{"type":68,"tag":83,"props":5148,"children":5150},{"className":5149},[],[5151],{"type":74,"value":5152},"streams.define()",{"type":74,"value":1669},{"type":68,"tag":83,"props":5155,"children":5157},{"className":5156},[],[5158],{"type":74,"value":5159},"metadata.set()",{"type":74,"value":5161},", and ",{"type":68,"tag":83,"props":5163,"children":5165},{"className":5164},[],[5166],{"type":74,"value":5167},"wait.createToken",{"type":74,"value":98},{"type":68,"tag":4857,"props":5170,"children":5171},{},[5172,5178,5180,5186],{"type":68,"tag":83,"props":5173,"children":5175},{"className":5174},[],[5176],{"type":74,"value":5177},"trigger-authoring-chat-agent",{"type":74,"value":5179}," and ",{"type":68,"tag":83,"props":5181,"children":5183},{"className":5182},[],[5184],{"type":74,"value":5185},"trigger-chat-agent-advanced",{"type":74,"value":5187}," for chat agents, which build on these realtime streams.",{"type":68,"tag":77,"props":5189,"children":5190},{},[5191,5193,5199,5201,5207],{"type":74,"value":5192},"Reference docs ship beside this skill in the same package, read them locally (no network), pinned to your installed version. The ",{"type":68,"tag":83,"props":5194,"children":5196},{"className":5195},[],[5197],{"type":74,"value":5198},"sources:",{"type":74,"value":5200}," frontmatter above lists every doc this skill draws from, all under ",{"type":68,"tag":83,"props":5202,"children":5204},{"className":5203},[],[5205],{"type":74,"value":5206},"@trigger.dev\u002Fsdk\u002Fdocs\u002F",{"type":74,"value":5208},". Start with:",{"type":68,"tag":4876,"props":5210,"children":5211},{},[5212,5221,5230,5239],{"type":68,"tag":4857,"props":5213,"children":5214},{},[5215],{"type":68,"tag":83,"props":5216,"children":5218},{"className":5217},[],[5219],{"type":74,"value":5220},"@trigger.dev\u002Fsdk\u002Fdocs\u002Frealtime\u002Freact-hooks\u002Fsubscribe.mdx",{"type":68,"tag":4857,"props":5222,"children":5223},{},[5224],{"type":68,"tag":83,"props":5225,"children":5227},{"className":5226},[],[5228],{"type":74,"value":5229},"@trigger.dev\u002Fsdk\u002Fdocs\u002Frealtime\u002Freact-hooks\u002Fstreams.mdx",{"type":68,"tag":4857,"props":5231,"children":5232},{},[5233],{"type":68,"tag":83,"props":5234,"children":5236},{"className":5235},[],[5237],{"type":74,"value":5238},"@trigger.dev\u002Fsdk\u002Fdocs\u002Frealtime\u002Fauth.mdx",{"type":68,"tag":4857,"props":5240,"children":5241},{},[5242,5248,5250,5255],{"type":68,"tag":83,"props":5243,"children":5245},{"className":5244},[],[5246],{"type":74,"value":5247},"@trigger.dev\u002Fsdk\u002Fdocs\u002Frealtime\u002Frun-object.mdx",{"type":74,"value":5249}," (the realtime run object differs from the management-API object returned by ",{"type":68,"tag":83,"props":5251,"children":5253},{"className":5252},[],[5254],{"type":74,"value":4950},{"type":74,"value":377},{"type":68,"tag":100,"props":5257,"children":5259},{"id":5258},"version",[5260],{"type":74,"value":5261},"Version",{"type":68,"tag":77,"props":5263,"children":5264},{},[5265,5267,5272,5274,5280,5282,5288,5290,5295],{"type":74,"value":5266},"This skill is bundled inside ",{"type":68,"tag":83,"props":5268,"children":5270},{"className":5269},[],[5271],{"type":74,"value":96},{"type":74,"value":5273}," and read directly from ",{"type":68,"tag":83,"props":5275,"children":5277},{"className":5276},[],[5278],{"type":74,"value":5279},"node_modules",{"type":74,"value":5281},", so it always matches your installed SDK version (see the adjacent ",{"type":68,"tag":83,"props":5283,"children":5285},{"className":5284},[],[5286],{"type":74,"value":5287},"package.json",{"type":74,"value":5289},"). The full documentation for these APIs ships alongside it under ",{"type":68,"tag":83,"props":5291,"children":5293},{"className":5292},[],[5294],{"type":74,"value":5206},{"type":74,"value":98},{"type":68,"tag":5297,"props":5298,"children":5299},"style",{},[5300],{"type":74,"value":5301},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":5303,"total":239},[5304,5319,5331,5340],{"slug":5177,"name":5177,"fn":5305,"description":5306,"org":5307,"tags":5308,"stars":24,"repoUrl":25,"updatedAt":5318},"author durable AI chat agents with Trigger.dev","Author and run a durable AI chat agent with chat.agent from @trigger.dev\u002Fsdk\u002Fai: the per-turn run loop, why you MUST spread ...chat.toStreamTextOptions() first, returning a StreamTextResult vs calling chat.pipe(), the two server actions (chat.createStartSessionAction + auth.createPublicToken), and wiring useChat to useTriggerChatTransport. Load this when building, modifying, or debugging a chat backend (the agent task or its lifecycle hooks) or its React transport, when declaring typed tools or custom data parts, or when migrating a plain AI SDK streamText route to chat.agent.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5309,5312,5315,5316],{"name":5310,"slug":5311,"type":16},"Agents","agents",{"name":5313,"slug":5314,"type":16},"SDK","sdk",{"name":9,"slug":8,"type":16},{"name":5317,"slug":41,"type":16},"Workflow Automation","2026-07-02T17:12:52.307135",{"slug":5144,"name":5144,"fn":5320,"description":5321,"org":5322,"tags":5323,"stars":24,"repoUrl":25,"updatedAt":5330},"author backend Trigger.dev tasks","Covers writing backend Trigger.dev tasks with @trigger.dev\u002Fsdk: defining task() and schemaTask(), the run function and its ctx, retries, waits, queues and concurrency, idempotency keys, run metadata, logging, triggering other tasks (and the Result shape), scheduled\u002Fcron tasks, and the essentials of trigger.config.ts. Load this whenever you are authoring or editing code inside a \u002Ftrigger directory, defining a task, or writing backend code that triggers tasks. Realtime\u002FReact hooks and AI chat are covered by separate skills.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5324,5327,5328,5329],{"name":5325,"slug":5326,"type":16},"Backend","backend",{"name":5313,"slug":5314,"type":16},{"name":9,"slug":8,"type":16},{"name":5317,"slug":41,"type":16},"2026-07-02T17:12:48.396964",{"slug":5185,"name":5185,"fn":5332,"description":5333,"org":5334,"tags":5335,"stars":24,"repoUrl":25,"updatedAt":5339},"manage Trigger.dev chat sessions and transports","Advanced and operational chat.agent capabilities for Trigger.dev, loaded on demand. Load this when working on the raw Sessions primitive (sessions \u002F SessionHandle), a custom chat transport or the realtime wire protocol, durable sub-agents (AgentChat, chat.stream.writer), human-in-the-loop, steering, actions, background injection (chat.defer \u002F chat.inject), fast starts (preload, Head Start via @trigger.dev\u002Fsdk\u002Fchat-server), context resilience (compaction, recovery boot, OOM, large payloads), chat.local run-scoped state, offline testing with mockChatAgent, or prerelease\u002Fversion upgrades. For the everyday chat.agent({...}) definition and the useTriggerChatTransport happy path, use the trigger-authoring-chat-agent skill instead.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5336,5337,5338],{"name":5310,"slug":5311,"type":16},{"name":9,"slug":8,"type":16},{"name":5317,"slug":41,"type":16},"2026-07-02T17:12:51.03018",{"slug":4,"name":4,"fn":5,"description":6,"org":5341,"tags":5342,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5343,5344,5345,5346],{"name":22,"slug":23,"type":16},{"name":14,"slug":15,"type":16},{"name":19,"slug":20,"type":16},{"name":9,"slug":8,"type":16},{"items":5348,"total":5487},[5349,5356,5363,5369,5376,5391,5405,5422,5435,5447,5458,5472],{"slug":5177,"name":5177,"fn":5305,"description":5306,"org":5350,"tags":5351,"stars":24,"repoUrl":25,"updatedAt":5318},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5352,5353,5354,5355],{"name":5310,"slug":5311,"type":16},{"name":5313,"slug":5314,"type":16},{"name":9,"slug":8,"type":16},{"name":5317,"slug":41,"type":16},{"slug":5144,"name":5144,"fn":5320,"description":5321,"org":5357,"tags":5358,"stars":24,"repoUrl":25,"updatedAt":5330},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5359,5360,5361,5362],{"name":5325,"slug":5326,"type":16},{"name":5313,"slug":5314,"type":16},{"name":9,"slug":8,"type":16},{"name":5317,"slug":41,"type":16},{"slug":5185,"name":5185,"fn":5332,"description":5333,"org":5364,"tags":5365,"stars":24,"repoUrl":25,"updatedAt":5339},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5366,5367,5368],{"name":5310,"slug":5311,"type":16},{"name":9,"slug":8,"type":16},{"name":5317,"slug":41,"type":16},{"slug":4,"name":4,"fn":5,"description":6,"org":5370,"tags":5371,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5372,5373,5374,5375],{"name":22,"slug":23,"type":16},{"name":14,"slug":15,"type":16},{"name":19,"slug":20,"type":16},{"name":9,"slug":8,"type":16},{"slug":5377,"name":5377,"fn":5378,"description":5379,"org":5380,"tags":5381,"stars":5388,"repoUrl":5389,"updatedAt":5390},"trigger-agents","orchestrate AI agents with Trigger.dev","AI agent patterns with Trigger.dev - orchestration, parallelization, routing, evaluator-optimizer, and human-in-the-loop. Use when building LLM-powered tasks that need parallel workers, approval gates, tool calling, or multi-step agent workflows.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5382,5383,5386,5387],{"name":5310,"slug":5311,"type":16},{"name":5384,"slug":5385,"type":16},"Multi-Agent","multi-agent",{"name":9,"slug":8,"type":16},{"name":5317,"slug":41,"type":16},30,"https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Fskills","2026-04-06T18:54:46.023553",{"slug":5392,"name":5392,"fn":5393,"description":5394,"org":5395,"tags":5396,"stars":5388,"repoUrl":5389,"updatedAt":5404},"trigger-config","configure Trigger.dev project settings","Configure Trigger.dev projects with trigger.config.ts. Use when setting up build extensions for Prisma, Playwright, FFmpeg, Python, or customizing deployment settings.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5397,5400,5403],{"name":5398,"slug":5399,"type":16},"Configuration","configuration",{"name":5401,"slug":5402,"type":16},"Deployment","deployment",{"name":9,"slug":8,"type":16},"2026-04-06T18:54:44.764258",{"slug":5406,"name":5406,"fn":5407,"description":5408,"org":5409,"tags":5410,"stars":5388,"repoUrl":5389,"updatedAt":5421},"trigger-cost-savings","optimize Trigger.dev task costs","Analyze Trigger.dev tasks, schedules, and runs for cost optimization opportunities. Use when asked to reduce spend, optimize costs, audit usage, right-size machines, or review task efficiency. Requires Trigger.dev MCP tools for run analysis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5411,5414,5417,5420],{"name":5412,"slug":5413,"type":16},"Analytics","analytics",{"name":5415,"slug":5416,"type":16},"Cost Optimization","cost-optimization",{"name":5418,"slug":5419,"type":16},"Operations","operations",{"name":9,"slug":8,"type":16},"2026-04-06T18:54:48.555552",{"slug":5423,"name":5423,"fn":5424,"description":5425,"org":5426,"tags":5427,"stars":5388,"repoUrl":5389,"updatedAt":5434},"trigger-realtime","monitor Trigger.dev tasks in real-time","Subscribe to Trigger.dev task runs in real-time from frontend and backend. Use when building progress indicators, live dashboards, streaming AI\u002FLLM responses, or React components that display task status.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5428,5429,5432,5433],{"name":22,"slug":23,"type":16},{"name":5430,"slug":5431,"type":16},"Observability","observability",{"name":19,"slug":20,"type":16},{"name":9,"slug":8,"type":16},"2026-04-06T18:54:47.293822",{"slug":5436,"name":5436,"fn":5437,"description":5438,"org":5439,"tags":5440,"stars":5388,"repoUrl":5389,"updatedAt":5446},"trigger-setup","set up Trigger.dev in projects","Set up Trigger.dev in your project. Use when adding Trigger.dev for the first time, creating trigger.config.ts, or initializing the trigger directory.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5441,5442,5445],{"name":5398,"slug":5399,"type":16},{"name":5443,"slug":5444,"type":16},"Local Development","local-development",{"name":9,"slug":8,"type":16},"2026-04-06T18:54:42.280816",{"slug":5448,"name":5448,"fn":5449,"description":5450,"org":5451,"tags":5452,"stars":5388,"repoUrl":5389,"updatedAt":5457},"trigger-tasks","build durable background tasks with Trigger.dev","Build AI agents, workflows and durable background tasks with Trigger.dev. Use when creating tasks, triggering jobs, handling retries, scheduling cron jobs, or implementing queues and concurrency control.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5453,5454,5455,5456],{"name":5310,"slug":5311,"type":16},{"name":5325,"slug":5326,"type":16},{"name":9,"slug":8,"type":16},{"name":5317,"slug":41,"type":16},"2026-04-06T18:54:43.514369",{"slug":5459,"name":5459,"fn":5460,"description":5461,"org":5462,"tags":5463,"stars":229,"repoUrl":5470,"updatedAt":5471},"staff-engineering-skills-backpressure","implement backpressure in streaming pipelines","Prevent unbounded resource growth when producers outpace consumers. Use when writing producer-consumer code, queue processing, batch operations, fan-out patterns, streaming pipelines, or any code where work is generated faster than it can be processed. Activates on patterns like Promise.all on dynamic-sized arrays, unbounded in-memory queues, producer loops without depth checks, fire-and-forget async calls in loops, or any buffer between a producer and consumer without a size limit.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5464,5467],{"name":5465,"slug":5466,"type":16},"Architecture","architecture",{"name":5468,"slug":5469,"type":16},"Performance","performance","https:\u002F\u002Fgithub.com\u002Ftriggerdotdev\u002Fstaff-engineering-skills","2026-06-17T08:40:42.723559",{"slug":5473,"name":5473,"fn":5474,"description":5475,"org":5476,"tags":5477,"stars":229,"repoUrl":5470,"updatedAt":5486},"staff-engineering-skills-cache-invalidation","implement cache invalidation strategies","Prevent stale data bugs caused by missing or incomplete cache invalidation. Use when adding caching layers (Redis, in-memory Map, CDN, HTTP cache headers), optimizing read performance, or reviewing code that caches query results, API responses, or computed values. Activates on patterns like cache.set without cache.delete on write paths, unbounded Map\u002Fobject caches, TTL-only invalidation on security-sensitive data, Cache-Control headers on mutable content, or any caching where the write path doesn't invalidate the read cache.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5478,5479,5482,5485],{"name":5465,"slug":5466,"type":16},{"name":5480,"slug":5481,"type":16},"Caching","caching",{"name":5483,"slug":5484,"type":16},"Engineering","engineering",{"name":5468,"slug":5469,"type":16},"2026-06-17T08:40:45.194583",26]