[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-inngest-inngest-realtime":3,"mdc--3zod39-key":41,"related-org-inngest-inngest-realtime":8568,"related-repo-inngest-inngest-realtime":8732},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":36,"sourceUrl":39,"mdContent":40},"inngest-realtime","stream durable workflow updates to UI","Use when streaming durable workflow updates to a UI in real time — live order status pages that animate as steps complete, AI agent token streaming from a function to the browser, log tailing for long-running jobs, or human-in-the-loop approval flows that publish a prompt and wait for a user reply. Covers Inngest v4 native realtime: defining typed channels, publishing from inside step.run, minting subscription tokens via server actions, and consuming the stream from React\u002FNext.js client components.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"inngest","Inngest","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Finngest.png",[12,16,17,20],{"name":13,"slug":14,"type":15},"Automation","automation","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"Real-time","real-time",{"name":21,"slug":22,"type":15},"Frontend","frontend",26,"https:\u002F\u002Fgithub.com\u002Finngest\u002Finngest-skills","2026-07-12T07:36:48.895092",null,5,[29,30,31,32,33,34,35],"agent-skill-repository","agent-skills","agentic-skills","ai-agents","claude-code-skills","cursor-skills","openclaw-skills",{"repoUrl":24,"stars":23,"forks":27,"topics":37,"description":38},[29,30,31,32,33,34,35],"Agent Skills for building with Inngest","https:\u002F\u002Fgithub.com\u002Finngest\u002Finngest-skills\u002Ftree\u002FHEAD\u002Fskills\u002Finngest-realtime","---\nname: inngest-realtime\ndescription: \"Use when streaming durable workflow updates to a UI in real time — live order status pages that animate as steps complete, AI agent token streaming from a function to the browser, log tailing for long-running jobs, or human-in-the-loop approval flows that publish a prompt and wait for a user reply. Covers Inngest v4 native realtime: defining typed channels, publishing from inside step.run, minting subscription tokens via server actions, and consuming the stream from React\u002FNext.js client components.\"\n---\n\n# Inngest Realtime\n\nStream updates from durable Inngest functions to live UIs. Use channels and topics to broadcast progress, render workflow execution as it happens, or build bi-directional human-in-the-loop flows.\n\n> **These skills are focused on TypeScript.** For Python or Go, refer to the [Inngest documentation](https:\u002F\u002Fwww.inngest.com\u002Fllms.txt) for language-specific guidance. Core concepts apply across all languages.\n\n> **⚠ CRITICAL: v3 vs v4 package selection**\n>\n> Realtime in Inngest v4 lives at the SDK subpath `inngest\u002Frealtime`. The standalone `@inngest\u002Frealtime` npm package is a **v3-era package** and is **NOT compatible with `inngest@4.x`**. If your project is on v4 (the npm default), do not install `@inngest\u002Frealtime`. Use the imports below.\n>\n> Symptoms of using the wrong package on v4: `TypeError: Cls is not a constructor` on every `PUT \u002Fapi\u002Finngest`, 401 on subscription tokens, type incompatibility on `new Inngest({ middleware: [...] })`. Verify your `package.json` shows `\"inngest\": \"^4.x\"` before reading further.\n\n## Prerequisites\n\n- Inngest v4 SDK installed (`npm install inngest`) — see the `inngest-setup` skill\n- `INNGEST_DEV=1` set in `.env.local` for local development (without it, the SDK demands cloud signing keys and 401s on token requests)\n- Local Inngest dev server running (`npx inngest-cli@latest dev`)\n- Optional: `zod` for schema validation on topics\n\n## When to use Realtime\n\n| Problem shape | Pattern |\n|---|---|\n| Order status page animates as durable workflow steps complete | Per-run channel, publish per step, client subscribes |\n| AI agent streams tokens to a chat UI | Per-conversation channel, publish chunks, stream to browser |\n| Log tail for a long-running job | Single channel, log topic, append to UI |\n| Human-in-the-loop approval | Channel + waitForEvent, publish prompt, wait for response |\n| Admin dashboard with live order list | Global admin channel, fan-out from each function |\n\n## Architecture\n\nThree pieces:\n\n1. **Channel definition** — a typed contract for what gets published. Lives in shared module so both server and client can reference the same channel name.\n2. **Publishing** — call `step.realtime.publish` between steps to wrap a durable publish, or `inngest.realtime.publish` inside `step.run` because you're already inside a memoized step. See \"Which publish method to use\" below.\n3. **Subscribing** — server action mints a subscription token; React client uses the `useRealtime` hook (or the lower-level `subscribe()` API for non-React consumers).\n\n## Step 1: Define a channel\n\nChannels are pure data — no class hierarchy, no zod runtime required (but recommended for type safety). Define them once and import where needed.\n\n```typescript\n\u002F\u002F src\u002Finngest\u002Fchannels.ts\nimport { channel } from 'inngest\u002Frealtime';\nimport { z } from 'zod';\n\n\u002F\u002F Per-run channel: each fulfill-order run publishes step updates to its own channel.\nexport const orderChannel = channel({\n  name: (orderId: string) => `order:${orderId}`,\n  topics: {\n    step: {\n      schema: z.object({\n        name: z.string(),\n        status: z.enum(['running', 'complete', 'failed']),\n        output: z.record(z.string(), z.unknown()).optional(),\n        ts: z.number(),\n      }),\n    },\n  },\n});\n\n\u002F\u002F Global admin channel: fan-out for cross-cutting visibility.\nexport const adminChannel = channel({\n  name: 'admin',\n  topics: {\n    order: {\n      schema: z.object({\n        orderId: z.string(),\n        step: z.string(),\n        status: z.enum(['running', 'complete', 'failed']),\n        ts: z.number(),\n      }),\n    },\n  },\n});\n```\n\n**Two channel name shapes:**\n- `name: 'admin'` — static channel, accessed as `adminChannel.order` (topic ref)\n- `name: (id) => 'channel:${id}'` — parametric, accessed as `orderChannel(id).step` (call the channel def with the id, then access topic)\n\n## Step 2: Publish from inside a function\n\nInngest v4 ships realtime support natively — **no middleware required.** But where you call `publish` matters: it determines whether the publish is durable, and it's the most common place to get realtime wrong.\n\n### Which publish method to use\n\n| Where you are | Use this | Why |\n|---|---|---|\n| **Outside a step** (top-level handler code, between `step.run` calls) | `step.realtime.publish(id, topicRef, data)` | Wraps the publish in its own step so it's durable, deduplicated by `id`, and retry-safe. |\n| **Inside a step** (inside the callback passed to `step.run`) | `inngest.realtime.publish(topicRef, data)` | You're already inside a memoized step. `step.realtime.publish` would create a step inside a step. The bare client publish is the right call here. |\n| **Outside a function** (one-off route, script, etc.) | `inngest.realtime.publish(topicRef, data)` | Allowed, but **not retry-safe** — your client receiver must handle duplicates. |\n\nThe 90% rule: if you're writing handler code and you reach for `publish`, use `step.realtime.publish`. If you're writing code inside a `step.run` block and you reach for `publish`, use `inngest.realtime.publish`.\n\n### Example: both patterns in one function\n\n```typescript\n\u002F\u002F src\u002Finngest\u002Ffunctions\u002Ffulfill-order.ts\nimport { inngest } from '..\u002Fclient';\nimport { orderChannel, adminChannel } from '..\u002Fchannels';\n\nexport const fulfillOrder = inngest.createFunction(\n  {\n    id: 'fulfill-order',\n    retries: 3,\n    triggers: [{ event: 'store\u002Forder.placed' }],\n  },\n  async ({ event, step }) => {\n    const { orderId, customerEmail, lineItems } = event.data;\n\n    \u002F\u002F Outside any step.run — use step.realtime.publish for a durable wrapper.\n    const emit = async (\n      name: string,\n      status: 'running' | 'complete' | 'failed',\n      output?: Record\u003Cstring, unknown>,\n    ) => {\n      const ts = Date.now();\n      await step.realtime.publish(\n        `emit-order-${name}-${status}`,\n        orderChannel(orderId).step,\n        { name, status, output, ts },\n      );\n      await step.realtime.publish(\n        `emit-admin-${name}-${status}`,\n        adminChannel.order,\n        { orderId, step: name, status, ts },\n      );\n    };\n\n    await emit('capture-payment', 'running');\n\n    \u002F\u002F Inside step.run — use inngest.realtime.publish (already in a memoized step).\n    const payment = await step.run('capture-payment', async () => {\n      const intent = await stripe.paymentIntents.create({ \u002F* ... *\u002F });\n\n      \u002F\u002F Stream a partial update mid-step. No step-in-step wrapping needed.\n      await inngest.realtime.publish(orderChannel(orderId).step, {\n        name: 'capture-payment',\n        status: 'running',\n        output: { stage: 'intent-created', intentId: intent.id },\n        ts: Date.now(),\n      });\n\n      return await stripe.paymentIntents.confirm(intent.id);\n    });\n\n    await emit('capture-payment', 'complete', payment);\n\n    await emit('reserve-inventory', 'running');\n    const inventory = await step.run('reserve-inventory', async () => {\n      \u002F\u002F ...\n    });\n    await emit('reserve-inventory', 'complete', inventory);\n\n    \u002F\u002F ...\n  },\n);\n```\n\n**Why no middleware:** Earlier versions used `@inngest\u002Frealtime`'s `realtimeMiddleware()` to inject a `publish` arg into the handler. v4 puts it on `step.realtime` and `inngest.realtime` directly.\n\n## Step 3: Mint a subscription token (server action)\n\nIn Next.js App Router, use a Server Action to securely mint a short-lived token for the React hook in Step 4. Without a token, clients can't subscribe.\n\n```typescript\n\u002F\u002F src\u002Fapp\u002Forders\u002F[orderId]\u002Factions.ts\n'use server';\n\nimport { getClientSubscriptionToken } from 'inngest\u002Freact';\nimport { inngest } from '@\u002Finngest\u002Fclient';\nimport { orderChannel } from '@\u002Finngest\u002Fchannels';\n\nexport async function fetchOrderSubscriptionToken(orderId: string) {\n  \u002F\u002F ⚠ AUTHORIZATION GATE: verify the current user owns this orderId\n  \u002F\u002F before minting a token. Channels are addressable by ID, so without\n  \u002F\u002F an ownership check, anyone can subscribe to any order's stream by\n  \u002F\u002F guessing IDs.\n  \u002F\u002F\n  \u002F\u002F   const session = await getServerSession();\n  \u002F\u002F   if (!session) throw new Error('Unauthenticated');\n  \u002F\u002F   const order = await db.order.findUnique({ where: { id: orderId } });\n  \u002F\u002F   if (order?.userId !== session.userId) throw new Error('Forbidden');\n\n  return getClientSubscriptionToken(inngest, {\n    channel: orderChannel(orderId),\n    topics: ['step'],\n  });\n}\n```\n\n`getClientSubscriptionToken` from `inngest\u002Freact` returns a token shape that the `useRealtime` hook in Step 4 consumes directly. No ChannelInstance stripping needed — that gotcha only applies to the lower-level `getSubscriptionToken` + manual `subscribe()` path (see \"Pattern: Manual subscribe\" below).\n\n## Step 4: Subscribe with the `useRealtime` hook\n\nThe recommended consumer for React\u002FNext.js is the `useRealtime` hook from `inngest\u002Freact`. It handles the subscription lifecycle, reconnect, type narrowing per topic, and cleanup.\n\n```typescript\n\u002F\u002F src\u002Fcomponents\u002FOrderStatusClient.tsx\n'use client';\n\nimport { useRealtime } from 'inngest\u002Freact';\nimport { orderChannel } from '@\u002Finngest\u002Fchannels';\nimport { fetchOrderSubscriptionToken } from '@\u002Fapp\u002Forders\u002F[orderId]\u002Factions';\n\nexport function OrderStatusClient({ orderId }: { orderId: string }) {\n  const { messages, connectionStatus, error } = useRealtime({\n    channel: orderChannel(orderId),\n    topics: ['step'] as const,\n    token: () => fetchOrderSubscriptionToken(orderId),\n  });\n\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n\n  return (\n    \u003Cdiv>\n      \u003Cdiv>Status: {connectionStatus}\u003C\u002Fdiv>\n      \u003Cul>\n        {messages.all.map((m, i) => (\n          \u003Cli key={i}>\n            {(m.data as { name: string }).name}: {(m.data as { status: string }).status}\n          \u003C\u002Fli>\n        ))}\n      \u003C\u002Ful>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n**Useful options on the hook:**\n\n| Option | Default | Use it when |\n|---|---|---|\n| `enabled` | `true` | Delay the subscription until you have an ID (e.g., `enabled: !!runId`). |\n| `bufferInterval` | `0` | Batch updates from a fast stream so React doesn't re-render per message. |\n| `pauseOnHidden` | `false` | Pause the stream when the tab isn't visible (saves bandwidth). |\n| `autoCloseOnTerminal` | `true` | Disconnect when the run completes — turn off to keep the stream open for fan-out channels. |\n| `historyLimit` | unbounded | Cap how many messages are retained in `messages.all`. |\n\nThe hook returns `messages.byTopic` (latest per topic), `messages.all` (full history), `messages.last` (most recent), and `messages.delta` (new since last render).\n\n## Pattern: Manual subscribe (non-React or custom transport)\n\nThe `useRealtime` hook covers the React case. If you're not using React, or you need a custom subscription lifecycle (server-side streaming, background workers, custom protocols), use the lower-level `subscribe()` API directly.\n\n### Server action: mint a token with the lower-level helper\n\n```typescript\n\u002F\u002F src\u002Fapp\u002Forders\u002F[orderId]\u002Factions.ts\n'use server';\n\nimport { getSubscriptionToken } from 'inngest\u002Frealtime';\nimport { inngest } from '@\u002Finngest\u002Fclient';\nimport { orderChannel } from '@\u002Finngest\u002Fchannels';\n\nexport async function fetchOrderSubscriptionTokenLowLevel(orderId: string) {\n  \u002F\u002F ⚠ AUTHORIZATION GATE: same as Step 3 — verify ownership before minting.\n\n  const token = await getSubscriptionToken(inngest, {\n    channel: orderChannel(orderId),\n    topics: ['step'],\n  });\n\n  \u002F\u002F ⚠ CRITICAL: strip the ChannelInstance from the response.\n  \u002F\u002F getSubscriptionToken returns { channel: ChannelInstance, ... } where\n  \u002F\u002F ChannelInstance contains zod schema methods (a class with prototypes).\n  \u002F\u002F Next.js refuses to serialize classes across the server-action → client-component\n  \u002F\u002F boundary, so return ONLY primitives.\n  return {\n    channel: orderChannel(orderId).name as string,\n    topics: ['step'] as const,\n    key: token.key,\n    apiBaseUrl: token.apiBaseUrl,\n  };\n}\n```\n\n### Manual client subscription\n\n```typescript\n\u002F\u002F src\u002Fcomponents\u002FOrderStatusManual.tsx\n'use client';\n\nimport * as React from 'react';\nimport { subscribe } from 'inngest\u002Frealtime';\nimport { fetchOrderSubscriptionTokenLowLevel } from '@\u002Fapp\u002Forders\u002F[orderId]\u002Factions';\n\nexport function OrderStatusManual({ orderId }: { orderId: string }) {\n  const [messages, setMessages] = React.useState\u003Cunknown[]>([]);\n\n  React.useEffect(() => {\n    let cancelled = false;\n    let sub: { close?: (reason?: string) => void } | undefined;\n\n    (async () => {\n      const token = await fetchOrderSubscriptionTokenLowLevel(orderId);\n      if (cancelled) return;\n\n      sub = await subscribe(\n        {\n          channel: token.channel,\n          topics: [...token.topics],\n          key: token.key,\n          apiBaseUrl: token.apiBaseUrl,\n        },\n        (message) => {\n          if (cancelled) return;\n          setMessages((prev) => [...prev, message.data]);\n        },\n      );\n    })();\n\n    return () => {\n      cancelled = true;\n      sub?.close?.('unmount');\n    };\n  }, [orderId]);\n\n  \u002F\u002F ... render ...\n}\n```\n\n### SSE streaming from a route handler\n\nSubscribe inside a Next.js API route and pipe the stream to the client via SSE:\n\n```typescript\n\u002F\u002F src\u002Fapp\u002Fapi\u002Forders\u002F[orderId]\u002Fstream\u002Froute.ts\nimport { inngest } from '@\u002Finngest\u002Fclient';\nimport { subscribe } from 'inngest\u002Frealtime';\nimport { orderChannel } from '@\u002Finngest\u002Fchannels';\n\nexport async function GET(req: Request, { params }: { params: { orderId: string } }) {\n  \u002F\u002F ⚠ AUTHORIZATION GATE: same rule as the server-action token mint above.\n  \u002F\u002F Authenticate the request and confirm the caller owns params.orderId\n  \u002F\u002F before opening the SSE stream. Skipping this leaks every order's\n  \u002F\u002F step events to anyone with a URL.\n\n  const stream = await subscribe({\n    app: inngest,\n    channel: orderChannel(params.orderId),\n    topics: ['step'],\n  });\n\n  return new Response(stream.getEncodedStream(), {\n    headers: {\n      'Content-Type': 'text\u002Fevent-stream',\n      'Cache-Control': 'no-cache',\n      Connection: 'keep-alive',\n    },\n  });\n}\n```\n\nClient consumes via `fetch().getReader()` rather than the `subscribe()` callback. Use this when you want the SSE behavior or when the client-side `subscribe()` API doesn't fit your component lifecycle.\n\n## Pattern: Human-in-the-loop\n\nCombine `step.realtime.publish` with `step.waitForEvent`:\n\n```typescript\nimport crypto from 'crypto';\n\nexport const reviewWorkflow = inngest.createFunction(\n  { id: 'review-workflow', triggers: [{ event: 'review\u002Fstart' }] },\n  async ({ event, step }) => {\n    const confirmationId = await step.run('gen-id', () => crypto.randomUUID());\n\n    \u002F\u002F Publish a prompt — the client subscribes and renders an approval UI\n    await step.realtime.publish(\n      'publish-prompt',\n      reviewChannel.message,\n      { message: 'Confirm to proceed?', confirmationId },\n    );\n\n    \u002F\u002F Wait up to 15 minutes for the user to send the matching event back\n    const confirmation = await step.waitForEvent('await-confirmation', {\n      event: 'review\u002Fconfirmation',\n      timeout: '15m',\n      if: `async.data.confirmationId == \"${confirmationId}\"`,\n    });\n\n    if (!confirmation) {\n      \u002F\u002F user didn't respond — abort or escalate\n      return { decision: 'timed_out' };\n    }\n    \u002F\u002F continue workflow...\n  },\n);\n```\n\nThe `confirmationId` links the published prompt to the matching reply, so the workflow knows which response to act on.\n\n## Common pitfalls\n\n### Don't use `@inngest\u002Frealtime` on v4\n\nThe standalone `@inngest\u002Frealtime` package is for Inngest v3 only. On v4, all realtime APIs are in the SDK subpath `inngest\u002Frealtime`. Mixing them produces:\n- `TypeError: Cls is not a constructor` on `PUT \u002Fapi\u002Finngest` (v3 middleware class signature mismatch)\n- 401 Unauthorized on subscription tokens\n- TypeScript errors casting middleware\n\n**Verify with:** `grep '\"inngest\"' package.json` — if it's `^4.x`, use `inngest\u002Frealtime`. Period.\n\n### Don't return ChannelInstance from a Next.js server action (manual subscribe path only)\n\n`getSubscriptionToken` returns `{ channel: ChannelInstance, ... }` where ChannelInstance has zod schema methods (a class). Next.js refuses to serialize classes across the server-action → client-component boundary. Strip to primitives before returning. See \"Pattern: Manual subscribe\" above.\n\nThis gotcha does **not** apply when you use `getClientSubscriptionToken` from `inngest\u002Freact` (Step 3 — the recommended path). That helper returns a serialization-safe shape directly.\n\n### `INNGEST_DEV=1` is required for local dev\n\nWithout it, the SDK assumes cloud mode and demands `INNGEST_SIGNING_KEY` + `INNGEST_EVENT_KEY`. All realtime operations 401 \u002F 500. Add to `.env.local`. Hard restart the dev server (Next.js does not hot-reload `.env.local` changes).\n\n### Channel topic schemas validate on publish, not on consume\n\nIf your published payload doesn't match the zod schema, the publish fails server-side. Subscriber receives nothing. Catch publish errors during step execution, or run with `validate: false` in `subscribe()` if you have a reason to skip schema validation client-side.\n\n## Reference\n\n- v4 entry points:\n  - `import { channel } from 'inngest\u002Frealtime'` — channel definitions\n  - `import { useRealtime, getClientSubscriptionToken } from 'inngest\u002Freact'` — React hook + matching token helper (Step 3 + Step 4)\n  - `import { getSubscriptionToken, subscribe } from 'inngest\u002Frealtime'` — lower-level helpers for non-React or custom transport\n- Publish methods:\n  - **Outside a step:** `step.realtime.publish(id, topicRef, data)` — wraps in a durable step\n  - **Inside `step.run`:** `inngest.realtime.publish(topicRef, data)` — already inside a memoized step, no wrapping needed\n  - **Outside a function:** `inngest.realtime.publish(topicRef, data)` — allowed but not retry-safe\n- Subscribe overloads: `subscribe(token)` returns a stream; `subscribe(token, callback)` invokes callback per message\n- Next.js Server Action gotcha (manual path only): strip `ChannelInstance` → return `{ channel: string, topics, key, apiBaseUrl }`. Not needed with `getClientSubscriptionToken`.\n",{"data":42,"body":43},{"name":4,"description":6},{"type":44,"children":45},"root",[46,54,60,86,191,198,269,275,368,374,379,453,459,464,1442,1450,1491,1497,1517,1524,1666,1704,1710,3510,3558,3564,3569,3983,4023,4036,4055,4930,4938,5104,5140,5146,5165,5171,5737,5743,6754,6760,6765,7383,7410,7416,7435,8170,8181,8187,8200,8219,8249,8281,8287,8305,8330,8341,8376,8382,8402,8408,8562],{"type":47,"tag":48,"props":49,"children":50},"element","h1",{"id":4},[51],{"type":52,"value":53},"text","Inngest Realtime",{"type":47,"tag":55,"props":56,"children":57},"p",{},[58],{"type":52,"value":59},"Stream updates from durable Inngest functions to live UIs. Use channels and topics to broadcast progress, render workflow execution as it happens, or build bi-directional human-in-the-loop flows.",{"type":47,"tag":61,"props":62,"children":63},"blockquote",{},[64],{"type":47,"tag":55,"props":65,"children":66},{},[67,73,75,84],{"type":47,"tag":68,"props":69,"children":70},"strong",{},[71],{"type":52,"value":72},"These skills are focused on TypeScript.",{"type":52,"value":74}," For Python or Go, refer to the ",{"type":47,"tag":76,"props":77,"children":81},"a",{"href":78,"rel":79},"https:\u002F\u002Fwww.inngest.com\u002Fllms.txt",[80],"nofollow",[82],{"type":52,"value":83},"Inngest documentation",{"type":52,"value":85}," for language-specific guidance. Core concepts apply across all languages.",{"type":47,"tag":61,"props":87,"children":88},{},[89,97,146],{"type":47,"tag":55,"props":90,"children":91},{},[92],{"type":47,"tag":68,"props":93,"children":94},{},[95],{"type":52,"value":96},"⚠ CRITICAL: v3 vs v4 package selection",{"type":47,"tag":55,"props":98,"children":99},{},[100,102,109,111,117,119,124,126,137,139,144],{"type":52,"value":101},"Realtime in Inngest v4 lives at the SDK subpath ",{"type":47,"tag":103,"props":104,"children":106},"code",{"className":105},[],[107],{"type":52,"value":108},"inngest\u002Frealtime",{"type":52,"value":110},". The standalone ",{"type":47,"tag":103,"props":112,"children":114},{"className":113},[],[115],{"type":52,"value":116},"@inngest\u002Frealtime",{"type":52,"value":118}," npm package is a ",{"type":47,"tag":68,"props":120,"children":121},{},[122],{"type":52,"value":123},"v3-era package",{"type":52,"value":125}," and is ",{"type":47,"tag":68,"props":127,"children":128},{},[129,131],{"type":52,"value":130},"NOT compatible with ",{"type":47,"tag":103,"props":132,"children":134},{"className":133},[],[135],{"type":52,"value":136},"inngest@4.x",{"type":52,"value":138},". If your project is on v4 (the npm default), do not install ",{"type":47,"tag":103,"props":140,"children":142},{"className":141},[],[143],{"type":52,"value":116},{"type":52,"value":145},". Use the imports below.",{"type":47,"tag":55,"props":147,"children":148},{},[149,151,157,159,165,167,173,175,181,183,189],{"type":52,"value":150},"Symptoms of using the wrong package on v4: ",{"type":47,"tag":103,"props":152,"children":154},{"className":153},[],[155],{"type":52,"value":156},"TypeError: Cls is not a constructor",{"type":52,"value":158}," on every ",{"type":47,"tag":103,"props":160,"children":162},{"className":161},[],[163],{"type":52,"value":164},"PUT \u002Fapi\u002Finngest",{"type":52,"value":166},", 401 on subscription tokens, type incompatibility on ",{"type":47,"tag":103,"props":168,"children":170},{"className":169},[],[171],{"type":52,"value":172},"new Inngest({ middleware: [...] })",{"type":52,"value":174},". Verify your ",{"type":47,"tag":103,"props":176,"children":178},{"className":177},[],[179],{"type":52,"value":180},"package.json",{"type":52,"value":182}," shows ",{"type":47,"tag":103,"props":184,"children":186},{"className":185},[],[187],{"type":52,"value":188},"\"inngest\": \"^4.x\"",{"type":52,"value":190}," before reading further.",{"type":47,"tag":192,"props":193,"children":195},"h2",{"id":194},"prerequisites",[196],{"type":52,"value":197},"Prerequisites",{"type":47,"tag":199,"props":200,"children":201},"ul",{},[202,224,243,256],{"type":47,"tag":203,"props":204,"children":205},"li",{},[206,208,214,216,222],{"type":52,"value":207},"Inngest v4 SDK installed (",{"type":47,"tag":103,"props":209,"children":211},{"className":210},[],[212],{"type":52,"value":213},"npm install inngest",{"type":52,"value":215},") — see the ",{"type":47,"tag":103,"props":217,"children":219},{"className":218},[],[220],{"type":52,"value":221},"inngest-setup",{"type":52,"value":223}," skill",{"type":47,"tag":203,"props":225,"children":226},{},[227,233,235,241],{"type":47,"tag":103,"props":228,"children":230},{"className":229},[],[231],{"type":52,"value":232},"INNGEST_DEV=1",{"type":52,"value":234}," set in ",{"type":47,"tag":103,"props":236,"children":238},{"className":237},[],[239],{"type":52,"value":240},".env.local",{"type":52,"value":242}," for local development (without it, the SDK demands cloud signing keys and 401s on token requests)",{"type":47,"tag":203,"props":244,"children":245},{},[246,248,254],{"type":52,"value":247},"Local Inngest dev server running (",{"type":47,"tag":103,"props":249,"children":251},{"className":250},[],[252],{"type":52,"value":253},"npx inngest-cli@latest dev",{"type":52,"value":255},")",{"type":47,"tag":203,"props":257,"children":258},{},[259,261,267],{"type":52,"value":260},"Optional: ",{"type":47,"tag":103,"props":262,"children":264},{"className":263},[],[265],{"type":52,"value":266},"zod",{"type":52,"value":268}," for schema validation on topics",{"type":47,"tag":192,"props":270,"children":272},{"id":271},"when-to-use-realtime",[273],{"type":52,"value":274},"When to use Realtime",{"type":47,"tag":276,"props":277,"children":278},"table",{},[279,298],{"type":47,"tag":280,"props":281,"children":282},"thead",{},[283],{"type":47,"tag":284,"props":285,"children":286},"tr",{},[287,293],{"type":47,"tag":288,"props":289,"children":290},"th",{},[291],{"type":52,"value":292},"Problem shape",{"type":47,"tag":288,"props":294,"children":295},{},[296],{"type":52,"value":297},"Pattern",{"type":47,"tag":299,"props":300,"children":301},"tbody",{},[302,316,329,342,355],{"type":47,"tag":284,"props":303,"children":304},{},[305,311],{"type":47,"tag":306,"props":307,"children":308},"td",{},[309],{"type":52,"value":310},"Order status page animates as durable workflow steps complete",{"type":47,"tag":306,"props":312,"children":313},{},[314],{"type":52,"value":315},"Per-run channel, publish per step, client subscribes",{"type":47,"tag":284,"props":317,"children":318},{},[319,324],{"type":47,"tag":306,"props":320,"children":321},{},[322],{"type":52,"value":323},"AI agent streams tokens to a chat UI",{"type":47,"tag":306,"props":325,"children":326},{},[327],{"type":52,"value":328},"Per-conversation channel, publish chunks, stream to browser",{"type":47,"tag":284,"props":330,"children":331},{},[332,337],{"type":47,"tag":306,"props":333,"children":334},{},[335],{"type":52,"value":336},"Log tail for a long-running job",{"type":47,"tag":306,"props":338,"children":339},{},[340],{"type":52,"value":341},"Single channel, log topic, append to UI",{"type":47,"tag":284,"props":343,"children":344},{},[345,350],{"type":47,"tag":306,"props":346,"children":347},{},[348],{"type":52,"value":349},"Human-in-the-loop approval",{"type":47,"tag":306,"props":351,"children":352},{},[353],{"type":52,"value":354},"Channel + waitForEvent, publish prompt, wait for response",{"type":47,"tag":284,"props":356,"children":357},{},[358,363],{"type":47,"tag":306,"props":359,"children":360},{},[361],{"type":52,"value":362},"Admin dashboard with live order list",{"type":47,"tag":306,"props":364,"children":365},{},[366],{"type":52,"value":367},"Global admin channel, fan-out from each function",{"type":47,"tag":192,"props":369,"children":371},{"id":370},"architecture",[372],{"type":52,"value":373},"Architecture",{"type":47,"tag":55,"props":375,"children":376},{},[377],{"type":52,"value":378},"Three pieces:",{"type":47,"tag":380,"props":381,"children":382},"ol",{},[383,393,427],{"type":47,"tag":203,"props":384,"children":385},{},[386,391],{"type":47,"tag":68,"props":387,"children":388},{},[389],{"type":52,"value":390},"Channel definition",{"type":52,"value":392}," — a typed contract for what gets published. Lives in shared module so both server and client can reference the same channel name.",{"type":47,"tag":203,"props":394,"children":395},{},[396,401,403,409,411,417,419,425],{"type":47,"tag":68,"props":397,"children":398},{},[399],{"type":52,"value":400},"Publishing",{"type":52,"value":402}," — call ",{"type":47,"tag":103,"props":404,"children":406},{"className":405},[],[407],{"type":52,"value":408},"step.realtime.publish",{"type":52,"value":410}," between steps to wrap a durable publish, or ",{"type":47,"tag":103,"props":412,"children":414},{"className":413},[],[415],{"type":52,"value":416},"inngest.realtime.publish",{"type":52,"value":418}," inside ",{"type":47,"tag":103,"props":420,"children":422},{"className":421},[],[423],{"type":52,"value":424},"step.run",{"type":52,"value":426}," because you're already inside a memoized step. See \"Which publish method to use\" below.",{"type":47,"tag":203,"props":428,"children":429},{},[430,435,437,443,445,451],{"type":47,"tag":68,"props":431,"children":432},{},[433],{"type":52,"value":434},"Subscribing",{"type":52,"value":436}," — server action mints a subscription token; React client uses the ",{"type":47,"tag":103,"props":438,"children":440},{"className":439},[],[441],{"type":52,"value":442},"useRealtime",{"type":52,"value":444}," hook (or the lower-level ",{"type":47,"tag":103,"props":446,"children":448},{"className":447},[],[449],{"type":52,"value":450},"subscribe()",{"type":52,"value":452}," API for non-React consumers).",{"type":47,"tag":192,"props":454,"children":456},{"id":455},"step-1-define-a-channel",[457],{"type":52,"value":458},"Step 1: Define a channel",{"type":47,"tag":55,"props":460,"children":461},{},[462],{"type":52,"value":463},"Channels are pure data — no class hierarchy, no zod runtime required (but recommended for type safety). Define them once and import where needed.",{"type":47,"tag":465,"props":466,"children":471},"pre",{"className":467,"code":468,"language":469,"meta":470,"style":470},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F src\u002Finngest\u002Fchannels.ts\nimport { channel } from 'inngest\u002Frealtime';\nimport { z } from 'zod';\n\n\u002F\u002F Per-run channel: each fulfill-order run publishes step updates to its own channel.\nexport const orderChannel = channel({\n  name: (orderId: string) => `order:${orderId}`,\n  topics: {\n    step: {\n      schema: z.object({\n        name: z.string(),\n        status: z.enum(['running', 'complete', 'failed']),\n        output: z.record(z.string(), z.unknown()).optional(),\n        ts: z.number(),\n      }),\n    },\n  },\n});\n\n\u002F\u002F Global admin channel: fan-out for cross-cutting visibility.\nexport const adminChannel = channel({\n  name: 'admin',\n  topics: {\n    order: {\n      schema: z.object({\n        orderId: z.string(),\n        step: z.string(),\n        status: z.enum(['running', 'complete', 'failed']),\n        ts: z.number(),\n      }),\n    },\n  },\n});\n","typescript","",[472],{"type":47,"tag":103,"props":473,"children":474},{"__ignoreMap":470},[475,487,539,580,590,598,638,711,730,747,782,817,905,987,1021,1038,1047,1056,1073,1081,1090,1123,1152,1168,1185,1217,1249,1282,1362,1394,1410,1418,1426],{"type":47,"tag":476,"props":477,"children":480},"span",{"class":478,"line":479},"line",1,[481],{"type":47,"tag":476,"props":482,"children":484},{"style":483},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[485],{"type":52,"value":486},"\u002F\u002F src\u002Finngest\u002Fchannels.ts\n",{"type":47,"tag":476,"props":488,"children":490},{"class":478,"line":489},2,[491,497,503,509,514,519,524,529,534],{"type":47,"tag":476,"props":492,"children":494},{"style":493},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[495],{"type":52,"value":496},"import",{"type":47,"tag":476,"props":498,"children":500},{"style":499},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[501],{"type":52,"value":502}," {",{"type":47,"tag":476,"props":504,"children":506},{"style":505},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[507],{"type":52,"value":508}," channel",{"type":47,"tag":476,"props":510,"children":511},{"style":499},[512],{"type":52,"value":513}," }",{"type":47,"tag":476,"props":515,"children":516},{"style":493},[517],{"type":52,"value":518}," from",{"type":47,"tag":476,"props":520,"children":521},{"style":499},[522],{"type":52,"value":523}," '",{"type":47,"tag":476,"props":525,"children":527},{"style":526},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[528],{"type":52,"value":108},{"type":47,"tag":476,"props":530,"children":531},{"style":499},[532],{"type":52,"value":533},"'",{"type":47,"tag":476,"props":535,"children":536},{"style":499},[537],{"type":52,"value":538},";\n",{"type":47,"tag":476,"props":540,"children":542},{"class":478,"line":541},3,[543,547,551,556,560,564,568,572,576],{"type":47,"tag":476,"props":544,"children":545},{"style":493},[546],{"type":52,"value":496},{"type":47,"tag":476,"props":548,"children":549},{"style":499},[550],{"type":52,"value":502},{"type":47,"tag":476,"props":552,"children":553},{"style":505},[554],{"type":52,"value":555}," z",{"type":47,"tag":476,"props":557,"children":558},{"style":499},[559],{"type":52,"value":513},{"type":47,"tag":476,"props":561,"children":562},{"style":493},[563],{"type":52,"value":518},{"type":47,"tag":476,"props":565,"children":566},{"style":499},[567],{"type":52,"value":523},{"type":47,"tag":476,"props":569,"children":570},{"style":526},[571],{"type":52,"value":266},{"type":47,"tag":476,"props":573,"children":574},{"style":499},[575],{"type":52,"value":533},{"type":47,"tag":476,"props":577,"children":578},{"style":499},[579],{"type":52,"value":538},{"type":47,"tag":476,"props":581,"children":583},{"class":478,"line":582},4,[584],{"type":47,"tag":476,"props":585,"children":587},{"emptyLinePlaceholder":586},true,[588],{"type":52,"value":589},"\n",{"type":47,"tag":476,"props":591,"children":592},{"class":478,"line":27},[593],{"type":47,"tag":476,"props":594,"children":595},{"style":483},[596],{"type":52,"value":597},"\u002F\u002F Per-run channel: each fulfill-order run publishes step updates to its own channel.\n",{"type":47,"tag":476,"props":599,"children":601},{"class":478,"line":600},6,[602,607,613,618,623,628,633],{"type":47,"tag":476,"props":603,"children":604},{"style":493},[605],{"type":52,"value":606},"export",{"type":47,"tag":476,"props":608,"children":610},{"style":609},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[611],{"type":52,"value":612}," const",{"type":47,"tag":476,"props":614,"children":615},{"style":505},[616],{"type":52,"value":617}," orderChannel ",{"type":47,"tag":476,"props":619,"children":620},{"style":499},[621],{"type":52,"value":622},"=",{"type":47,"tag":476,"props":624,"children":626},{"style":625},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[627],{"type":52,"value":508},{"type":47,"tag":476,"props":629,"children":630},{"style":505},[631],{"type":52,"value":632},"(",{"type":47,"tag":476,"props":634,"children":635},{"style":499},[636],{"type":52,"value":637},"{\n",{"type":47,"tag":476,"props":639,"children":641},{"class":478,"line":640},7,[642,647,652,657,663,667,673,677,682,687,692,697,701,706],{"type":47,"tag":476,"props":643,"children":644},{"style":625},[645],{"type":52,"value":646},"  name",{"type":47,"tag":476,"props":648,"children":649},{"style":499},[650],{"type":52,"value":651},":",{"type":47,"tag":476,"props":653,"children":654},{"style":499},[655],{"type":52,"value":656}," (",{"type":47,"tag":476,"props":658,"children":660},{"style":659},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[661],{"type":52,"value":662},"orderId",{"type":47,"tag":476,"props":664,"children":665},{"style":499},[666],{"type":52,"value":651},{"type":47,"tag":476,"props":668,"children":670},{"style":669},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[671],{"type":52,"value":672}," string",{"type":47,"tag":476,"props":674,"children":675},{"style":499},[676],{"type":52,"value":255},{"type":47,"tag":476,"props":678,"children":679},{"style":609},[680],{"type":52,"value":681}," =>",{"type":47,"tag":476,"props":683,"children":684},{"style":499},[685],{"type":52,"value":686}," `",{"type":47,"tag":476,"props":688,"children":689},{"style":526},[690],{"type":52,"value":691},"order:",{"type":47,"tag":476,"props":693,"children":694},{"style":499},[695],{"type":52,"value":696},"${",{"type":47,"tag":476,"props":698,"children":699},{"style":505},[700],{"type":52,"value":662},{"type":47,"tag":476,"props":702,"children":703},{"style":499},[704],{"type":52,"value":705},"}`",{"type":47,"tag":476,"props":707,"children":708},{"style":499},[709],{"type":52,"value":710},",\n",{"type":47,"tag":476,"props":712,"children":714},{"class":478,"line":713},8,[715,721,725],{"type":47,"tag":476,"props":716,"children":718},{"style":717},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[719],{"type":52,"value":720},"  topics",{"type":47,"tag":476,"props":722,"children":723},{"style":499},[724],{"type":52,"value":651},{"type":47,"tag":476,"props":726,"children":727},{"style":499},[728],{"type":52,"value":729}," {\n",{"type":47,"tag":476,"props":731,"children":733},{"class":478,"line":732},9,[734,739,743],{"type":47,"tag":476,"props":735,"children":736},{"style":717},[737],{"type":52,"value":738},"    step",{"type":47,"tag":476,"props":740,"children":741},{"style":499},[742],{"type":52,"value":651},{"type":47,"tag":476,"props":744,"children":745},{"style":499},[746],{"type":52,"value":729},{"type":47,"tag":476,"props":748,"children":750},{"class":478,"line":749},10,[751,756,760,764,769,774,778],{"type":47,"tag":476,"props":752,"children":753},{"style":717},[754],{"type":52,"value":755},"      schema",{"type":47,"tag":476,"props":757,"children":758},{"style":499},[759],{"type":52,"value":651},{"type":47,"tag":476,"props":761,"children":762},{"style":505},[763],{"type":52,"value":555},{"type":47,"tag":476,"props":765,"children":766},{"style":499},[767],{"type":52,"value":768},".",{"type":47,"tag":476,"props":770,"children":771},{"style":625},[772],{"type":52,"value":773},"object",{"type":47,"tag":476,"props":775,"children":776},{"style":505},[777],{"type":52,"value":632},{"type":47,"tag":476,"props":779,"children":780},{"style":499},[781],{"type":52,"value":637},{"type":47,"tag":476,"props":783,"children":785},{"class":478,"line":784},11,[786,791,795,799,803,808,813],{"type":47,"tag":476,"props":787,"children":788},{"style":717},[789],{"type":52,"value":790},"        name",{"type":47,"tag":476,"props":792,"children":793},{"style":499},[794],{"type":52,"value":651},{"type":47,"tag":476,"props":796,"children":797},{"style":505},[798],{"type":52,"value":555},{"type":47,"tag":476,"props":800,"children":801},{"style":499},[802],{"type":52,"value":768},{"type":47,"tag":476,"props":804,"children":805},{"style":625},[806],{"type":52,"value":807},"string",{"type":47,"tag":476,"props":809,"children":810},{"style":505},[811],{"type":52,"value":812},"()",{"type":47,"tag":476,"props":814,"children":815},{"style":499},[816],{"type":52,"value":710},{"type":47,"tag":476,"props":818,"children":820},{"class":478,"line":819},12,[821,826,830,834,838,843,848,852,857,861,866,870,875,879,883,887,892,896,901],{"type":47,"tag":476,"props":822,"children":823},{"style":717},[824],{"type":52,"value":825},"        status",{"type":47,"tag":476,"props":827,"children":828},{"style":499},[829],{"type":52,"value":651},{"type":47,"tag":476,"props":831,"children":832},{"style":505},[833],{"type":52,"value":555},{"type":47,"tag":476,"props":835,"children":836},{"style":499},[837],{"type":52,"value":768},{"type":47,"tag":476,"props":839,"children":840},{"style":625},[841],{"type":52,"value":842},"enum",{"type":47,"tag":476,"props":844,"children":845},{"style":505},[846],{"type":52,"value":847},"([",{"type":47,"tag":476,"props":849,"children":850},{"style":499},[851],{"type":52,"value":533},{"type":47,"tag":476,"props":853,"children":854},{"style":526},[855],{"type":52,"value":856},"running",{"type":47,"tag":476,"props":858,"children":859},{"style":499},[860],{"type":52,"value":533},{"type":47,"tag":476,"props":862,"children":863},{"style":499},[864],{"type":52,"value":865},",",{"type":47,"tag":476,"props":867,"children":868},{"style":499},[869],{"type":52,"value":523},{"type":47,"tag":476,"props":871,"children":872},{"style":526},[873],{"type":52,"value":874},"complete",{"type":47,"tag":476,"props":876,"children":877},{"style":499},[878],{"type":52,"value":533},{"type":47,"tag":476,"props":880,"children":881},{"style":499},[882],{"type":52,"value":865},{"type":47,"tag":476,"props":884,"children":885},{"style":499},[886],{"type":52,"value":523},{"type":47,"tag":476,"props":888,"children":889},{"style":526},[890],{"type":52,"value":891},"failed",{"type":47,"tag":476,"props":893,"children":894},{"style":499},[895],{"type":52,"value":533},{"type":47,"tag":476,"props":897,"children":898},{"style":505},[899],{"type":52,"value":900},"])",{"type":47,"tag":476,"props":902,"children":903},{"style":499},[904],{"type":52,"value":710},{"type":47,"tag":476,"props":906,"children":908},{"class":478,"line":907},13,[909,914,918,922,926,931,936,940,944,948,952,956,960,965,970,974,979,983],{"type":47,"tag":476,"props":910,"children":911},{"style":717},[912],{"type":52,"value":913},"        output",{"type":47,"tag":476,"props":915,"children":916},{"style":499},[917],{"type":52,"value":651},{"type":47,"tag":476,"props":919,"children":920},{"style":505},[921],{"type":52,"value":555},{"type":47,"tag":476,"props":923,"children":924},{"style":499},[925],{"type":52,"value":768},{"type":47,"tag":476,"props":927,"children":928},{"style":625},[929],{"type":52,"value":930},"record",{"type":47,"tag":476,"props":932,"children":933},{"style":505},[934],{"type":52,"value":935},"(z",{"type":47,"tag":476,"props":937,"children":938},{"style":499},[939],{"type":52,"value":768},{"type":47,"tag":476,"props":941,"children":942},{"style":625},[943],{"type":52,"value":807},{"type":47,"tag":476,"props":945,"children":946},{"style":505},[947],{"type":52,"value":812},{"type":47,"tag":476,"props":949,"children":950},{"style":499},[951],{"type":52,"value":865},{"type":47,"tag":476,"props":953,"children":954},{"style":505},[955],{"type":52,"value":555},{"type":47,"tag":476,"props":957,"children":958},{"style":499},[959],{"type":52,"value":768},{"type":47,"tag":476,"props":961,"children":962},{"style":625},[963],{"type":52,"value":964},"unknown",{"type":47,"tag":476,"props":966,"children":967},{"style":505},[968],{"type":52,"value":969},"())",{"type":47,"tag":476,"props":971,"children":972},{"style":499},[973],{"type":52,"value":768},{"type":47,"tag":476,"props":975,"children":976},{"style":625},[977],{"type":52,"value":978},"optional",{"type":47,"tag":476,"props":980,"children":981},{"style":505},[982],{"type":52,"value":812},{"type":47,"tag":476,"props":984,"children":985},{"style":499},[986],{"type":52,"value":710},{"type":47,"tag":476,"props":988,"children":990},{"class":478,"line":989},14,[991,996,1000,1004,1008,1013,1017],{"type":47,"tag":476,"props":992,"children":993},{"style":717},[994],{"type":52,"value":995},"        ts",{"type":47,"tag":476,"props":997,"children":998},{"style":499},[999],{"type":52,"value":651},{"type":47,"tag":476,"props":1001,"children":1002},{"style":505},[1003],{"type":52,"value":555},{"type":47,"tag":476,"props":1005,"children":1006},{"style":499},[1007],{"type":52,"value":768},{"type":47,"tag":476,"props":1009,"children":1010},{"style":625},[1011],{"type":52,"value":1012},"number",{"type":47,"tag":476,"props":1014,"children":1015},{"style":505},[1016],{"type":52,"value":812},{"type":47,"tag":476,"props":1018,"children":1019},{"style":499},[1020],{"type":52,"value":710},{"type":47,"tag":476,"props":1022,"children":1024},{"class":478,"line":1023},15,[1025,1030,1034],{"type":47,"tag":476,"props":1026,"children":1027},{"style":499},[1028],{"type":52,"value":1029},"      }",{"type":47,"tag":476,"props":1031,"children":1032},{"style":505},[1033],{"type":52,"value":255},{"type":47,"tag":476,"props":1035,"children":1036},{"style":499},[1037],{"type":52,"value":710},{"type":47,"tag":476,"props":1039,"children":1041},{"class":478,"line":1040},16,[1042],{"type":47,"tag":476,"props":1043,"children":1044},{"style":499},[1045],{"type":52,"value":1046},"    },\n",{"type":47,"tag":476,"props":1048,"children":1050},{"class":478,"line":1049},17,[1051],{"type":47,"tag":476,"props":1052,"children":1053},{"style":499},[1054],{"type":52,"value":1055},"  },\n",{"type":47,"tag":476,"props":1057,"children":1059},{"class":478,"line":1058},18,[1060,1065,1069],{"type":47,"tag":476,"props":1061,"children":1062},{"style":499},[1063],{"type":52,"value":1064},"}",{"type":47,"tag":476,"props":1066,"children":1067},{"style":505},[1068],{"type":52,"value":255},{"type":47,"tag":476,"props":1070,"children":1071},{"style":499},[1072],{"type":52,"value":538},{"type":47,"tag":476,"props":1074,"children":1076},{"class":478,"line":1075},19,[1077],{"type":47,"tag":476,"props":1078,"children":1079},{"emptyLinePlaceholder":586},[1080],{"type":52,"value":589},{"type":47,"tag":476,"props":1082,"children":1084},{"class":478,"line":1083},20,[1085],{"type":47,"tag":476,"props":1086,"children":1087},{"style":483},[1088],{"type":52,"value":1089},"\u002F\u002F Global admin channel: fan-out for cross-cutting visibility.\n",{"type":47,"tag":476,"props":1091,"children":1093},{"class":478,"line":1092},21,[1094,1098,1102,1107,1111,1115,1119],{"type":47,"tag":476,"props":1095,"children":1096},{"style":493},[1097],{"type":52,"value":606},{"type":47,"tag":476,"props":1099,"children":1100},{"style":609},[1101],{"type":52,"value":612},{"type":47,"tag":476,"props":1103,"children":1104},{"style":505},[1105],{"type":52,"value":1106}," adminChannel ",{"type":47,"tag":476,"props":1108,"children":1109},{"style":499},[1110],{"type":52,"value":622},{"type":47,"tag":476,"props":1112,"children":1113},{"style":625},[1114],{"type":52,"value":508},{"type":47,"tag":476,"props":1116,"children":1117},{"style":505},[1118],{"type":52,"value":632},{"type":47,"tag":476,"props":1120,"children":1121},{"style":499},[1122],{"type":52,"value":637},{"type":47,"tag":476,"props":1124,"children":1126},{"class":478,"line":1125},22,[1127,1131,1135,1139,1144,1148],{"type":47,"tag":476,"props":1128,"children":1129},{"style":717},[1130],{"type":52,"value":646},{"type":47,"tag":476,"props":1132,"children":1133},{"style":499},[1134],{"type":52,"value":651},{"type":47,"tag":476,"props":1136,"children":1137},{"style":499},[1138],{"type":52,"value":523},{"type":47,"tag":476,"props":1140,"children":1141},{"style":526},[1142],{"type":52,"value":1143},"admin",{"type":47,"tag":476,"props":1145,"children":1146},{"style":499},[1147],{"type":52,"value":533},{"type":47,"tag":476,"props":1149,"children":1150},{"style":499},[1151],{"type":52,"value":710},{"type":47,"tag":476,"props":1153,"children":1155},{"class":478,"line":1154},23,[1156,1160,1164],{"type":47,"tag":476,"props":1157,"children":1158},{"style":717},[1159],{"type":52,"value":720},{"type":47,"tag":476,"props":1161,"children":1162},{"style":499},[1163],{"type":52,"value":651},{"type":47,"tag":476,"props":1165,"children":1166},{"style":499},[1167],{"type":52,"value":729},{"type":47,"tag":476,"props":1169,"children":1171},{"class":478,"line":1170},24,[1172,1177,1181],{"type":47,"tag":476,"props":1173,"children":1174},{"style":717},[1175],{"type":52,"value":1176},"    order",{"type":47,"tag":476,"props":1178,"children":1179},{"style":499},[1180],{"type":52,"value":651},{"type":47,"tag":476,"props":1182,"children":1183},{"style":499},[1184],{"type":52,"value":729},{"type":47,"tag":476,"props":1186,"children":1188},{"class":478,"line":1187},25,[1189,1193,1197,1201,1205,1209,1213],{"type":47,"tag":476,"props":1190,"children":1191},{"style":717},[1192],{"type":52,"value":755},{"type":47,"tag":476,"props":1194,"children":1195},{"style":499},[1196],{"type":52,"value":651},{"type":47,"tag":476,"props":1198,"children":1199},{"style":505},[1200],{"type":52,"value":555},{"type":47,"tag":476,"props":1202,"children":1203},{"style":499},[1204],{"type":52,"value":768},{"type":47,"tag":476,"props":1206,"children":1207},{"style":625},[1208],{"type":52,"value":773},{"type":47,"tag":476,"props":1210,"children":1211},{"style":505},[1212],{"type":52,"value":632},{"type":47,"tag":476,"props":1214,"children":1215},{"style":499},[1216],{"type":52,"value":637},{"type":47,"tag":476,"props":1218,"children":1219},{"class":478,"line":23},[1220,1225,1229,1233,1237,1241,1245],{"type":47,"tag":476,"props":1221,"children":1222},{"style":717},[1223],{"type":52,"value":1224},"        orderId",{"type":47,"tag":476,"props":1226,"children":1227},{"style":499},[1228],{"type":52,"value":651},{"type":47,"tag":476,"props":1230,"children":1231},{"style":505},[1232],{"type":52,"value":555},{"type":47,"tag":476,"props":1234,"children":1235},{"style":499},[1236],{"type":52,"value":768},{"type":47,"tag":476,"props":1238,"children":1239},{"style":625},[1240],{"type":52,"value":807},{"type":47,"tag":476,"props":1242,"children":1243},{"style":505},[1244],{"type":52,"value":812},{"type":47,"tag":476,"props":1246,"children":1247},{"style":499},[1248],{"type":52,"value":710},{"type":47,"tag":476,"props":1250,"children":1252},{"class":478,"line":1251},27,[1253,1258,1262,1266,1270,1274,1278],{"type":47,"tag":476,"props":1254,"children":1255},{"style":717},[1256],{"type":52,"value":1257},"        step",{"type":47,"tag":476,"props":1259,"children":1260},{"style":499},[1261],{"type":52,"value":651},{"type":47,"tag":476,"props":1263,"children":1264},{"style":505},[1265],{"type":52,"value":555},{"type":47,"tag":476,"props":1267,"children":1268},{"style":499},[1269],{"type":52,"value":768},{"type":47,"tag":476,"props":1271,"children":1272},{"style":625},[1273],{"type":52,"value":807},{"type":47,"tag":476,"props":1275,"children":1276},{"style":505},[1277],{"type":52,"value":812},{"type":47,"tag":476,"props":1279,"children":1280},{"style":499},[1281],{"type":52,"value":710},{"type":47,"tag":476,"props":1283,"children":1285},{"class":478,"line":1284},28,[1286,1290,1294,1298,1302,1306,1310,1314,1318,1322,1326,1330,1334,1338,1342,1346,1350,1354,1358],{"type":47,"tag":476,"props":1287,"children":1288},{"style":717},[1289],{"type":52,"value":825},{"type":47,"tag":476,"props":1291,"children":1292},{"style":499},[1293],{"type":52,"value":651},{"type":47,"tag":476,"props":1295,"children":1296},{"style":505},[1297],{"type":52,"value":555},{"type":47,"tag":476,"props":1299,"children":1300},{"style":499},[1301],{"type":52,"value":768},{"type":47,"tag":476,"props":1303,"children":1304},{"style":625},[1305],{"type":52,"value":842},{"type":47,"tag":476,"props":1307,"children":1308},{"style":505},[1309],{"type":52,"value":847},{"type":47,"tag":476,"props":1311,"children":1312},{"style":499},[1313],{"type":52,"value":533},{"type":47,"tag":476,"props":1315,"children":1316},{"style":526},[1317],{"type":52,"value":856},{"type":47,"tag":476,"props":1319,"children":1320},{"style":499},[1321],{"type":52,"value":533},{"type":47,"tag":476,"props":1323,"children":1324},{"style":499},[1325],{"type":52,"value":865},{"type":47,"tag":476,"props":1327,"children":1328},{"style":499},[1329],{"type":52,"value":523},{"type":47,"tag":476,"props":1331,"children":1332},{"style":526},[1333],{"type":52,"value":874},{"type":47,"tag":476,"props":1335,"children":1336},{"style":499},[1337],{"type":52,"value":533},{"type":47,"tag":476,"props":1339,"children":1340},{"style":499},[1341],{"type":52,"value":865},{"type":47,"tag":476,"props":1343,"children":1344},{"style":499},[1345],{"type":52,"value":523},{"type":47,"tag":476,"props":1347,"children":1348},{"style":526},[1349],{"type":52,"value":891},{"type":47,"tag":476,"props":1351,"children":1352},{"style":499},[1353],{"type":52,"value":533},{"type":47,"tag":476,"props":1355,"children":1356},{"style":505},[1357],{"type":52,"value":900},{"type":47,"tag":476,"props":1359,"children":1360},{"style":499},[1361],{"type":52,"value":710},{"type":47,"tag":476,"props":1363,"children":1365},{"class":478,"line":1364},29,[1366,1370,1374,1378,1382,1386,1390],{"type":47,"tag":476,"props":1367,"children":1368},{"style":717},[1369],{"type":52,"value":995},{"type":47,"tag":476,"props":1371,"children":1372},{"style":499},[1373],{"type":52,"value":651},{"type":47,"tag":476,"props":1375,"children":1376},{"style":505},[1377],{"type":52,"value":555},{"type":47,"tag":476,"props":1379,"children":1380},{"style":499},[1381],{"type":52,"value":768},{"type":47,"tag":476,"props":1383,"children":1384},{"style":625},[1385],{"type":52,"value":1012},{"type":47,"tag":476,"props":1387,"children":1388},{"style":505},[1389],{"type":52,"value":812},{"type":47,"tag":476,"props":1391,"children":1392},{"style":499},[1393],{"type":52,"value":710},{"type":47,"tag":476,"props":1395,"children":1397},{"class":478,"line":1396},30,[1398,1402,1406],{"type":47,"tag":476,"props":1399,"children":1400},{"style":499},[1401],{"type":52,"value":1029},{"type":47,"tag":476,"props":1403,"children":1404},{"style":505},[1405],{"type":52,"value":255},{"type":47,"tag":476,"props":1407,"children":1408},{"style":499},[1409],{"type":52,"value":710},{"type":47,"tag":476,"props":1411,"children":1413},{"class":478,"line":1412},31,[1414],{"type":47,"tag":476,"props":1415,"children":1416},{"style":499},[1417],{"type":52,"value":1046},{"type":47,"tag":476,"props":1419,"children":1421},{"class":478,"line":1420},32,[1422],{"type":47,"tag":476,"props":1423,"children":1424},{"style":499},[1425],{"type":52,"value":1055},{"type":47,"tag":476,"props":1427,"children":1429},{"class":478,"line":1428},33,[1430,1434,1438],{"type":47,"tag":476,"props":1431,"children":1432},{"style":499},[1433],{"type":52,"value":1064},{"type":47,"tag":476,"props":1435,"children":1436},{"style":505},[1437],{"type":52,"value":255},{"type":47,"tag":476,"props":1439,"children":1440},{"style":499},[1441],{"type":52,"value":538},{"type":47,"tag":55,"props":1443,"children":1444},{},[1445],{"type":47,"tag":68,"props":1446,"children":1447},{},[1448],{"type":52,"value":1449},"Two channel name shapes:",{"type":47,"tag":199,"props":1451,"children":1452},{},[1453,1472],{"type":47,"tag":203,"props":1454,"children":1455},{},[1456,1462,1464,1470],{"type":47,"tag":103,"props":1457,"children":1459},{"className":1458},[],[1460],{"type":52,"value":1461},"name: 'admin'",{"type":52,"value":1463}," — static channel, accessed as ",{"type":47,"tag":103,"props":1465,"children":1467},{"className":1466},[],[1468],{"type":52,"value":1469},"adminChannel.order",{"type":52,"value":1471}," (topic ref)",{"type":47,"tag":203,"props":1473,"children":1474},{},[1475,1481,1483,1489],{"type":47,"tag":103,"props":1476,"children":1478},{"className":1477},[],[1479],{"type":52,"value":1480},"name: (id) => 'channel:${id}'",{"type":52,"value":1482}," — parametric, accessed as ",{"type":47,"tag":103,"props":1484,"children":1486},{"className":1485},[],[1487],{"type":52,"value":1488},"orderChannel(id).step",{"type":52,"value":1490}," (call the channel def with the id, then access topic)",{"type":47,"tag":192,"props":1492,"children":1494},{"id":1493},"step-2-publish-from-inside-a-function",[1495],{"type":52,"value":1496},"Step 2: Publish from inside a function",{"type":47,"tag":55,"props":1498,"children":1499},{},[1500,1502,1507,1509,1515],{"type":52,"value":1501},"Inngest v4 ships realtime support natively — ",{"type":47,"tag":68,"props":1503,"children":1504},{},[1505],{"type":52,"value":1506},"no middleware required.",{"type":52,"value":1508}," But where you call ",{"type":47,"tag":103,"props":1510,"children":1512},{"className":1511},[],[1513],{"type":52,"value":1514},"publish",{"type":52,"value":1516}," matters: it determines whether the publish is durable, and it's the most common place to get realtime wrong.",{"type":47,"tag":1518,"props":1519,"children":1521},"h3",{"id":1520},"which-publish-method-to-use",[1522],{"type":52,"value":1523},"Which publish method to use",{"type":47,"tag":276,"props":1525,"children":1526},{},[1527,1548],{"type":47,"tag":280,"props":1528,"children":1529},{},[1530],{"type":47,"tag":284,"props":1531,"children":1532},{},[1533,1538,1543],{"type":47,"tag":288,"props":1534,"children":1535},{},[1536],{"type":52,"value":1537},"Where you are",{"type":47,"tag":288,"props":1539,"children":1540},{},[1541],{"type":52,"value":1542},"Use this",{"type":47,"tag":288,"props":1544,"children":1545},{},[1546],{"type":52,"value":1547},"Why",{"type":47,"tag":299,"props":1549,"children":1550},{},[1551,1593,1633],{"type":47,"tag":284,"props":1552,"children":1553},{},[1554,1571,1580],{"type":47,"tag":306,"props":1555,"children":1556},{},[1557,1562,1564,1569],{"type":47,"tag":68,"props":1558,"children":1559},{},[1560],{"type":52,"value":1561},"Outside a step",{"type":52,"value":1563}," (top-level handler code, between ",{"type":47,"tag":103,"props":1565,"children":1567},{"className":1566},[],[1568],{"type":52,"value":424},{"type":52,"value":1570}," calls)",{"type":47,"tag":306,"props":1572,"children":1573},{},[1574],{"type":47,"tag":103,"props":1575,"children":1577},{"className":1576},[],[1578],{"type":52,"value":1579},"step.realtime.publish(id, topicRef, data)",{"type":47,"tag":306,"props":1581,"children":1582},{},[1583,1585,1591],{"type":52,"value":1584},"Wraps the publish in its own step so it's durable, deduplicated by ",{"type":47,"tag":103,"props":1586,"children":1588},{"className":1587},[],[1589],{"type":52,"value":1590},"id",{"type":52,"value":1592},", and retry-safe.",{"type":47,"tag":284,"props":1594,"children":1595},{},[1596,1612,1621],{"type":47,"tag":306,"props":1597,"children":1598},{},[1599,1604,1606,1611],{"type":47,"tag":68,"props":1600,"children":1601},{},[1602],{"type":52,"value":1603},"Inside a step",{"type":52,"value":1605}," (inside the callback passed to ",{"type":47,"tag":103,"props":1607,"children":1609},{"className":1608},[],[1610],{"type":52,"value":424},{"type":52,"value":255},{"type":47,"tag":306,"props":1613,"children":1614},{},[1615],{"type":47,"tag":103,"props":1616,"children":1618},{"className":1617},[],[1619],{"type":52,"value":1620},"inngest.realtime.publish(topicRef, data)",{"type":47,"tag":306,"props":1622,"children":1623},{},[1624,1626,1631],{"type":52,"value":1625},"You're already inside a memoized step. ",{"type":47,"tag":103,"props":1627,"children":1629},{"className":1628},[],[1630],{"type":52,"value":408},{"type":52,"value":1632}," would create a step inside a step. The bare client publish is the right call here.",{"type":47,"tag":284,"props":1634,"children":1635},{},[1636,1646,1654],{"type":47,"tag":306,"props":1637,"children":1638},{},[1639,1644],{"type":47,"tag":68,"props":1640,"children":1641},{},[1642],{"type":52,"value":1643},"Outside a function",{"type":52,"value":1645}," (one-off route, script, etc.)",{"type":47,"tag":306,"props":1647,"children":1648},{},[1649],{"type":47,"tag":103,"props":1650,"children":1652},{"className":1651},[],[1653],{"type":52,"value":1620},{"type":47,"tag":306,"props":1655,"children":1656},{},[1657,1659,1664],{"type":52,"value":1658},"Allowed, but ",{"type":47,"tag":68,"props":1660,"children":1661},{},[1662],{"type":52,"value":1663},"not retry-safe",{"type":52,"value":1665}," — your client receiver must handle duplicates.",{"type":47,"tag":55,"props":1667,"children":1668},{},[1669,1671,1676,1678,1683,1685,1690,1692,1697,1698,1703],{"type":52,"value":1670},"The 90% rule: if you're writing handler code and you reach for ",{"type":47,"tag":103,"props":1672,"children":1674},{"className":1673},[],[1675],{"type":52,"value":1514},{"type":52,"value":1677},", use ",{"type":47,"tag":103,"props":1679,"children":1681},{"className":1680},[],[1682],{"type":52,"value":408},{"type":52,"value":1684},". If you're writing code inside a ",{"type":47,"tag":103,"props":1686,"children":1688},{"className":1687},[],[1689],{"type":52,"value":424},{"type":52,"value":1691}," block and you reach for ",{"type":47,"tag":103,"props":1693,"children":1695},{"className":1694},[],[1696],{"type":52,"value":1514},{"type":52,"value":1677},{"type":47,"tag":103,"props":1699,"children":1701},{"className":1700},[],[1702],{"type":52,"value":416},{"type":52,"value":768},{"type":47,"tag":1518,"props":1705,"children":1707},{"id":1706},"example-both-patterns-in-one-function",[1708],{"type":52,"value":1709},"Example: both patterns in one function",{"type":47,"tag":465,"props":1711,"children":1713},{"className":467,"code":1712,"language":469,"meta":470,"style":470},"\u002F\u002F src\u002Finngest\u002Ffunctions\u002Ffulfill-order.ts\nimport { inngest } from '..\u002Fclient';\nimport { orderChannel, adminChannel } from '..\u002Fchannels';\n\nexport const fulfillOrder = inngest.createFunction(\n  {\n    id: 'fulfill-order',\n    retries: 3,\n    triggers: [{ event: 'store\u002Forder.placed' }],\n  },\n  async ({ event, step }) => {\n    const { orderId, customerEmail, lineItems } = event.data;\n\n    \u002F\u002F Outside any step.run — use step.realtime.publish for a durable wrapper.\n    const emit = async (\n      name: string,\n      status: 'running' | 'complete' | 'failed',\n      output?: Record\u003Cstring, unknown>,\n    ) => {\n      const ts = Date.now();\n      await step.realtime.publish(\n        `emit-order-${name}-${status}`,\n        orderChannel(orderId).step,\n        { name, status, output, ts },\n      );\n      await step.realtime.publish(\n        `emit-admin-${name}-${status}`,\n        adminChannel.order,\n        { orderId, step: name, status, ts },\n      );\n    };\n\n    await emit('capture-payment', 'running');\n\n    \u002F\u002F Inside step.run — use inngest.realtime.publish (already in a memoized step).\n    const payment = await step.run('capture-payment', async () => {\n      const intent = await stripe.paymentIntents.create({ \u002F* ... *\u002F });\n\n      \u002F\u002F Stream a partial update mid-step. No step-in-step wrapping needed.\n      await inngest.realtime.publish(orderChannel(orderId).step, {\n        name: 'capture-payment',\n        status: 'running',\n        output: { stage: 'intent-created', intentId: intent.id },\n        ts: Date.now(),\n      });\n\n      return await stripe.paymentIntents.confirm(intent.id);\n    });\n\n    await emit('capture-payment', 'complete', payment);\n\n    await emit('reserve-inventory', 'running');\n    const inventory = await step.run('reserve-inventory', async () => {\n      \u002F\u002F ...\n    });\n    await emit('reserve-inventory', 'complete', inventory);\n\n    \u002F\u002F ...\n  },\n);\n",[1714],{"type":47,"tag":103,"props":1715,"children":1716},{"__ignoreMap":470},[1717,1725,1766,1816,1823,1861,1869,1898,1920,1977,1984,2023,2084,2091,2099,2125,2145,2206,2247,2264,2303,2336,2384,2417,2461,2473,2504,2548,2569,2616,2627,2635,2642,2695,2703,2712,2784,2853,2861,2870,2935,2963,2991,3058,3090,3106,3114,3173,3190,3198,3258,3266,3319,3388,3397,3413,3473,3481,3490,3498],{"type":47,"tag":476,"props":1718,"children":1719},{"class":478,"line":479},[1720],{"type":47,"tag":476,"props":1721,"children":1722},{"style":483},[1723],{"type":52,"value":1724},"\u002F\u002F src\u002Finngest\u002Ffunctions\u002Ffulfill-order.ts\n",{"type":47,"tag":476,"props":1726,"children":1727},{"class":478,"line":489},[1728,1732,1736,1741,1745,1749,1753,1758,1762],{"type":47,"tag":476,"props":1729,"children":1730},{"style":493},[1731],{"type":52,"value":496},{"type":47,"tag":476,"props":1733,"children":1734},{"style":499},[1735],{"type":52,"value":502},{"type":47,"tag":476,"props":1737,"children":1738},{"style":505},[1739],{"type":52,"value":1740}," inngest",{"type":47,"tag":476,"props":1742,"children":1743},{"style":499},[1744],{"type":52,"value":513},{"type":47,"tag":476,"props":1746,"children":1747},{"style":493},[1748],{"type":52,"value":518},{"type":47,"tag":476,"props":1750,"children":1751},{"style":499},[1752],{"type":52,"value":523},{"type":47,"tag":476,"props":1754,"children":1755},{"style":526},[1756],{"type":52,"value":1757},"..\u002Fclient",{"type":47,"tag":476,"props":1759,"children":1760},{"style":499},[1761],{"type":52,"value":533},{"type":47,"tag":476,"props":1763,"children":1764},{"style":499},[1765],{"type":52,"value":538},{"type":47,"tag":476,"props":1767,"children":1768},{"class":478,"line":541},[1769,1773,1777,1782,1786,1791,1795,1799,1803,1808,1812],{"type":47,"tag":476,"props":1770,"children":1771},{"style":493},[1772],{"type":52,"value":496},{"type":47,"tag":476,"props":1774,"children":1775},{"style":499},[1776],{"type":52,"value":502},{"type":47,"tag":476,"props":1778,"children":1779},{"style":505},[1780],{"type":52,"value":1781}," orderChannel",{"type":47,"tag":476,"props":1783,"children":1784},{"style":499},[1785],{"type":52,"value":865},{"type":47,"tag":476,"props":1787,"children":1788},{"style":505},[1789],{"type":52,"value":1790}," adminChannel",{"type":47,"tag":476,"props":1792,"children":1793},{"style":499},[1794],{"type":52,"value":513},{"type":47,"tag":476,"props":1796,"children":1797},{"style":493},[1798],{"type":52,"value":518},{"type":47,"tag":476,"props":1800,"children":1801},{"style":499},[1802],{"type":52,"value":523},{"type":47,"tag":476,"props":1804,"children":1805},{"style":526},[1806],{"type":52,"value":1807},"..\u002Fchannels",{"type":47,"tag":476,"props":1809,"children":1810},{"style":499},[1811],{"type":52,"value":533},{"type":47,"tag":476,"props":1813,"children":1814},{"style":499},[1815],{"type":52,"value":538},{"type":47,"tag":476,"props":1817,"children":1818},{"class":478,"line":582},[1819],{"type":47,"tag":476,"props":1820,"children":1821},{"emptyLinePlaceholder":586},[1822],{"type":52,"value":589},{"type":47,"tag":476,"props":1824,"children":1825},{"class":478,"line":27},[1826,1830,1834,1839,1843,1847,1851,1856],{"type":47,"tag":476,"props":1827,"children":1828},{"style":493},[1829],{"type":52,"value":606},{"type":47,"tag":476,"props":1831,"children":1832},{"style":609},[1833],{"type":52,"value":612},{"type":47,"tag":476,"props":1835,"children":1836},{"style":505},[1837],{"type":52,"value":1838}," fulfillOrder ",{"type":47,"tag":476,"props":1840,"children":1841},{"style":499},[1842],{"type":52,"value":622},{"type":47,"tag":476,"props":1844,"children":1845},{"style":505},[1846],{"type":52,"value":1740},{"type":47,"tag":476,"props":1848,"children":1849},{"style":499},[1850],{"type":52,"value":768},{"type":47,"tag":476,"props":1852,"children":1853},{"style":625},[1854],{"type":52,"value":1855},"createFunction",{"type":47,"tag":476,"props":1857,"children":1858},{"style":505},[1859],{"type":52,"value":1860},"(\n",{"type":47,"tag":476,"props":1862,"children":1863},{"class":478,"line":600},[1864],{"type":47,"tag":476,"props":1865,"children":1866},{"style":499},[1867],{"type":52,"value":1868},"  {\n",{"type":47,"tag":476,"props":1870,"children":1871},{"class":478,"line":640},[1872,1877,1881,1885,1890,1894],{"type":47,"tag":476,"props":1873,"children":1874},{"style":717},[1875],{"type":52,"value":1876},"    id",{"type":47,"tag":476,"props":1878,"children":1879},{"style":499},[1880],{"type":52,"value":651},{"type":47,"tag":476,"props":1882,"children":1883},{"style":499},[1884],{"type":52,"value":523},{"type":47,"tag":476,"props":1886,"children":1887},{"style":526},[1888],{"type":52,"value":1889},"fulfill-order",{"type":47,"tag":476,"props":1891,"children":1892},{"style":499},[1893],{"type":52,"value":533},{"type":47,"tag":476,"props":1895,"children":1896},{"style":499},[1897],{"type":52,"value":710},{"type":47,"tag":476,"props":1899,"children":1900},{"class":478,"line":713},[1901,1906,1910,1916],{"type":47,"tag":476,"props":1902,"children":1903},{"style":717},[1904],{"type":52,"value":1905},"    retries",{"type":47,"tag":476,"props":1907,"children":1908},{"style":499},[1909],{"type":52,"value":651},{"type":47,"tag":476,"props":1911,"children":1913},{"style":1912},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1914],{"type":52,"value":1915}," 3",{"type":47,"tag":476,"props":1917,"children":1918},{"style":499},[1919],{"type":52,"value":710},{"type":47,"tag":476,"props":1921,"children":1922},{"class":478,"line":732},[1923,1928,1932,1937,1942,1947,1951,1955,1960,1964,1968,1973],{"type":47,"tag":476,"props":1924,"children":1925},{"style":717},[1926],{"type":52,"value":1927},"    triggers",{"type":47,"tag":476,"props":1929,"children":1930},{"style":499},[1931],{"type":52,"value":651},{"type":47,"tag":476,"props":1933,"children":1934},{"style":505},[1935],{"type":52,"value":1936}," [",{"type":47,"tag":476,"props":1938,"children":1939},{"style":499},[1940],{"type":52,"value":1941},"{",{"type":47,"tag":476,"props":1943,"children":1944},{"style":717},[1945],{"type":52,"value":1946}," event",{"type":47,"tag":476,"props":1948,"children":1949},{"style":499},[1950],{"type":52,"value":651},{"type":47,"tag":476,"props":1952,"children":1953},{"style":499},[1954],{"type":52,"value":523},{"type":47,"tag":476,"props":1956,"children":1957},{"style":526},[1958],{"type":52,"value":1959},"store\u002Forder.placed",{"type":47,"tag":476,"props":1961,"children":1962},{"style":499},[1963],{"type":52,"value":533},{"type":47,"tag":476,"props":1965,"children":1966},{"style":499},[1967],{"type":52,"value":513},{"type":47,"tag":476,"props":1969,"children":1970},{"style":505},[1971],{"type":52,"value":1972},"]",{"type":47,"tag":476,"props":1974,"children":1975},{"style":499},[1976],{"type":52,"value":710},{"type":47,"tag":476,"props":1978,"children":1979},{"class":478,"line":749},[1980],{"type":47,"tag":476,"props":1981,"children":1982},{"style":499},[1983],{"type":52,"value":1055},{"type":47,"tag":476,"props":1985,"children":1986},{"class":478,"line":784},[1987,1992,1997,2001,2005,2010,2015,2019],{"type":47,"tag":476,"props":1988,"children":1989},{"style":609},[1990],{"type":52,"value":1991},"  async",{"type":47,"tag":476,"props":1993,"children":1994},{"style":499},[1995],{"type":52,"value":1996}," ({",{"type":47,"tag":476,"props":1998,"children":1999},{"style":659},[2000],{"type":52,"value":1946},{"type":47,"tag":476,"props":2002,"children":2003},{"style":499},[2004],{"type":52,"value":865},{"type":47,"tag":476,"props":2006,"children":2007},{"style":659},[2008],{"type":52,"value":2009}," step",{"type":47,"tag":476,"props":2011,"children":2012},{"style":499},[2013],{"type":52,"value":2014}," })",{"type":47,"tag":476,"props":2016,"children":2017},{"style":609},[2018],{"type":52,"value":681},{"type":47,"tag":476,"props":2020,"children":2021},{"style":499},[2022],{"type":52,"value":729},{"type":47,"tag":476,"props":2024,"children":2025},{"class":478,"line":819},[2026,2031,2035,2040,2044,2049,2053,2058,2062,2067,2071,2075,2080],{"type":47,"tag":476,"props":2027,"children":2028},{"style":609},[2029],{"type":52,"value":2030},"    const",{"type":47,"tag":476,"props":2032,"children":2033},{"style":499},[2034],{"type":52,"value":502},{"type":47,"tag":476,"props":2036,"children":2037},{"style":505},[2038],{"type":52,"value":2039}," orderId",{"type":47,"tag":476,"props":2041,"children":2042},{"style":499},[2043],{"type":52,"value":865},{"type":47,"tag":476,"props":2045,"children":2046},{"style":505},[2047],{"type":52,"value":2048}," customerEmail",{"type":47,"tag":476,"props":2050,"children":2051},{"style":499},[2052],{"type":52,"value":865},{"type":47,"tag":476,"props":2054,"children":2055},{"style":505},[2056],{"type":52,"value":2057}," lineItems",{"type":47,"tag":476,"props":2059,"children":2060},{"style":499},[2061],{"type":52,"value":513},{"type":47,"tag":476,"props":2063,"children":2064},{"style":499},[2065],{"type":52,"value":2066}," =",{"type":47,"tag":476,"props":2068,"children":2069},{"style":505},[2070],{"type":52,"value":1946},{"type":47,"tag":476,"props":2072,"children":2073},{"style":499},[2074],{"type":52,"value":768},{"type":47,"tag":476,"props":2076,"children":2077},{"style":505},[2078],{"type":52,"value":2079},"data",{"type":47,"tag":476,"props":2081,"children":2082},{"style":499},[2083],{"type":52,"value":538},{"type":47,"tag":476,"props":2085,"children":2086},{"class":478,"line":907},[2087],{"type":47,"tag":476,"props":2088,"children":2089},{"emptyLinePlaceholder":586},[2090],{"type":52,"value":589},{"type":47,"tag":476,"props":2092,"children":2093},{"class":478,"line":989},[2094],{"type":47,"tag":476,"props":2095,"children":2096},{"style":483},[2097],{"type":52,"value":2098},"    \u002F\u002F Outside any step.run — use step.realtime.publish for a durable wrapper.\n",{"type":47,"tag":476,"props":2100,"children":2101},{"class":478,"line":1023},[2102,2106,2111,2115,2120],{"type":47,"tag":476,"props":2103,"children":2104},{"style":609},[2105],{"type":52,"value":2030},{"type":47,"tag":476,"props":2107,"children":2108},{"style":505},[2109],{"type":52,"value":2110}," emit",{"type":47,"tag":476,"props":2112,"children":2113},{"style":499},[2114],{"type":52,"value":2066},{"type":47,"tag":476,"props":2116,"children":2117},{"style":609},[2118],{"type":52,"value":2119}," async",{"type":47,"tag":476,"props":2121,"children":2122},{"style":717},[2123],{"type":52,"value":2124}," (\n",{"type":47,"tag":476,"props":2126,"children":2127},{"class":478,"line":1040},[2128,2133,2137,2141],{"type":47,"tag":476,"props":2129,"children":2130},{"style":659},[2131],{"type":52,"value":2132},"      name",{"type":47,"tag":476,"props":2134,"children":2135},{"style":499},[2136],{"type":52,"value":651},{"type":47,"tag":476,"props":2138,"children":2139},{"style":669},[2140],{"type":52,"value":672},{"type":47,"tag":476,"props":2142,"children":2143},{"style":499},[2144],{"type":52,"value":710},{"type":47,"tag":476,"props":2146,"children":2147},{"class":478,"line":1049},[2148,2153,2157,2161,2165,2169,2174,2178,2182,2186,2190,2194,2198,2202],{"type":47,"tag":476,"props":2149,"children":2150},{"style":659},[2151],{"type":52,"value":2152},"      status",{"type":47,"tag":476,"props":2154,"children":2155},{"style":499},[2156],{"type":52,"value":651},{"type":47,"tag":476,"props":2158,"children":2159},{"style":499},[2160],{"type":52,"value":523},{"type":47,"tag":476,"props":2162,"children":2163},{"style":526},[2164],{"type":52,"value":856},{"type":47,"tag":476,"props":2166,"children":2167},{"style":499},[2168],{"type":52,"value":533},{"type":47,"tag":476,"props":2170,"children":2171},{"style":499},[2172],{"type":52,"value":2173}," |",{"type":47,"tag":476,"props":2175,"children":2176},{"style":499},[2177],{"type":52,"value":523},{"type":47,"tag":476,"props":2179,"children":2180},{"style":526},[2181],{"type":52,"value":874},{"type":47,"tag":476,"props":2183,"children":2184},{"style":499},[2185],{"type":52,"value":533},{"type":47,"tag":476,"props":2187,"children":2188},{"style":499},[2189],{"type":52,"value":2173},{"type":47,"tag":476,"props":2191,"children":2192},{"style":499},[2193],{"type":52,"value":523},{"type":47,"tag":476,"props":2195,"children":2196},{"style":526},[2197],{"type":52,"value":891},{"type":47,"tag":476,"props":2199,"children":2200},{"style":499},[2201],{"type":52,"value":533},{"type":47,"tag":476,"props":2203,"children":2204},{"style":499},[2205],{"type":52,"value":710},{"type":47,"tag":476,"props":2207,"children":2208},{"class":478,"line":1058},[2209,2214,2219,2224,2229,2233,2237,2242],{"type":47,"tag":476,"props":2210,"children":2211},{"style":659},[2212],{"type":52,"value":2213},"      output",{"type":47,"tag":476,"props":2215,"children":2216},{"style":499},[2217],{"type":52,"value":2218},"?:",{"type":47,"tag":476,"props":2220,"children":2221},{"style":669},[2222],{"type":52,"value":2223}," Record",{"type":47,"tag":476,"props":2225,"children":2226},{"style":499},[2227],{"type":52,"value":2228},"\u003C",{"type":47,"tag":476,"props":2230,"children":2231},{"style":669},[2232],{"type":52,"value":807},{"type":47,"tag":476,"props":2234,"children":2235},{"style":499},[2236],{"type":52,"value":865},{"type":47,"tag":476,"props":2238,"children":2239},{"style":669},[2240],{"type":52,"value":2241}," unknown",{"type":47,"tag":476,"props":2243,"children":2244},{"style":499},[2245],{"type":52,"value":2246},">,\n",{"type":47,"tag":476,"props":2248,"children":2249},{"class":478,"line":1075},[2250,2255,2260],{"type":47,"tag":476,"props":2251,"children":2252},{"style":717},[2253],{"type":52,"value":2254},"    ) ",{"type":47,"tag":476,"props":2256,"children":2257},{"style":609},[2258],{"type":52,"value":2259},"=>",{"type":47,"tag":476,"props":2261,"children":2262},{"style":499},[2263],{"type":52,"value":729},{"type":47,"tag":476,"props":2265,"children":2266},{"class":478,"line":1083},[2267,2272,2277,2281,2286,2290,2295,2299],{"type":47,"tag":476,"props":2268,"children":2269},{"style":609},[2270],{"type":52,"value":2271},"      const",{"type":47,"tag":476,"props":2273,"children":2274},{"style":505},[2275],{"type":52,"value":2276}," ts",{"type":47,"tag":476,"props":2278,"children":2279},{"style":499},[2280],{"type":52,"value":2066},{"type":47,"tag":476,"props":2282,"children":2283},{"style":505},[2284],{"type":52,"value":2285}," Date",{"type":47,"tag":476,"props":2287,"children":2288},{"style":499},[2289],{"type":52,"value":768},{"type":47,"tag":476,"props":2291,"children":2292},{"style":625},[2293],{"type":52,"value":2294},"now",{"type":47,"tag":476,"props":2296,"children":2297},{"style":717},[2298],{"type":52,"value":812},{"type":47,"tag":476,"props":2300,"children":2301},{"style":499},[2302],{"type":52,"value":538},{"type":47,"tag":476,"props":2304,"children":2305},{"class":478,"line":1092},[2306,2311,2315,2319,2324,2328,2332],{"type":47,"tag":476,"props":2307,"children":2308},{"style":493},[2309],{"type":52,"value":2310},"      await",{"type":47,"tag":476,"props":2312,"children":2313},{"style":505},[2314],{"type":52,"value":2009},{"type":47,"tag":476,"props":2316,"children":2317},{"style":499},[2318],{"type":52,"value":768},{"type":47,"tag":476,"props":2320,"children":2321},{"style":505},[2322],{"type":52,"value":2323},"realtime",{"type":47,"tag":476,"props":2325,"children":2326},{"style":499},[2327],{"type":52,"value":768},{"type":47,"tag":476,"props":2329,"children":2330},{"style":625},[2331],{"type":52,"value":1514},{"type":47,"tag":476,"props":2333,"children":2334},{"style":717},[2335],{"type":52,"value":1860},{"type":47,"tag":476,"props":2337,"children":2338},{"class":478,"line":1125},[2339,2344,2349,2353,2358,2362,2367,2371,2376,2380],{"type":47,"tag":476,"props":2340,"children":2341},{"style":499},[2342],{"type":52,"value":2343},"        `",{"type":47,"tag":476,"props":2345,"children":2346},{"style":526},[2347],{"type":52,"value":2348},"emit-order-",{"type":47,"tag":476,"props":2350,"children":2351},{"style":499},[2352],{"type":52,"value":696},{"type":47,"tag":476,"props":2354,"children":2355},{"style":505},[2356],{"type":52,"value":2357},"name",{"type":47,"tag":476,"props":2359,"children":2360},{"style":499},[2361],{"type":52,"value":1064},{"type":47,"tag":476,"props":2363,"children":2364},{"style":526},[2365],{"type":52,"value":2366},"-",{"type":47,"tag":476,"props":2368,"children":2369},{"style":499},[2370],{"type":52,"value":696},{"type":47,"tag":476,"props":2372,"children":2373},{"style":505},[2374],{"type":52,"value":2375},"status",{"type":47,"tag":476,"props":2377,"children":2378},{"style":499},[2379],{"type":52,"value":705},{"type":47,"tag":476,"props":2381,"children":2382},{"style":499},[2383],{"type":52,"value":710},{"type":47,"tag":476,"props":2385,"children":2386},{"class":478,"line":1154},[2387,2392,2396,2400,2404,2408,2413],{"type":47,"tag":476,"props":2388,"children":2389},{"style":625},[2390],{"type":52,"value":2391},"        orderChannel",{"type":47,"tag":476,"props":2393,"children":2394},{"style":717},[2395],{"type":52,"value":632},{"type":47,"tag":476,"props":2397,"children":2398},{"style":505},[2399],{"type":52,"value":662},{"type":47,"tag":476,"props":2401,"children":2402},{"style":717},[2403],{"type":52,"value":255},{"type":47,"tag":476,"props":2405,"children":2406},{"style":499},[2407],{"type":52,"value":768},{"type":47,"tag":476,"props":2409,"children":2410},{"style":505},[2411],{"type":52,"value":2412},"step",{"type":47,"tag":476,"props":2414,"children":2415},{"style":499},[2416],{"type":52,"value":710},{"type":47,"tag":476,"props":2418,"children":2419},{"class":478,"line":1170},[2420,2425,2430,2434,2439,2443,2448,2452,2456],{"type":47,"tag":476,"props":2421,"children":2422},{"style":499},[2423],{"type":52,"value":2424},"        {",{"type":47,"tag":476,"props":2426,"children":2427},{"style":505},[2428],{"type":52,"value":2429}," name",{"type":47,"tag":476,"props":2431,"children":2432},{"style":499},[2433],{"type":52,"value":865},{"type":47,"tag":476,"props":2435,"children":2436},{"style":505},[2437],{"type":52,"value":2438}," status",{"type":47,"tag":476,"props":2440,"children":2441},{"style":499},[2442],{"type":52,"value":865},{"type":47,"tag":476,"props":2444,"children":2445},{"style":505},[2446],{"type":52,"value":2447}," output",{"type":47,"tag":476,"props":2449,"children":2450},{"style":499},[2451],{"type":52,"value":865},{"type":47,"tag":476,"props":2453,"children":2454},{"style":505},[2455],{"type":52,"value":2276},{"type":47,"tag":476,"props":2457,"children":2458},{"style":499},[2459],{"type":52,"value":2460}," },\n",{"type":47,"tag":476,"props":2462,"children":2463},{"class":478,"line":1187},[2464,2469],{"type":47,"tag":476,"props":2465,"children":2466},{"style":717},[2467],{"type":52,"value":2468},"      )",{"type":47,"tag":476,"props":2470,"children":2471},{"style":499},[2472],{"type":52,"value":538},{"type":47,"tag":476,"props":2474,"children":2475},{"class":478,"line":23},[2476,2480,2484,2488,2492,2496,2500],{"type":47,"tag":476,"props":2477,"children":2478},{"style":493},[2479],{"type":52,"value":2310},{"type":47,"tag":476,"props":2481,"children":2482},{"style":505},[2483],{"type":52,"value":2009},{"type":47,"tag":476,"props":2485,"children":2486},{"style":499},[2487],{"type":52,"value":768},{"type":47,"tag":476,"props":2489,"children":2490},{"style":505},[2491],{"type":52,"value":2323},{"type":47,"tag":476,"props":2493,"children":2494},{"style":499},[2495],{"type":52,"value":768},{"type":47,"tag":476,"props":2497,"children":2498},{"style":625},[2499],{"type":52,"value":1514},{"type":47,"tag":476,"props":2501,"children":2502},{"style":717},[2503],{"type":52,"value":1860},{"type":47,"tag":476,"props":2505,"children":2506},{"class":478,"line":1251},[2507,2511,2516,2520,2524,2528,2532,2536,2540,2544],{"type":47,"tag":476,"props":2508,"children":2509},{"style":499},[2510],{"type":52,"value":2343},{"type":47,"tag":476,"props":2512,"children":2513},{"style":526},[2514],{"type":52,"value":2515},"emit-admin-",{"type":47,"tag":476,"props":2517,"children":2518},{"style":499},[2519],{"type":52,"value":696},{"type":47,"tag":476,"props":2521,"children":2522},{"style":505},[2523],{"type":52,"value":2357},{"type":47,"tag":476,"props":2525,"children":2526},{"style":499},[2527],{"type":52,"value":1064},{"type":47,"tag":476,"props":2529,"children":2530},{"style":526},[2531],{"type":52,"value":2366},{"type":47,"tag":476,"props":2533,"children":2534},{"style":499},[2535],{"type":52,"value":696},{"type":47,"tag":476,"props":2537,"children":2538},{"style":505},[2539],{"type":52,"value":2375},{"type":47,"tag":476,"props":2541,"children":2542},{"style":499},[2543],{"type":52,"value":705},{"type":47,"tag":476,"props":2545,"children":2546},{"style":499},[2547],{"type":52,"value":710},{"type":47,"tag":476,"props":2549,"children":2550},{"class":478,"line":1284},[2551,2556,2560,2565],{"type":47,"tag":476,"props":2552,"children":2553},{"style":505},[2554],{"type":52,"value":2555},"        adminChannel",{"type":47,"tag":476,"props":2557,"children":2558},{"style":499},[2559],{"type":52,"value":768},{"type":47,"tag":476,"props":2561,"children":2562},{"style":505},[2563],{"type":52,"value":2564},"order",{"type":47,"tag":476,"props":2566,"children":2567},{"style":499},[2568],{"type":52,"value":710},{"type":47,"tag":476,"props":2570,"children":2571},{"class":478,"line":1364},[2572,2576,2580,2584,2588,2592,2596,2600,2604,2608,2612],{"type":47,"tag":476,"props":2573,"children":2574},{"style":499},[2575],{"type":52,"value":2424},{"type":47,"tag":476,"props":2577,"children":2578},{"style":505},[2579],{"type":52,"value":2039},{"type":47,"tag":476,"props":2581,"children":2582},{"style":499},[2583],{"type":52,"value":865},{"type":47,"tag":476,"props":2585,"children":2586},{"style":717},[2587],{"type":52,"value":2009},{"type":47,"tag":476,"props":2589,"children":2590},{"style":499},[2591],{"type":52,"value":651},{"type":47,"tag":476,"props":2593,"children":2594},{"style":505},[2595],{"type":52,"value":2429},{"type":47,"tag":476,"props":2597,"children":2598},{"style":499},[2599],{"type":52,"value":865},{"type":47,"tag":476,"props":2601,"children":2602},{"style":505},[2603],{"type":52,"value":2438},{"type":47,"tag":476,"props":2605,"children":2606},{"style":499},[2607],{"type":52,"value":865},{"type":47,"tag":476,"props":2609,"children":2610},{"style":505},[2611],{"type":52,"value":2276},{"type":47,"tag":476,"props":2613,"children":2614},{"style":499},[2615],{"type":52,"value":2460},{"type":47,"tag":476,"props":2617,"children":2618},{"class":478,"line":1396},[2619,2623],{"type":47,"tag":476,"props":2620,"children":2621},{"style":717},[2622],{"type":52,"value":2468},{"type":47,"tag":476,"props":2624,"children":2625},{"style":499},[2626],{"type":52,"value":538},{"type":47,"tag":476,"props":2628,"children":2629},{"class":478,"line":1412},[2630],{"type":47,"tag":476,"props":2631,"children":2632},{"style":499},[2633],{"type":52,"value":2634},"    };\n",{"type":47,"tag":476,"props":2636,"children":2637},{"class":478,"line":1420},[2638],{"type":47,"tag":476,"props":2639,"children":2640},{"emptyLinePlaceholder":586},[2641],{"type":52,"value":589},{"type":47,"tag":476,"props":2643,"children":2644},{"class":478,"line":1428},[2645,2650,2654,2658,2662,2667,2671,2675,2679,2683,2687,2691],{"type":47,"tag":476,"props":2646,"children":2647},{"style":493},[2648],{"type":52,"value":2649},"    await",{"type":47,"tag":476,"props":2651,"children":2652},{"style":625},[2653],{"type":52,"value":2110},{"type":47,"tag":476,"props":2655,"children":2656},{"style":717},[2657],{"type":52,"value":632},{"type":47,"tag":476,"props":2659,"children":2660},{"style":499},[2661],{"type":52,"value":533},{"type":47,"tag":476,"props":2663,"children":2664},{"style":526},[2665],{"type":52,"value":2666},"capture-payment",{"type":47,"tag":476,"props":2668,"children":2669},{"style":499},[2670],{"type":52,"value":533},{"type":47,"tag":476,"props":2672,"children":2673},{"style":499},[2674],{"type":52,"value":865},{"type":47,"tag":476,"props":2676,"children":2677},{"style":499},[2678],{"type":52,"value":523},{"type":47,"tag":476,"props":2680,"children":2681},{"style":526},[2682],{"type":52,"value":856},{"type":47,"tag":476,"props":2684,"children":2685},{"style":499},[2686],{"type":52,"value":533},{"type":47,"tag":476,"props":2688,"children":2689},{"style":717},[2690],{"type":52,"value":255},{"type":47,"tag":476,"props":2692,"children":2693},{"style":499},[2694],{"type":52,"value":538},{"type":47,"tag":476,"props":2696,"children":2698},{"class":478,"line":2697},34,[2699],{"type":47,"tag":476,"props":2700,"children":2701},{"emptyLinePlaceholder":586},[2702],{"type":52,"value":589},{"type":47,"tag":476,"props":2704,"children":2706},{"class":478,"line":2705},35,[2707],{"type":47,"tag":476,"props":2708,"children":2709},{"style":483},[2710],{"type":52,"value":2711},"    \u002F\u002F Inside step.run — use inngest.realtime.publish (already in a memoized step).\n",{"type":47,"tag":476,"props":2713,"children":2715},{"class":478,"line":2714},36,[2716,2720,2725,2729,2734,2738,2742,2747,2751,2755,2759,2763,2767,2771,2776,2780],{"type":47,"tag":476,"props":2717,"children":2718},{"style":609},[2719],{"type":52,"value":2030},{"type":47,"tag":476,"props":2721,"children":2722},{"style":505},[2723],{"type":52,"value":2724}," payment",{"type":47,"tag":476,"props":2726,"children":2727},{"style":499},[2728],{"type":52,"value":2066},{"type":47,"tag":476,"props":2730,"children":2731},{"style":493},[2732],{"type":52,"value":2733}," await",{"type":47,"tag":476,"props":2735,"children":2736},{"style":505},[2737],{"type":52,"value":2009},{"type":47,"tag":476,"props":2739,"children":2740},{"style":499},[2741],{"type":52,"value":768},{"type":47,"tag":476,"props":2743,"children":2744},{"style":625},[2745],{"type":52,"value":2746},"run",{"type":47,"tag":476,"props":2748,"children":2749},{"style":717},[2750],{"type":52,"value":632},{"type":47,"tag":476,"props":2752,"children":2753},{"style":499},[2754],{"type":52,"value":533},{"type":47,"tag":476,"props":2756,"children":2757},{"style":526},[2758],{"type":52,"value":2666},{"type":47,"tag":476,"props":2760,"children":2761},{"style":499},[2762],{"type":52,"value":533},{"type":47,"tag":476,"props":2764,"children":2765},{"style":499},[2766],{"type":52,"value":865},{"type":47,"tag":476,"props":2768,"children":2769},{"style":609},[2770],{"type":52,"value":2119},{"type":47,"tag":476,"props":2772,"children":2773},{"style":499},[2774],{"type":52,"value":2775}," ()",{"type":47,"tag":476,"props":2777,"children":2778},{"style":609},[2779],{"type":52,"value":681},{"type":47,"tag":476,"props":2781,"children":2782},{"style":499},[2783],{"type":52,"value":729},{"type":47,"tag":476,"props":2785,"children":2787},{"class":478,"line":2786},37,[2788,2792,2797,2801,2805,2810,2814,2819,2823,2828,2832,2836,2841,2845,2849],{"type":47,"tag":476,"props":2789,"children":2790},{"style":609},[2791],{"type":52,"value":2271},{"type":47,"tag":476,"props":2793,"children":2794},{"style":505},[2795],{"type":52,"value":2796}," intent",{"type":47,"tag":476,"props":2798,"children":2799},{"style":499},[2800],{"type":52,"value":2066},{"type":47,"tag":476,"props":2802,"children":2803},{"style":493},[2804],{"type":52,"value":2733},{"type":47,"tag":476,"props":2806,"children":2807},{"style":505},[2808],{"type":52,"value":2809}," stripe",{"type":47,"tag":476,"props":2811,"children":2812},{"style":499},[2813],{"type":52,"value":768},{"type":47,"tag":476,"props":2815,"children":2816},{"style":505},[2817],{"type":52,"value":2818},"paymentIntents",{"type":47,"tag":476,"props":2820,"children":2821},{"style":499},[2822],{"type":52,"value":768},{"type":47,"tag":476,"props":2824,"children":2825},{"style":625},[2826],{"type":52,"value":2827},"create",{"type":47,"tag":476,"props":2829,"children":2830},{"style":717},[2831],{"type":52,"value":632},{"type":47,"tag":476,"props":2833,"children":2834},{"style":499},[2835],{"type":52,"value":1941},{"type":47,"tag":476,"props":2837,"children":2838},{"style":483},[2839],{"type":52,"value":2840}," \u002F* ... *\u002F",{"type":47,"tag":476,"props":2842,"children":2843},{"style":499},[2844],{"type":52,"value":513},{"type":47,"tag":476,"props":2846,"children":2847},{"style":717},[2848],{"type":52,"value":255},{"type":47,"tag":476,"props":2850,"children":2851},{"style":499},[2852],{"type":52,"value":538},{"type":47,"tag":476,"props":2854,"children":2856},{"class":478,"line":2855},38,[2857],{"type":47,"tag":476,"props":2858,"children":2859},{"emptyLinePlaceholder":586},[2860],{"type":52,"value":589},{"type":47,"tag":476,"props":2862,"children":2864},{"class":478,"line":2863},39,[2865],{"type":47,"tag":476,"props":2866,"children":2867},{"style":483},[2868],{"type":52,"value":2869},"      \u002F\u002F Stream a partial update mid-step. No step-in-step wrapping needed.\n",{"type":47,"tag":476,"props":2871,"children":2873},{"class":478,"line":2872},40,[2874,2878,2882,2886,2890,2894,2898,2902,2907,2911,2915,2919,2923,2927,2931],{"type":47,"tag":476,"props":2875,"children":2876},{"style":493},[2877],{"type":52,"value":2310},{"type":47,"tag":476,"props":2879,"children":2880},{"style":505},[2881],{"type":52,"value":1740},{"type":47,"tag":476,"props":2883,"children":2884},{"style":499},[2885],{"type":52,"value":768},{"type":47,"tag":476,"props":2887,"children":2888},{"style":505},[2889],{"type":52,"value":2323},{"type":47,"tag":476,"props":2891,"children":2892},{"style":499},[2893],{"type":52,"value":768},{"type":47,"tag":476,"props":2895,"children":2896},{"style":625},[2897],{"type":52,"value":1514},{"type":47,"tag":476,"props":2899,"children":2900},{"style":717},[2901],{"type":52,"value":632},{"type":47,"tag":476,"props":2903,"children":2904},{"style":625},[2905],{"type":52,"value":2906},"orderChannel",{"type":47,"tag":476,"props":2908,"children":2909},{"style":717},[2910],{"type":52,"value":632},{"type":47,"tag":476,"props":2912,"children":2913},{"style":505},[2914],{"type":52,"value":662},{"type":47,"tag":476,"props":2916,"children":2917},{"style":717},[2918],{"type":52,"value":255},{"type":47,"tag":476,"props":2920,"children":2921},{"style":499},[2922],{"type":52,"value":768},{"type":47,"tag":476,"props":2924,"children":2925},{"style":505},[2926],{"type":52,"value":2412},{"type":47,"tag":476,"props":2928,"children":2929},{"style":499},[2930],{"type":52,"value":865},{"type":47,"tag":476,"props":2932,"children":2933},{"style":499},[2934],{"type":52,"value":729},{"type":47,"tag":476,"props":2936,"children":2938},{"class":478,"line":2937},41,[2939,2943,2947,2951,2955,2959],{"type":47,"tag":476,"props":2940,"children":2941},{"style":717},[2942],{"type":52,"value":790},{"type":47,"tag":476,"props":2944,"children":2945},{"style":499},[2946],{"type":52,"value":651},{"type":47,"tag":476,"props":2948,"children":2949},{"style":499},[2950],{"type":52,"value":523},{"type":47,"tag":476,"props":2952,"children":2953},{"style":526},[2954],{"type":52,"value":2666},{"type":47,"tag":476,"props":2956,"children":2957},{"style":499},[2958],{"type":52,"value":533},{"type":47,"tag":476,"props":2960,"children":2961},{"style":499},[2962],{"type":52,"value":710},{"type":47,"tag":476,"props":2964,"children":2966},{"class":478,"line":2965},42,[2967,2971,2975,2979,2983,2987],{"type":47,"tag":476,"props":2968,"children":2969},{"style":717},[2970],{"type":52,"value":825},{"type":47,"tag":476,"props":2972,"children":2973},{"style":499},[2974],{"type":52,"value":651},{"type":47,"tag":476,"props":2976,"children":2977},{"style":499},[2978],{"type":52,"value":523},{"type":47,"tag":476,"props":2980,"children":2981},{"style":526},[2982],{"type":52,"value":856},{"type":47,"tag":476,"props":2984,"children":2985},{"style":499},[2986],{"type":52,"value":533},{"type":47,"tag":476,"props":2988,"children":2989},{"style":499},[2990],{"type":52,"value":710},{"type":47,"tag":476,"props":2992,"children":2994},{"class":478,"line":2993},43,[2995,2999,3003,3007,3012,3016,3020,3025,3029,3033,3038,3042,3046,3050,3054],{"type":47,"tag":476,"props":2996,"children":2997},{"style":717},[2998],{"type":52,"value":913},{"type":47,"tag":476,"props":3000,"children":3001},{"style":499},[3002],{"type":52,"value":651},{"type":47,"tag":476,"props":3004,"children":3005},{"style":499},[3006],{"type":52,"value":502},{"type":47,"tag":476,"props":3008,"children":3009},{"style":717},[3010],{"type":52,"value":3011}," stage",{"type":47,"tag":476,"props":3013,"children":3014},{"style":499},[3015],{"type":52,"value":651},{"type":47,"tag":476,"props":3017,"children":3018},{"style":499},[3019],{"type":52,"value":523},{"type":47,"tag":476,"props":3021,"children":3022},{"style":526},[3023],{"type":52,"value":3024},"intent-created",{"type":47,"tag":476,"props":3026,"children":3027},{"style":499},[3028],{"type":52,"value":533},{"type":47,"tag":476,"props":3030,"children":3031},{"style":499},[3032],{"type":52,"value":865},{"type":47,"tag":476,"props":3034,"children":3035},{"style":717},[3036],{"type":52,"value":3037}," intentId",{"type":47,"tag":476,"props":3039,"children":3040},{"style":499},[3041],{"type":52,"value":651},{"type":47,"tag":476,"props":3043,"children":3044},{"style":505},[3045],{"type":52,"value":2796},{"type":47,"tag":476,"props":3047,"children":3048},{"style":499},[3049],{"type":52,"value":768},{"type":47,"tag":476,"props":3051,"children":3052},{"style":505},[3053],{"type":52,"value":1590},{"type":47,"tag":476,"props":3055,"children":3056},{"style":499},[3057],{"type":52,"value":2460},{"type":47,"tag":476,"props":3059,"children":3061},{"class":478,"line":3060},44,[3062,3066,3070,3074,3078,3082,3086],{"type":47,"tag":476,"props":3063,"children":3064},{"style":717},[3065],{"type":52,"value":995},{"type":47,"tag":476,"props":3067,"children":3068},{"style":499},[3069],{"type":52,"value":651},{"type":47,"tag":476,"props":3071,"children":3072},{"style":505},[3073],{"type":52,"value":2285},{"type":47,"tag":476,"props":3075,"children":3076},{"style":499},[3077],{"type":52,"value":768},{"type":47,"tag":476,"props":3079,"children":3080},{"style":625},[3081],{"type":52,"value":2294},{"type":47,"tag":476,"props":3083,"children":3084},{"style":717},[3085],{"type":52,"value":812},{"type":47,"tag":476,"props":3087,"children":3088},{"style":499},[3089],{"type":52,"value":710},{"type":47,"tag":476,"props":3091,"children":3093},{"class":478,"line":3092},45,[3094,3098,3102],{"type":47,"tag":476,"props":3095,"children":3096},{"style":499},[3097],{"type":52,"value":1029},{"type":47,"tag":476,"props":3099,"children":3100},{"style":717},[3101],{"type":52,"value":255},{"type":47,"tag":476,"props":3103,"children":3104},{"style":499},[3105],{"type":52,"value":538},{"type":47,"tag":476,"props":3107,"children":3109},{"class":478,"line":3108},46,[3110],{"type":47,"tag":476,"props":3111,"children":3112},{"emptyLinePlaceholder":586},[3113],{"type":52,"value":589},{"type":47,"tag":476,"props":3115,"children":3117},{"class":478,"line":3116},47,[3118,3123,3127,3131,3135,3139,3143,3148,3152,3157,3161,3165,3169],{"type":47,"tag":476,"props":3119,"children":3120},{"style":493},[3121],{"type":52,"value":3122},"      return",{"type":47,"tag":476,"props":3124,"children":3125},{"style":493},[3126],{"type":52,"value":2733},{"type":47,"tag":476,"props":3128,"children":3129},{"style":505},[3130],{"type":52,"value":2809},{"type":47,"tag":476,"props":3132,"children":3133},{"style":499},[3134],{"type":52,"value":768},{"type":47,"tag":476,"props":3136,"children":3137},{"style":505},[3138],{"type":52,"value":2818},{"type":47,"tag":476,"props":3140,"children":3141},{"style":499},[3142],{"type":52,"value":768},{"type":47,"tag":476,"props":3144,"children":3145},{"style":625},[3146],{"type":52,"value":3147},"confirm",{"type":47,"tag":476,"props":3149,"children":3150},{"style":717},[3151],{"type":52,"value":632},{"type":47,"tag":476,"props":3153,"children":3154},{"style":505},[3155],{"type":52,"value":3156},"intent",{"type":47,"tag":476,"props":3158,"children":3159},{"style":499},[3160],{"type":52,"value":768},{"type":47,"tag":476,"props":3162,"children":3163},{"style":505},[3164],{"type":52,"value":1590},{"type":47,"tag":476,"props":3166,"children":3167},{"style":717},[3168],{"type":52,"value":255},{"type":47,"tag":476,"props":3170,"children":3171},{"style":499},[3172],{"type":52,"value":538},{"type":47,"tag":476,"props":3174,"children":3176},{"class":478,"line":3175},48,[3177,3182,3186],{"type":47,"tag":476,"props":3178,"children":3179},{"style":499},[3180],{"type":52,"value":3181},"    }",{"type":47,"tag":476,"props":3183,"children":3184},{"style":717},[3185],{"type":52,"value":255},{"type":47,"tag":476,"props":3187,"children":3188},{"style":499},[3189],{"type":52,"value":538},{"type":47,"tag":476,"props":3191,"children":3193},{"class":478,"line":3192},49,[3194],{"type":47,"tag":476,"props":3195,"children":3196},{"emptyLinePlaceholder":586},[3197],{"type":52,"value":589},{"type":47,"tag":476,"props":3199,"children":3201},{"class":478,"line":3200},50,[3202,3206,3210,3214,3218,3222,3226,3230,3234,3238,3242,3246,3250,3254],{"type":47,"tag":476,"props":3203,"children":3204},{"style":493},[3205],{"type":52,"value":2649},{"type":47,"tag":476,"props":3207,"children":3208},{"style":625},[3209],{"type":52,"value":2110},{"type":47,"tag":476,"props":3211,"children":3212},{"style":717},[3213],{"type":52,"value":632},{"type":47,"tag":476,"props":3215,"children":3216},{"style":499},[3217],{"type":52,"value":533},{"type":47,"tag":476,"props":3219,"children":3220},{"style":526},[3221],{"type":52,"value":2666},{"type":47,"tag":476,"props":3223,"children":3224},{"style":499},[3225],{"type":52,"value":533},{"type":47,"tag":476,"props":3227,"children":3228},{"style":499},[3229],{"type":52,"value":865},{"type":47,"tag":476,"props":3231,"children":3232},{"style":499},[3233],{"type":52,"value":523},{"type":47,"tag":476,"props":3235,"children":3236},{"style":526},[3237],{"type":52,"value":874},{"type":47,"tag":476,"props":3239,"children":3240},{"style":499},[3241],{"type":52,"value":533},{"type":47,"tag":476,"props":3243,"children":3244},{"style":499},[3245],{"type":52,"value":865},{"type":47,"tag":476,"props":3247,"children":3248},{"style":505},[3249],{"type":52,"value":2724},{"type":47,"tag":476,"props":3251,"children":3252},{"style":717},[3253],{"type":52,"value":255},{"type":47,"tag":476,"props":3255,"children":3256},{"style":499},[3257],{"type":52,"value":538},{"type":47,"tag":476,"props":3259,"children":3261},{"class":478,"line":3260},51,[3262],{"type":47,"tag":476,"props":3263,"children":3264},{"emptyLinePlaceholder":586},[3265],{"type":52,"value":589},{"type":47,"tag":476,"props":3267,"children":3269},{"class":478,"line":3268},52,[3270,3274,3278,3282,3286,3291,3295,3299,3303,3307,3311,3315],{"type":47,"tag":476,"props":3271,"children":3272},{"style":493},[3273],{"type":52,"value":2649},{"type":47,"tag":476,"props":3275,"children":3276},{"style":625},[3277],{"type":52,"value":2110},{"type":47,"tag":476,"props":3279,"children":3280},{"style":717},[3281],{"type":52,"value":632},{"type":47,"tag":476,"props":3283,"children":3284},{"style":499},[3285],{"type":52,"value":533},{"type":47,"tag":476,"props":3287,"children":3288},{"style":526},[3289],{"type":52,"value":3290},"reserve-inventory",{"type":47,"tag":476,"props":3292,"children":3293},{"style":499},[3294],{"type":52,"value":533},{"type":47,"tag":476,"props":3296,"children":3297},{"style":499},[3298],{"type":52,"value":865},{"type":47,"tag":476,"props":3300,"children":3301},{"style":499},[3302],{"type":52,"value":523},{"type":47,"tag":476,"props":3304,"children":3305},{"style":526},[3306],{"type":52,"value":856},{"type":47,"tag":476,"props":3308,"children":3309},{"style":499},[3310],{"type":52,"value":533},{"type":47,"tag":476,"props":3312,"children":3313},{"style":717},[3314],{"type":52,"value":255},{"type":47,"tag":476,"props":3316,"children":3317},{"style":499},[3318],{"type":52,"value":538},{"type":47,"tag":476,"props":3320,"children":3322},{"class":478,"line":3321},53,[3323,3327,3332,3336,3340,3344,3348,3352,3356,3360,3364,3368,3372,3376,3380,3384],{"type":47,"tag":476,"props":3324,"children":3325},{"style":609},[3326],{"type":52,"value":2030},{"type":47,"tag":476,"props":3328,"children":3329},{"style":505},[3330],{"type":52,"value":3331}," inventory",{"type":47,"tag":476,"props":3333,"children":3334},{"style":499},[3335],{"type":52,"value":2066},{"type":47,"tag":476,"props":3337,"children":3338},{"style":493},[3339],{"type":52,"value":2733},{"type":47,"tag":476,"props":3341,"children":3342},{"style":505},[3343],{"type":52,"value":2009},{"type":47,"tag":476,"props":3345,"children":3346},{"style":499},[3347],{"type":52,"value":768},{"type":47,"tag":476,"props":3349,"children":3350},{"style":625},[3351],{"type":52,"value":2746},{"type":47,"tag":476,"props":3353,"children":3354},{"style":717},[3355],{"type":52,"value":632},{"type":47,"tag":476,"props":3357,"children":3358},{"style":499},[3359],{"type":52,"value":533},{"type":47,"tag":476,"props":3361,"children":3362},{"style":526},[3363],{"type":52,"value":3290},{"type":47,"tag":476,"props":3365,"children":3366},{"style":499},[3367],{"type":52,"value":533},{"type":47,"tag":476,"props":3369,"children":3370},{"style":499},[3371],{"type":52,"value":865},{"type":47,"tag":476,"props":3373,"children":3374},{"style":609},[3375],{"type":52,"value":2119},{"type":47,"tag":476,"props":3377,"children":3378},{"style":499},[3379],{"type":52,"value":2775},{"type":47,"tag":476,"props":3381,"children":3382},{"style":609},[3383],{"type":52,"value":681},{"type":47,"tag":476,"props":3385,"children":3386},{"style":499},[3387],{"type":52,"value":729},{"type":47,"tag":476,"props":3389,"children":3391},{"class":478,"line":3390},54,[3392],{"type":47,"tag":476,"props":3393,"children":3394},{"style":483},[3395],{"type":52,"value":3396},"      \u002F\u002F ...\n",{"type":47,"tag":476,"props":3398,"children":3400},{"class":478,"line":3399},55,[3401,3405,3409],{"type":47,"tag":476,"props":3402,"children":3403},{"style":499},[3404],{"type":52,"value":3181},{"type":47,"tag":476,"props":3406,"children":3407},{"style":717},[3408],{"type":52,"value":255},{"type":47,"tag":476,"props":3410,"children":3411},{"style":499},[3412],{"type":52,"value":538},{"type":47,"tag":476,"props":3414,"children":3416},{"class":478,"line":3415},56,[3417,3421,3425,3429,3433,3437,3441,3445,3449,3453,3457,3461,3465,3469],{"type":47,"tag":476,"props":3418,"children":3419},{"style":493},[3420],{"type":52,"value":2649},{"type":47,"tag":476,"props":3422,"children":3423},{"style":625},[3424],{"type":52,"value":2110},{"type":47,"tag":476,"props":3426,"children":3427},{"style":717},[3428],{"type":52,"value":632},{"type":47,"tag":476,"props":3430,"children":3431},{"style":499},[3432],{"type":52,"value":533},{"type":47,"tag":476,"props":3434,"children":3435},{"style":526},[3436],{"type":52,"value":3290},{"type":47,"tag":476,"props":3438,"children":3439},{"style":499},[3440],{"type":52,"value":533},{"type":47,"tag":476,"props":3442,"children":3443},{"style":499},[3444],{"type":52,"value":865},{"type":47,"tag":476,"props":3446,"children":3447},{"style":499},[3448],{"type":52,"value":523},{"type":47,"tag":476,"props":3450,"children":3451},{"style":526},[3452],{"type":52,"value":874},{"type":47,"tag":476,"props":3454,"children":3455},{"style":499},[3456],{"type":52,"value":533},{"type":47,"tag":476,"props":3458,"children":3459},{"style":499},[3460],{"type":52,"value":865},{"type":47,"tag":476,"props":3462,"children":3463},{"style":505},[3464],{"type":52,"value":3331},{"type":47,"tag":476,"props":3466,"children":3467},{"style":717},[3468],{"type":52,"value":255},{"type":47,"tag":476,"props":3470,"children":3471},{"style":499},[3472],{"type":52,"value":538},{"type":47,"tag":476,"props":3474,"children":3476},{"class":478,"line":3475},57,[3477],{"type":47,"tag":476,"props":3478,"children":3479},{"emptyLinePlaceholder":586},[3480],{"type":52,"value":589},{"type":47,"tag":476,"props":3482,"children":3484},{"class":478,"line":3483},58,[3485],{"type":47,"tag":476,"props":3486,"children":3487},{"style":483},[3488],{"type":52,"value":3489},"    \u002F\u002F ...\n",{"type":47,"tag":476,"props":3491,"children":3493},{"class":478,"line":3492},59,[3494],{"type":47,"tag":476,"props":3495,"children":3496},{"style":499},[3497],{"type":52,"value":1055},{"type":47,"tag":476,"props":3499,"children":3501},{"class":478,"line":3500},60,[3502,3506],{"type":47,"tag":476,"props":3503,"children":3504},{"style":505},[3505],{"type":52,"value":255},{"type":47,"tag":476,"props":3507,"children":3508},{"style":499},[3509],{"type":52,"value":538},{"type":47,"tag":55,"props":3511,"children":3512},{},[3513,3518,3520,3525,3527,3533,3535,3540,3542,3548,3550,3556],{"type":47,"tag":68,"props":3514,"children":3515},{},[3516],{"type":52,"value":3517},"Why no middleware:",{"type":52,"value":3519}," Earlier versions used ",{"type":47,"tag":103,"props":3521,"children":3523},{"className":3522},[],[3524],{"type":52,"value":116},{"type":52,"value":3526},"'s ",{"type":47,"tag":103,"props":3528,"children":3530},{"className":3529},[],[3531],{"type":52,"value":3532},"realtimeMiddleware()",{"type":52,"value":3534}," to inject a ",{"type":47,"tag":103,"props":3536,"children":3538},{"className":3537},[],[3539],{"type":52,"value":1514},{"type":52,"value":3541}," arg into the handler. v4 puts it on ",{"type":47,"tag":103,"props":3543,"children":3545},{"className":3544},[],[3546],{"type":52,"value":3547},"step.realtime",{"type":52,"value":3549}," and ",{"type":47,"tag":103,"props":3551,"children":3553},{"className":3552},[],[3554],{"type":52,"value":3555},"inngest.realtime",{"type":52,"value":3557}," directly.",{"type":47,"tag":192,"props":3559,"children":3561},{"id":3560},"step-3-mint-a-subscription-token-server-action",[3562],{"type":52,"value":3563},"Step 3: Mint a subscription token (server action)",{"type":47,"tag":55,"props":3565,"children":3566},{},[3567],{"type":52,"value":3568},"In Next.js App Router, use a Server Action to securely mint a short-lived token for the React hook in Step 4. Without a token, clients can't subscribe.",{"type":47,"tag":465,"props":3570,"children":3572},{"className":467,"code":3571,"language":469,"meta":470,"style":470},"\u002F\u002F src\u002Fapp\u002Forders\u002F[orderId]\u002Factions.ts\n'use server';\n\nimport { getClientSubscriptionToken } from 'inngest\u002Freact';\nimport { inngest } from '@\u002Finngest\u002Fclient';\nimport { orderChannel } from '@\u002Finngest\u002Fchannels';\n\nexport async function fetchOrderSubscriptionToken(orderId: string) {\n  \u002F\u002F ⚠ AUTHORIZATION GATE: verify the current user owns this orderId\n  \u002F\u002F before minting a token. Channels are addressable by ID, so without\n  \u002F\u002F an ownership check, anyone can subscribe to any order's stream by\n  \u002F\u002F guessing IDs.\n  \u002F\u002F\n  \u002F\u002F   const session = await getServerSession();\n  \u002F\u002F   if (!session) throw new Error('Unauthenticated');\n  \u002F\u002F   const order = await db.order.findUnique({ where: { id: orderId } });\n  \u002F\u002F   if (order?.userId !== session.userId) throw new Error('Forbidden');\n\n  return getClientSubscriptionToken(inngest, {\n    channel: orderChannel(orderId),\n    topics: ['step'],\n  });\n}\n",[3573],{"type":47,"tag":103,"props":3574,"children":3575},{"__ignoreMap":470},[3576,3584,3604,3611,3652,3692,3732,3739,3784,3792,3800,3808,3816,3824,3832,3840,3848,3856,3863,3891,3923,3959,3975],{"type":47,"tag":476,"props":3577,"children":3578},{"class":478,"line":479},[3579],{"type":47,"tag":476,"props":3580,"children":3581},{"style":483},[3582],{"type":52,"value":3583},"\u002F\u002F src\u002Fapp\u002Forders\u002F[orderId]\u002Factions.ts\n",{"type":47,"tag":476,"props":3585,"children":3586},{"class":478,"line":489},[3587,3591,3596,3600],{"type":47,"tag":476,"props":3588,"children":3589},{"style":499},[3590],{"type":52,"value":533},{"type":47,"tag":476,"props":3592,"children":3593},{"style":526},[3594],{"type":52,"value":3595},"use server",{"type":47,"tag":476,"props":3597,"children":3598},{"style":499},[3599],{"type":52,"value":533},{"type":47,"tag":476,"props":3601,"children":3602},{"style":499},[3603],{"type":52,"value":538},{"type":47,"tag":476,"props":3605,"children":3606},{"class":478,"line":541},[3607],{"type":47,"tag":476,"props":3608,"children":3609},{"emptyLinePlaceholder":586},[3610],{"type":52,"value":589},{"type":47,"tag":476,"props":3612,"children":3613},{"class":478,"line":582},[3614,3618,3622,3627,3631,3635,3639,3644,3648],{"type":47,"tag":476,"props":3615,"children":3616},{"style":493},[3617],{"type":52,"value":496},{"type":47,"tag":476,"props":3619,"children":3620},{"style":499},[3621],{"type":52,"value":502},{"type":47,"tag":476,"props":3623,"children":3624},{"style":505},[3625],{"type":52,"value":3626}," getClientSubscriptionToken",{"type":47,"tag":476,"props":3628,"children":3629},{"style":499},[3630],{"type":52,"value":513},{"type":47,"tag":476,"props":3632,"children":3633},{"style":493},[3634],{"type":52,"value":518},{"type":47,"tag":476,"props":3636,"children":3637},{"style":499},[3638],{"type":52,"value":523},{"type":47,"tag":476,"props":3640,"children":3641},{"style":526},[3642],{"type":52,"value":3643},"inngest\u002Freact",{"type":47,"tag":476,"props":3645,"children":3646},{"style":499},[3647],{"type":52,"value":533},{"type":47,"tag":476,"props":3649,"children":3650},{"style":499},[3651],{"type":52,"value":538},{"type":47,"tag":476,"props":3653,"children":3654},{"class":478,"line":27},[3655,3659,3663,3667,3671,3675,3679,3684,3688],{"type":47,"tag":476,"props":3656,"children":3657},{"style":493},[3658],{"type":52,"value":496},{"type":47,"tag":476,"props":3660,"children":3661},{"style":499},[3662],{"type":52,"value":502},{"type":47,"tag":476,"props":3664,"children":3665},{"style":505},[3666],{"type":52,"value":1740},{"type":47,"tag":476,"props":3668,"children":3669},{"style":499},[3670],{"type":52,"value":513},{"type":47,"tag":476,"props":3672,"children":3673},{"style":493},[3674],{"type":52,"value":518},{"type":47,"tag":476,"props":3676,"children":3677},{"style":499},[3678],{"type":52,"value":523},{"type":47,"tag":476,"props":3680,"children":3681},{"style":526},[3682],{"type":52,"value":3683},"@\u002Finngest\u002Fclient",{"type":47,"tag":476,"props":3685,"children":3686},{"style":499},[3687],{"type":52,"value":533},{"type":47,"tag":476,"props":3689,"children":3690},{"style":499},[3691],{"type":52,"value":538},{"type":47,"tag":476,"props":3693,"children":3694},{"class":478,"line":600},[3695,3699,3703,3707,3711,3715,3719,3724,3728],{"type":47,"tag":476,"props":3696,"children":3697},{"style":493},[3698],{"type":52,"value":496},{"type":47,"tag":476,"props":3700,"children":3701},{"style":499},[3702],{"type":52,"value":502},{"type":47,"tag":476,"props":3704,"children":3705},{"style":505},[3706],{"type":52,"value":1781},{"type":47,"tag":476,"props":3708,"children":3709},{"style":499},[3710],{"type":52,"value":513},{"type":47,"tag":476,"props":3712,"children":3713},{"style":493},[3714],{"type":52,"value":518},{"type":47,"tag":476,"props":3716,"children":3717},{"style":499},[3718],{"type":52,"value":523},{"type":47,"tag":476,"props":3720,"children":3721},{"style":526},[3722],{"type":52,"value":3723},"@\u002Finngest\u002Fchannels",{"type":47,"tag":476,"props":3725,"children":3726},{"style":499},[3727],{"type":52,"value":533},{"type":47,"tag":476,"props":3729,"children":3730},{"style":499},[3731],{"type":52,"value":538},{"type":47,"tag":476,"props":3733,"children":3734},{"class":478,"line":640},[3735],{"type":47,"tag":476,"props":3736,"children":3737},{"emptyLinePlaceholder":586},[3738],{"type":52,"value":589},{"type":47,"tag":476,"props":3740,"children":3741},{"class":478,"line":713},[3742,3746,3750,3755,3760,3764,3768,3772,3776,3780],{"type":47,"tag":476,"props":3743,"children":3744},{"style":493},[3745],{"type":52,"value":606},{"type":47,"tag":476,"props":3747,"children":3748},{"style":609},[3749],{"type":52,"value":2119},{"type":47,"tag":476,"props":3751,"children":3752},{"style":609},[3753],{"type":52,"value":3754}," function",{"type":47,"tag":476,"props":3756,"children":3757},{"style":625},[3758],{"type":52,"value":3759}," fetchOrderSubscriptionToken",{"type":47,"tag":476,"props":3761,"children":3762},{"style":499},[3763],{"type":52,"value":632},{"type":47,"tag":476,"props":3765,"children":3766},{"style":659},[3767],{"type":52,"value":662},{"type":47,"tag":476,"props":3769,"children":3770},{"style":499},[3771],{"type":52,"value":651},{"type":47,"tag":476,"props":3773,"children":3774},{"style":669},[3775],{"type":52,"value":672},{"type":47,"tag":476,"props":3777,"children":3778},{"style":499},[3779],{"type":52,"value":255},{"type":47,"tag":476,"props":3781,"children":3782},{"style":499},[3783],{"type":52,"value":729},{"type":47,"tag":476,"props":3785,"children":3786},{"class":478,"line":732},[3787],{"type":47,"tag":476,"props":3788,"children":3789},{"style":483},[3790],{"type":52,"value":3791},"  \u002F\u002F ⚠ AUTHORIZATION GATE: verify the current user owns this orderId\n",{"type":47,"tag":476,"props":3793,"children":3794},{"class":478,"line":749},[3795],{"type":47,"tag":476,"props":3796,"children":3797},{"style":483},[3798],{"type":52,"value":3799},"  \u002F\u002F before minting a token. Channels are addressable by ID, so without\n",{"type":47,"tag":476,"props":3801,"children":3802},{"class":478,"line":784},[3803],{"type":47,"tag":476,"props":3804,"children":3805},{"style":483},[3806],{"type":52,"value":3807},"  \u002F\u002F an ownership check, anyone can subscribe to any order's stream by\n",{"type":47,"tag":476,"props":3809,"children":3810},{"class":478,"line":819},[3811],{"type":47,"tag":476,"props":3812,"children":3813},{"style":483},[3814],{"type":52,"value":3815},"  \u002F\u002F guessing IDs.\n",{"type":47,"tag":476,"props":3817,"children":3818},{"class":478,"line":907},[3819],{"type":47,"tag":476,"props":3820,"children":3821},{"style":483},[3822],{"type":52,"value":3823},"  \u002F\u002F\n",{"type":47,"tag":476,"props":3825,"children":3826},{"class":478,"line":989},[3827],{"type":47,"tag":476,"props":3828,"children":3829},{"style":483},[3830],{"type":52,"value":3831},"  \u002F\u002F   const session = await getServerSession();\n",{"type":47,"tag":476,"props":3833,"children":3834},{"class":478,"line":1023},[3835],{"type":47,"tag":476,"props":3836,"children":3837},{"style":483},[3838],{"type":52,"value":3839},"  \u002F\u002F   if (!session) throw new Error('Unauthenticated');\n",{"type":47,"tag":476,"props":3841,"children":3842},{"class":478,"line":1040},[3843],{"type":47,"tag":476,"props":3844,"children":3845},{"style":483},[3846],{"type":52,"value":3847},"  \u002F\u002F   const order = await db.order.findUnique({ where: { id: orderId } });\n",{"type":47,"tag":476,"props":3849,"children":3850},{"class":478,"line":1049},[3851],{"type":47,"tag":476,"props":3852,"children":3853},{"style":483},[3854],{"type":52,"value":3855},"  \u002F\u002F   if (order?.userId !== session.userId) throw new Error('Forbidden');\n",{"type":47,"tag":476,"props":3857,"children":3858},{"class":478,"line":1058},[3859],{"type":47,"tag":476,"props":3860,"children":3861},{"emptyLinePlaceholder":586},[3862],{"type":52,"value":589},{"type":47,"tag":476,"props":3864,"children":3865},{"class":478,"line":1075},[3866,3871,3875,3879,3883,3887],{"type":47,"tag":476,"props":3867,"children":3868},{"style":493},[3869],{"type":52,"value":3870},"  return",{"type":47,"tag":476,"props":3872,"children":3873},{"style":625},[3874],{"type":52,"value":3626},{"type":47,"tag":476,"props":3876,"children":3877},{"style":717},[3878],{"type":52,"value":632},{"type":47,"tag":476,"props":3880,"children":3881},{"style":505},[3882],{"type":52,"value":8},{"type":47,"tag":476,"props":3884,"children":3885},{"style":499},[3886],{"type":52,"value":865},{"type":47,"tag":476,"props":3888,"children":3889},{"style":499},[3890],{"type":52,"value":729},{"type":47,"tag":476,"props":3892,"children":3893},{"class":478,"line":1083},[3894,3899,3903,3907,3911,3915,3919],{"type":47,"tag":476,"props":3895,"children":3896},{"style":717},[3897],{"type":52,"value":3898},"    channel",{"type":47,"tag":476,"props":3900,"children":3901},{"style":499},[3902],{"type":52,"value":651},{"type":47,"tag":476,"props":3904,"children":3905},{"style":625},[3906],{"type":52,"value":1781},{"type":47,"tag":476,"props":3908,"children":3909},{"style":717},[3910],{"type":52,"value":632},{"type":47,"tag":476,"props":3912,"children":3913},{"style":505},[3914],{"type":52,"value":662},{"type":47,"tag":476,"props":3916,"children":3917},{"style":717},[3918],{"type":52,"value":255},{"type":47,"tag":476,"props":3920,"children":3921},{"style":499},[3922],{"type":52,"value":710},{"type":47,"tag":476,"props":3924,"children":3925},{"class":478,"line":1092},[3926,3931,3935,3939,3943,3947,3951,3955],{"type":47,"tag":476,"props":3927,"children":3928},{"style":717},[3929],{"type":52,"value":3930},"    topics",{"type":47,"tag":476,"props":3932,"children":3933},{"style":499},[3934],{"type":52,"value":651},{"type":47,"tag":476,"props":3936,"children":3937},{"style":717},[3938],{"type":52,"value":1936},{"type":47,"tag":476,"props":3940,"children":3941},{"style":499},[3942],{"type":52,"value":533},{"type":47,"tag":476,"props":3944,"children":3945},{"style":526},[3946],{"type":52,"value":2412},{"type":47,"tag":476,"props":3948,"children":3949},{"style":499},[3950],{"type":52,"value":533},{"type":47,"tag":476,"props":3952,"children":3953},{"style":717},[3954],{"type":52,"value":1972},{"type":47,"tag":476,"props":3956,"children":3957},{"style":499},[3958],{"type":52,"value":710},{"type":47,"tag":476,"props":3960,"children":3961},{"class":478,"line":1125},[3962,3967,3971],{"type":47,"tag":476,"props":3963,"children":3964},{"style":499},[3965],{"type":52,"value":3966},"  }",{"type":47,"tag":476,"props":3968,"children":3969},{"style":717},[3970],{"type":52,"value":255},{"type":47,"tag":476,"props":3972,"children":3973},{"style":499},[3974],{"type":52,"value":538},{"type":47,"tag":476,"props":3976,"children":3977},{"class":478,"line":1154},[3978],{"type":47,"tag":476,"props":3979,"children":3980},{"style":499},[3981],{"type":52,"value":3982},"}\n",{"type":47,"tag":55,"props":3984,"children":3985},{},[3986,3992,3994,3999,4001,4006,4008,4014,4016,4021],{"type":47,"tag":103,"props":3987,"children":3989},{"className":3988},[],[3990],{"type":52,"value":3991},"getClientSubscriptionToken",{"type":52,"value":3993}," from ",{"type":47,"tag":103,"props":3995,"children":3997},{"className":3996},[],[3998],{"type":52,"value":3643},{"type":52,"value":4000}," returns a token shape that the ",{"type":47,"tag":103,"props":4002,"children":4004},{"className":4003},[],[4005],{"type":52,"value":442},{"type":52,"value":4007}," hook in Step 4 consumes directly. No ChannelInstance stripping needed — that gotcha only applies to the lower-level ",{"type":47,"tag":103,"props":4009,"children":4011},{"className":4010},[],[4012],{"type":52,"value":4013},"getSubscriptionToken",{"type":52,"value":4015}," + manual ",{"type":47,"tag":103,"props":4017,"children":4019},{"className":4018},[],[4020],{"type":52,"value":450},{"type":52,"value":4022}," path (see \"Pattern: Manual subscribe\" below).",{"type":47,"tag":192,"props":4024,"children":4026},{"id":4025},"step-4-subscribe-with-the-userealtime-hook",[4027,4029,4034],{"type":52,"value":4028},"Step 4: Subscribe with the ",{"type":47,"tag":103,"props":4030,"children":4032},{"className":4031},[],[4033],{"type":52,"value":442},{"type":52,"value":4035}," hook",{"type":47,"tag":55,"props":4037,"children":4038},{},[4039,4041,4046,4048,4053],{"type":52,"value":4040},"The recommended consumer for React\u002FNext.js is the ",{"type":47,"tag":103,"props":4042,"children":4044},{"className":4043},[],[4045],{"type":52,"value":442},{"type":52,"value":4047}," hook from ",{"type":47,"tag":103,"props":4049,"children":4051},{"className":4050},[],[4052],{"type":52,"value":3643},{"type":52,"value":4054},". It handles the subscription lifecycle, reconnect, type narrowing per topic, and cleanup.",{"type":47,"tag":465,"props":4056,"children":4058},{"className":467,"code":4057,"language":469,"meta":470,"style":470},"\u002F\u002F src\u002Fcomponents\u002FOrderStatusClient.tsx\n'use client';\n\nimport { useRealtime } from 'inngest\u002Freact';\nimport { orderChannel } from '@\u002Finngest\u002Fchannels';\nimport { fetchOrderSubscriptionToken } from '@\u002Fapp\u002Forders\u002F[orderId]\u002Factions';\n\nexport function OrderStatusClient({ orderId }: { orderId: string }) {\n  const { messages, connectionStatus, error } = useRealtime({\n    channel: orderChannel(orderId),\n    topics: ['step'] as const,\n    token: () => fetchOrderSubscriptionToken(orderId),\n  });\n\n  if (error) return \u003Cdiv>Error: {error.message}\u003C\u002Fdiv>;\n\n  return (\n    \u003Cdiv>\n      \u003Cdiv>Status: {connectionStatus}\u003C\u002Fdiv>\n      \u003Cul>\n        {messages.all.map((m, i) => (\n          \u003Cli key={i}>\n            {(m.data as { name: string }).name}: {(m.data as { status: string }).status}\n          \u003C\u002Fli>\n        ))}\n      \u003C\u002Ful>\n    \u003C\u002Fdiv>\n  );\n}\n",[4059],{"type":47,"tag":103,"props":4060,"children":4061},{"__ignoreMap":470},[4062,4070,4090,4097,4137,4176,4216,4223,4277,4332,4363,4408,4448,4463,4470,4550,4557,4568,4585,4637,4652,4713,4745,4851,4867,4879,4895,4911,4923],{"type":47,"tag":476,"props":4063,"children":4064},{"class":478,"line":479},[4065],{"type":47,"tag":476,"props":4066,"children":4067},{"style":483},[4068],{"type":52,"value":4069},"\u002F\u002F src\u002Fcomponents\u002FOrderStatusClient.tsx\n",{"type":47,"tag":476,"props":4071,"children":4072},{"class":478,"line":489},[4073,4077,4082,4086],{"type":47,"tag":476,"props":4074,"children":4075},{"style":499},[4076],{"type":52,"value":533},{"type":47,"tag":476,"props":4078,"children":4079},{"style":526},[4080],{"type":52,"value":4081},"use client",{"type":47,"tag":476,"props":4083,"children":4084},{"style":499},[4085],{"type":52,"value":533},{"type":47,"tag":476,"props":4087,"children":4088},{"style":499},[4089],{"type":52,"value":538},{"type":47,"tag":476,"props":4091,"children":4092},{"class":478,"line":541},[4093],{"type":47,"tag":476,"props":4094,"children":4095},{"emptyLinePlaceholder":586},[4096],{"type":52,"value":589},{"type":47,"tag":476,"props":4098,"children":4099},{"class":478,"line":582},[4100,4104,4108,4113,4117,4121,4125,4129,4133],{"type":47,"tag":476,"props":4101,"children":4102},{"style":493},[4103],{"type":52,"value":496},{"type":47,"tag":476,"props":4105,"children":4106},{"style":499},[4107],{"type":52,"value":502},{"type":47,"tag":476,"props":4109,"children":4110},{"style":505},[4111],{"type":52,"value":4112}," useRealtime",{"type":47,"tag":476,"props":4114,"children":4115},{"style":499},[4116],{"type":52,"value":513},{"type":47,"tag":476,"props":4118,"children":4119},{"style":493},[4120],{"type":52,"value":518},{"type":47,"tag":476,"props":4122,"children":4123},{"style":499},[4124],{"type":52,"value":523},{"type":47,"tag":476,"props":4126,"children":4127},{"style":526},[4128],{"type":52,"value":3643},{"type":47,"tag":476,"props":4130,"children":4131},{"style":499},[4132],{"type":52,"value":533},{"type":47,"tag":476,"props":4134,"children":4135},{"style":499},[4136],{"type":52,"value":538},{"type":47,"tag":476,"props":4138,"children":4139},{"class":478,"line":27},[4140,4144,4148,4152,4156,4160,4164,4168,4172],{"type":47,"tag":476,"props":4141,"children":4142},{"style":493},[4143],{"type":52,"value":496},{"type":47,"tag":476,"props":4145,"children":4146},{"style":499},[4147],{"type":52,"value":502},{"type":47,"tag":476,"props":4149,"children":4150},{"style":505},[4151],{"type":52,"value":1781},{"type":47,"tag":476,"props":4153,"children":4154},{"style":499},[4155],{"type":52,"value":513},{"type":47,"tag":476,"props":4157,"children":4158},{"style":493},[4159],{"type":52,"value":518},{"type":47,"tag":476,"props":4161,"children":4162},{"style":499},[4163],{"type":52,"value":523},{"type":47,"tag":476,"props":4165,"children":4166},{"style":526},[4167],{"type":52,"value":3723},{"type":47,"tag":476,"props":4169,"children":4170},{"style":499},[4171],{"type":52,"value":533},{"type":47,"tag":476,"props":4173,"children":4174},{"style":499},[4175],{"type":52,"value":538},{"type":47,"tag":476,"props":4177,"children":4178},{"class":478,"line":600},[4179,4183,4187,4191,4195,4199,4203,4208,4212],{"type":47,"tag":476,"props":4180,"children":4181},{"style":493},[4182],{"type":52,"value":496},{"type":47,"tag":476,"props":4184,"children":4185},{"style":499},[4186],{"type":52,"value":502},{"type":47,"tag":476,"props":4188,"children":4189},{"style":505},[4190],{"type":52,"value":3759},{"type":47,"tag":476,"props":4192,"children":4193},{"style":499},[4194],{"type":52,"value":513},{"type":47,"tag":476,"props":4196,"children":4197},{"style":493},[4198],{"type":52,"value":518},{"type":47,"tag":476,"props":4200,"children":4201},{"style":499},[4202],{"type":52,"value":523},{"type":47,"tag":476,"props":4204,"children":4205},{"style":526},[4206],{"type":52,"value":4207},"@\u002Fapp\u002Forders\u002F[orderId]\u002Factions",{"type":47,"tag":476,"props":4209,"children":4210},{"style":499},[4211],{"type":52,"value":533},{"type":47,"tag":476,"props":4213,"children":4214},{"style":499},[4215],{"type":52,"value":538},{"type":47,"tag":476,"props":4217,"children":4218},{"class":478,"line":640},[4219],{"type":47,"tag":476,"props":4220,"children":4221},{"emptyLinePlaceholder":586},[4222],{"type":52,"value":589},{"type":47,"tag":476,"props":4224,"children":4225},{"class":478,"line":713},[4226,4230,4234,4239,4244,4248,4253,4257,4261,4265,4269,4273],{"type":47,"tag":476,"props":4227,"children":4228},{"style":493},[4229],{"type":52,"value":606},{"type":47,"tag":476,"props":4231,"children":4232},{"style":609},[4233],{"type":52,"value":3754},{"type":47,"tag":476,"props":4235,"children":4236},{"style":625},[4237],{"type":52,"value":4238}," OrderStatusClient",{"type":47,"tag":476,"props":4240,"children":4241},{"style":499},[4242],{"type":52,"value":4243},"({",{"type":47,"tag":476,"props":4245,"children":4246},{"style":659},[4247],{"type":52,"value":2039},{"type":47,"tag":476,"props":4249,"children":4250},{"style":499},[4251],{"type":52,"value":4252}," }:",{"type":47,"tag":476,"props":4254,"children":4255},{"style":499},[4256],{"type":52,"value":502},{"type":47,"tag":476,"props":4258,"children":4259},{"style":717},[4260],{"type":52,"value":2039},{"type":47,"tag":476,"props":4262,"children":4263},{"style":499},[4264],{"type":52,"value":651},{"type":47,"tag":476,"props":4266,"children":4267},{"style":669},[4268],{"type":52,"value":672},{"type":47,"tag":476,"props":4270,"children":4271},{"style":499},[4272],{"type":52,"value":2014},{"type":47,"tag":476,"props":4274,"children":4275},{"style":499},[4276],{"type":52,"value":729},{"type":47,"tag":476,"props":4278,"children":4279},{"class":478,"line":732},[4280,4285,4289,4294,4298,4303,4307,4312,4316,4320,4324,4328],{"type":47,"tag":476,"props":4281,"children":4282},{"style":609},[4283],{"type":52,"value":4284},"  const",{"type":47,"tag":476,"props":4286,"children":4287},{"style":499},[4288],{"type":52,"value":502},{"type":47,"tag":476,"props":4290,"children":4291},{"style":505},[4292],{"type":52,"value":4293}," messages",{"type":47,"tag":476,"props":4295,"children":4296},{"style":499},[4297],{"type":52,"value":865},{"type":47,"tag":476,"props":4299,"children":4300},{"style":505},[4301],{"type":52,"value":4302}," connectionStatus",{"type":47,"tag":476,"props":4304,"children":4305},{"style":499},[4306],{"type":52,"value":865},{"type":47,"tag":476,"props":4308,"children":4309},{"style":505},[4310],{"type":52,"value":4311}," error",{"type":47,"tag":476,"props":4313,"children":4314},{"style":499},[4315],{"type":52,"value":513},{"type":47,"tag":476,"props":4317,"children":4318},{"style":499},[4319],{"type":52,"value":2066},{"type":47,"tag":476,"props":4321,"children":4322},{"style":625},[4323],{"type":52,"value":4112},{"type":47,"tag":476,"props":4325,"children":4326},{"style":717},[4327],{"type":52,"value":632},{"type":47,"tag":476,"props":4329,"children":4330},{"style":499},[4331],{"type":52,"value":637},{"type":47,"tag":476,"props":4333,"children":4334},{"class":478,"line":749},[4335,4339,4343,4347,4351,4355,4359],{"type":47,"tag":476,"props":4336,"children":4337},{"style":717},[4338],{"type":52,"value":3898},{"type":47,"tag":476,"props":4340,"children":4341},{"style":499},[4342],{"type":52,"value":651},{"type":47,"tag":476,"props":4344,"children":4345},{"style":625},[4346],{"type":52,"value":1781},{"type":47,"tag":476,"props":4348,"children":4349},{"style":717},[4350],{"type":52,"value":632},{"type":47,"tag":476,"props":4352,"children":4353},{"style":505},[4354],{"type":52,"value":662},{"type":47,"tag":476,"props":4356,"children":4357},{"style":717},[4358],{"type":52,"value":255},{"type":47,"tag":476,"props":4360,"children":4361},{"style":499},[4362],{"type":52,"value":710},{"type":47,"tag":476,"props":4364,"children":4365},{"class":478,"line":784},[4366,4370,4374,4378,4382,4386,4390,4395,4400,4404],{"type":47,"tag":476,"props":4367,"children":4368},{"style":717},[4369],{"type":52,"value":3930},{"type":47,"tag":476,"props":4371,"children":4372},{"style":499},[4373],{"type":52,"value":651},{"type":47,"tag":476,"props":4375,"children":4376},{"style":717},[4377],{"type":52,"value":1936},{"type":47,"tag":476,"props":4379,"children":4380},{"style":499},[4381],{"type":52,"value":533},{"type":47,"tag":476,"props":4383,"children":4384},{"style":526},[4385],{"type":52,"value":2412},{"type":47,"tag":476,"props":4387,"children":4388},{"style":499},[4389],{"type":52,"value":533},{"type":47,"tag":476,"props":4391,"children":4392},{"style":717},[4393],{"type":52,"value":4394},"] ",{"type":47,"tag":476,"props":4396,"children":4397},{"style":493},[4398],{"type":52,"value":4399},"as",{"type":47,"tag":476,"props":4401,"children":4402},{"style":609},[4403],{"type":52,"value":612},{"type":47,"tag":476,"props":4405,"children":4406},{"style":499},[4407],{"type":52,"value":710},{"type":47,"tag":476,"props":4409,"children":4410},{"class":478,"line":819},[4411,4416,4420,4424,4428,4432,4436,4440,4444],{"type":47,"tag":476,"props":4412,"children":4413},{"style":625},[4414],{"type":52,"value":4415},"    token",{"type":47,"tag":476,"props":4417,"children":4418},{"style":499},[4419],{"type":52,"value":651},{"type":47,"tag":476,"props":4421,"children":4422},{"style":499},[4423],{"type":52,"value":2775},{"type":47,"tag":476,"props":4425,"children":4426},{"style":609},[4427],{"type":52,"value":681},{"type":47,"tag":476,"props":4429,"children":4430},{"style":625},[4431],{"type":52,"value":3759},{"type":47,"tag":476,"props":4433,"children":4434},{"style":717},[4435],{"type":52,"value":632},{"type":47,"tag":476,"props":4437,"children":4438},{"style":505},[4439],{"type":52,"value":662},{"type":47,"tag":476,"props":4441,"children":4442},{"style":717},[4443],{"type":52,"value":255},{"type":47,"tag":476,"props":4445,"children":4446},{"style":499},[4447],{"type":52,"value":710},{"type":47,"tag":476,"props":4449,"children":4450},{"class":478,"line":907},[4451,4455,4459],{"type":47,"tag":476,"props":4452,"children":4453},{"style":499},[4454],{"type":52,"value":3966},{"type":47,"tag":476,"props":4456,"children":4457},{"style":717},[4458],{"type":52,"value":255},{"type":47,"tag":476,"props":4460,"children":4461},{"style":499},[4462],{"type":52,"value":538},{"type":47,"tag":476,"props":4464,"children":4465},{"class":478,"line":989},[4466],{"type":47,"tag":476,"props":4467,"children":4468},{"emptyLinePlaceholder":586},[4469],{"type":52,"value":589},{"type":47,"tag":476,"props":4471,"children":4472},{"class":478,"line":1023},[4473,4478,4482,4487,4492,4497,4502,4507,4512,4517,4522,4526,4531,4536,4541,4545],{"type":47,"tag":476,"props":4474,"children":4475},{"style":493},[4476],{"type":52,"value":4477},"  if",{"type":47,"tag":476,"props":4479,"children":4480},{"style":717},[4481],{"type":52,"value":656},{"type":47,"tag":476,"props":4483,"children":4484},{"style":505},[4485],{"type":52,"value":4486},"error",{"type":47,"tag":476,"props":4488,"children":4489},{"style":717},[4490],{"type":52,"value":4491},") ",{"type":47,"tag":476,"props":4493,"children":4494},{"style":493},[4495],{"type":52,"value":4496},"return",{"type":47,"tag":476,"props":4498,"children":4499},{"style":717},[4500],{"type":52,"value":4501}," \u003C",{"type":47,"tag":476,"props":4503,"children":4504},{"style":669},[4505],{"type":52,"value":4506},"div",{"type":47,"tag":476,"props":4508,"children":4509},{"style":717},[4510],{"type":52,"value":4511},">",{"type":47,"tag":476,"props":4513,"children":4514},{"style":505},[4515],{"type":52,"value":4516},"Error",{"type":47,"tag":476,"props":4518,"children":4519},{"style":717},[4520],{"type":52,"value":4521},": ",{"type":47,"tag":476,"props":4523,"children":4524},{"style":499},[4525],{"type":52,"value":1941},{"type":47,"tag":476,"props":4527,"children":4528},{"style":717},[4529],{"type":52,"value":4530},"error.",{"type":47,"tag":476,"props":4532,"children":4533},{"style":505},[4534],{"type":52,"value":4535},"message",{"type":47,"tag":476,"props":4537,"children":4538},{"style":499},[4539],{"type":52,"value":4540},"}\u003C\u002F",{"type":47,"tag":476,"props":4542,"children":4543},{"style":505},[4544],{"type":52,"value":4506},{"type":47,"tag":476,"props":4546,"children":4547},{"style":499},[4548],{"type":52,"value":4549},">;\n",{"type":47,"tag":476,"props":4551,"children":4552},{"class":478,"line":1040},[4553],{"type":47,"tag":476,"props":4554,"children":4555},{"emptyLinePlaceholder":586},[4556],{"type":52,"value":589},{"type":47,"tag":476,"props":4558,"children":4559},{"class":478,"line":1049},[4560,4564],{"type":47,"tag":476,"props":4561,"children":4562},{"style":493},[4563],{"type":52,"value":3870},{"type":47,"tag":476,"props":4565,"children":4566},{"style":717},[4567],{"type":52,"value":2124},{"type":47,"tag":476,"props":4569,"children":4570},{"class":478,"line":1058},[4571,4576,4580],{"type":47,"tag":476,"props":4572,"children":4573},{"style":717},[4574],{"type":52,"value":4575},"    \u003C",{"type":47,"tag":476,"props":4577,"children":4578},{"style":669},[4579],{"type":52,"value":4506},{"type":47,"tag":476,"props":4581,"children":4582},{"style":717},[4583],{"type":52,"value":4584},">\n",{"type":47,"tag":476,"props":4586,"children":4587},{"class":478,"line":1075},[4588,4593,4597,4601,4606,4610,4614,4619,4624,4629,4633],{"type":47,"tag":476,"props":4589,"children":4590},{"style":717},[4591],{"type":52,"value":4592},"      \u003C",{"type":47,"tag":476,"props":4594,"children":4595},{"style":669},[4596],{"type":52,"value":4506},{"type":47,"tag":476,"props":4598,"children":4599},{"style":717},[4600],{"type":52,"value":4511},{"type":47,"tag":476,"props":4602,"children":4603},{"style":659},[4604],{"type":52,"value":4605},"Status",{"type":47,"tag":476,"props":4607,"children":4608},{"style":499},[4609],{"type":52,"value":651},{"type":47,"tag":476,"props":4611,"children":4612},{"style":499},[4613],{"type":52,"value":502},{"type":47,"tag":476,"props":4615,"children":4616},{"style":717},[4617],{"type":52,"value":4618},"connectionStatus",{"type":47,"tag":476,"props":4620,"children":4621},{"style":499},[4622],{"type":52,"value":4623},"}\u003C",{"type":47,"tag":476,"props":4625,"children":4626},{"style":717},[4627],{"type":52,"value":4628},"\u002F",{"type":47,"tag":476,"props":4630,"children":4631},{"style":669},[4632],{"type":52,"value":4506},{"type":47,"tag":476,"props":4634,"children":4635},{"style":499},[4636],{"type":52,"value":4584},{"type":47,"tag":476,"props":4638,"children":4639},{"class":478,"line":1083},[4640,4644,4648],{"type":47,"tag":476,"props":4641,"children":4642},{"style":717},[4643],{"type":52,"value":4592},{"type":47,"tag":476,"props":4645,"children":4646},{"style":669},[4647],{"type":52,"value":199},{"type":47,"tag":476,"props":4649,"children":4650},{"style":717},[4651],{"type":52,"value":4584},{"type":47,"tag":476,"props":4653,"children":4654},{"class":478,"line":1092},[4655,4659,4664,4668,4673,4677,4682,4687,4692,4696,4701,4705,4709],{"type":47,"tag":476,"props":4656,"children":4657},{"style":499},[4658],{"type":52,"value":2424},{"type":47,"tag":476,"props":4660,"children":4661},{"style":659},[4662],{"type":52,"value":4663},"messages",{"type":47,"tag":476,"props":4665,"children":4666},{"style":717},[4667],{"type":52,"value":768},{"type":47,"tag":476,"props":4669,"children":4670},{"style":659},[4671],{"type":52,"value":4672},"all",{"type":47,"tag":476,"props":4674,"children":4675},{"style":717},[4676],{"type":52,"value":768},{"type":47,"tag":476,"props":4678,"children":4679},{"style":659},[4680],{"type":52,"value":4681},"map",{"type":47,"tag":476,"props":4683,"children":4684},{"style":717},[4685],{"type":52,"value":4686},"((",{"type":47,"tag":476,"props":4688,"children":4689},{"style":659},[4690],{"type":52,"value":4691},"m",{"type":47,"tag":476,"props":4693,"children":4694},{"style":499},[4695],{"type":52,"value":865},{"type":47,"tag":476,"props":4697,"children":4698},{"style":659},[4699],{"type":52,"value":4700}," i",{"type":47,"tag":476,"props":4702,"children":4703},{"style":717},[4704],{"type":52,"value":4491},{"type":47,"tag":476,"props":4706,"children":4707},{"style":499},[4708],{"type":52,"value":2259},{"type":47,"tag":476,"props":4710,"children":4711},{"style":717},[4712],{"type":52,"value":2124},{"type":47,"tag":476,"props":4714,"children":4715},{"class":478,"line":1125},[4716,4721,4725,4730,4735,4740],{"type":47,"tag":476,"props":4717,"children":4718},{"style":499},[4719],{"type":52,"value":4720},"          \u003C",{"type":47,"tag":476,"props":4722,"children":4723},{"style":505},[4724],{"type":52,"value":203},{"type":47,"tag":476,"props":4726,"children":4727},{"style":505},[4728],{"type":52,"value":4729}," key",{"type":47,"tag":476,"props":4731,"children":4732},{"style":499},[4733],{"type":52,"value":4734},"={",{"type":47,"tag":476,"props":4736,"children":4737},{"style":505},[4738],{"type":52,"value":4739},"i",{"type":47,"tag":476,"props":4741,"children":4742},{"style":499},[4743],{"type":52,"value":4744},"}>\n",{"type":47,"tag":476,"props":4746,"children":4747},{"class":478,"line":1154},[4748,4753,4757,4761,4765,4769,4774,4778,4782,4786,4790,4794,4799,4803,4808,4813,4818,4822,4826,4830,4834,4838,4842,4847],{"type":47,"tag":476,"props":4749,"children":4750},{"style":499},[4751],{"type":52,"value":4752},"            {",{"type":47,"tag":476,"props":4754,"children":4755},{"style":717},[4756],{"type":52,"value":632},{"type":47,"tag":476,"props":4758,"children":4759},{"style":659},[4760],{"type":52,"value":4691},{"type":47,"tag":476,"props":4762,"children":4763},{"style":717},[4764],{"type":52,"value":768},{"type":47,"tag":476,"props":4766,"children":4767},{"style":659},[4768],{"type":52,"value":2079},{"type":47,"tag":476,"props":4770,"children":4771},{"style":659},[4772],{"type":52,"value":4773}," as",{"type":47,"tag":476,"props":4775,"children":4776},{"style":499},[4777],{"type":52,"value":502},{"type":47,"tag":476,"props":4779,"children":4780},{"style":717},[4781],{"type":52,"value":2429},{"type":47,"tag":476,"props":4783,"children":4784},{"style":499},[4785],{"type":52,"value":651},{"type":47,"tag":476,"props":4787,"children":4788},{"style":659},[4789],{"type":52,"value":672},{"type":47,"tag":476,"props":4791,"children":4792},{"style":499},[4793],{"type":52,"value":513},{"type":47,"tag":476,"props":4795,"children":4796},{"style":717},[4797],{"type":52,"value":4798},").",{"type":47,"tag":476,"props":4800,"children":4801},{"style":659},[4802],{"type":52,"value":2357},{"type":47,"tag":476,"props":4804,"children":4805},{"style":499},[4806],{"type":52,"value":4807},"}:",{"type":47,"tag":476,"props":4809,"children":4810},{"style":499},[4811],{"type":52,"value":4812}," {(",{"type":47,"tag":476,"props":4814,"children":4815},{"style":717},[4816],{"type":52,"value":4817},"m.data ",{"type":47,"tag":476,"props":4819,"children":4820},{"style":659},[4821],{"type":52,"value":4399},{"type":47,"tag":476,"props":4823,"children":4824},{"style":499},[4825],{"type":52,"value":502},{"type":47,"tag":476,"props":4827,"children":4828},{"style":717},[4829],{"type":52,"value":2438},{"type":47,"tag":476,"props":4831,"children":4832},{"style":499},[4833],{"type":52,"value":651},{"type":47,"tag":476,"props":4835,"children":4836},{"style":659},[4837],{"type":52,"value":672},{"type":47,"tag":476,"props":4839,"children":4840},{"style":499},[4841],{"type":52,"value":2014},{"type":47,"tag":476,"props":4843,"children":4844},{"style":717},[4845],{"type":52,"value":4846},".status",{"type":47,"tag":476,"props":4848,"children":4849},{"style":499},[4850],{"type":52,"value":3982},{"type":47,"tag":476,"props":4852,"children":4853},{"class":478,"line":1170},[4854,4859,4863],{"type":47,"tag":476,"props":4855,"children":4856},{"style":499},[4857],{"type":52,"value":4858},"          \u003C\u002F",{"type":47,"tag":476,"props":4860,"children":4861},{"style":505},[4862],{"type":52,"value":203},{"type":47,"tag":476,"props":4864,"children":4865},{"style":499},[4866],{"type":52,"value":4584},{"type":47,"tag":476,"props":4868,"children":4869},{"class":478,"line":1187},[4870,4875],{"type":47,"tag":476,"props":4871,"children":4872},{"style":717},[4873],{"type":52,"value":4874},"        ))",{"type":47,"tag":476,"props":4876,"children":4877},{"style":499},[4878],{"type":52,"value":3982},{"type":47,"tag":476,"props":4880,"children":4881},{"class":478,"line":23},[4882,4887,4891],{"type":47,"tag":476,"props":4883,"children":4884},{"style":499},[4885],{"type":52,"value":4886},"      \u003C\u002F",{"type":47,"tag":476,"props":4888,"children":4889},{"style":505},[4890],{"type":52,"value":199},{"type":47,"tag":476,"props":4892,"children":4893},{"style":499},[4894],{"type":52,"value":4584},{"type":47,"tag":476,"props":4896,"children":4897},{"class":478,"line":1251},[4898,4903,4907],{"type":47,"tag":476,"props":4899,"children":4900},{"style":499},[4901],{"type":52,"value":4902},"    \u003C\u002F",{"type":47,"tag":476,"props":4904,"children":4905},{"style":505},[4906],{"type":52,"value":4506},{"type":47,"tag":476,"props":4908,"children":4909},{"style":499},[4910],{"type":52,"value":4584},{"type":47,"tag":476,"props":4912,"children":4913},{"class":478,"line":1284},[4914,4919],{"type":47,"tag":476,"props":4915,"children":4916},{"style":717},[4917],{"type":52,"value":4918},"  )",{"type":47,"tag":476,"props":4920,"children":4921},{"style":499},[4922],{"type":52,"value":538},{"type":47,"tag":476,"props":4924,"children":4925},{"class":478,"line":1364},[4926],{"type":47,"tag":476,"props":4927,"children":4928},{"style":499},[4929],{"type":52,"value":3982},{"type":47,"tag":55,"props":4931,"children":4932},{},[4933],{"type":47,"tag":68,"props":4934,"children":4935},{},[4936],{"type":52,"value":4937},"Useful options on the hook:",{"type":47,"tag":276,"props":4939,"children":4940},{},[4941,4962],{"type":47,"tag":280,"props":4942,"children":4943},{},[4944],{"type":47,"tag":284,"props":4945,"children":4946},{},[4947,4952,4957],{"type":47,"tag":288,"props":4948,"children":4949},{},[4950],{"type":52,"value":4951},"Option",{"type":47,"tag":288,"props":4953,"children":4954},{},[4955],{"type":52,"value":4956},"Default",{"type":47,"tag":288,"props":4958,"children":4959},{},[4960],{"type":52,"value":4961},"Use it when",{"type":47,"tag":299,"props":4963,"children":4964},{},[4965,4998,5024,5050,5075],{"type":47,"tag":284,"props":4966,"children":4967},{},[4968,4977,4986],{"type":47,"tag":306,"props":4969,"children":4970},{},[4971],{"type":47,"tag":103,"props":4972,"children":4974},{"className":4973},[],[4975],{"type":52,"value":4976},"enabled",{"type":47,"tag":306,"props":4978,"children":4979},{},[4980],{"type":47,"tag":103,"props":4981,"children":4983},{"className":4982},[],[4984],{"type":52,"value":4985},"true",{"type":47,"tag":306,"props":4987,"children":4988},{},[4989,4991,4997],{"type":52,"value":4990},"Delay the subscription until you have an ID (e.g., ",{"type":47,"tag":103,"props":4992,"children":4994},{"className":4993},[],[4995],{"type":52,"value":4996},"enabled: !!runId",{"type":52,"value":4798},{"type":47,"tag":284,"props":4999,"children":5000},{},[5001,5010,5019],{"type":47,"tag":306,"props":5002,"children":5003},{},[5004],{"type":47,"tag":103,"props":5005,"children":5007},{"className":5006},[],[5008],{"type":52,"value":5009},"bufferInterval",{"type":47,"tag":306,"props":5011,"children":5012},{},[5013],{"type":47,"tag":103,"props":5014,"children":5016},{"className":5015},[],[5017],{"type":52,"value":5018},"0",{"type":47,"tag":306,"props":5020,"children":5021},{},[5022],{"type":52,"value":5023},"Batch updates from a fast stream so React doesn't re-render per message.",{"type":47,"tag":284,"props":5025,"children":5026},{},[5027,5036,5045],{"type":47,"tag":306,"props":5028,"children":5029},{},[5030],{"type":47,"tag":103,"props":5031,"children":5033},{"className":5032},[],[5034],{"type":52,"value":5035},"pauseOnHidden",{"type":47,"tag":306,"props":5037,"children":5038},{},[5039],{"type":47,"tag":103,"props":5040,"children":5042},{"className":5041},[],[5043],{"type":52,"value":5044},"false",{"type":47,"tag":306,"props":5046,"children":5047},{},[5048],{"type":52,"value":5049},"Pause the stream when the tab isn't visible (saves bandwidth).",{"type":47,"tag":284,"props":5051,"children":5052},{},[5053,5062,5070],{"type":47,"tag":306,"props":5054,"children":5055},{},[5056],{"type":47,"tag":103,"props":5057,"children":5059},{"className":5058},[],[5060],{"type":52,"value":5061},"autoCloseOnTerminal",{"type":47,"tag":306,"props":5063,"children":5064},{},[5065],{"type":47,"tag":103,"props":5066,"children":5068},{"className":5067},[],[5069],{"type":52,"value":4985},{"type":47,"tag":306,"props":5071,"children":5072},{},[5073],{"type":52,"value":5074},"Disconnect when the run completes — turn off to keep the stream open for fan-out channels.",{"type":47,"tag":284,"props":5076,"children":5077},{},[5078,5087,5092],{"type":47,"tag":306,"props":5079,"children":5080},{},[5081],{"type":47,"tag":103,"props":5082,"children":5084},{"className":5083},[],[5085],{"type":52,"value":5086},"historyLimit",{"type":47,"tag":306,"props":5088,"children":5089},{},[5090],{"type":52,"value":5091},"unbounded",{"type":47,"tag":306,"props":5093,"children":5094},{},[5095,5097,5103],{"type":52,"value":5096},"Cap how many messages are retained in ",{"type":47,"tag":103,"props":5098,"children":5100},{"className":5099},[],[5101],{"type":52,"value":5102},"messages.all",{"type":52,"value":768},{"type":47,"tag":55,"props":5105,"children":5106},{},[5107,5109,5115,5117,5122,5124,5130,5132,5138],{"type":52,"value":5108},"The hook returns ",{"type":47,"tag":103,"props":5110,"children":5112},{"className":5111},[],[5113],{"type":52,"value":5114},"messages.byTopic",{"type":52,"value":5116}," (latest per topic), ",{"type":47,"tag":103,"props":5118,"children":5120},{"className":5119},[],[5121],{"type":52,"value":5102},{"type":52,"value":5123}," (full history), ",{"type":47,"tag":103,"props":5125,"children":5127},{"className":5126},[],[5128],{"type":52,"value":5129},"messages.last",{"type":52,"value":5131}," (most recent), and ",{"type":47,"tag":103,"props":5133,"children":5135},{"className":5134},[],[5136],{"type":52,"value":5137},"messages.delta",{"type":52,"value":5139}," (new since last render).",{"type":47,"tag":192,"props":5141,"children":5143},{"id":5142},"pattern-manual-subscribe-non-react-or-custom-transport",[5144],{"type":52,"value":5145},"Pattern: Manual subscribe (non-React or custom transport)",{"type":47,"tag":55,"props":5147,"children":5148},{},[5149,5151,5156,5158,5163],{"type":52,"value":5150},"The ",{"type":47,"tag":103,"props":5152,"children":5154},{"className":5153},[],[5155],{"type":52,"value":442},{"type":52,"value":5157}," hook covers the React case. If you're not using React, or you need a custom subscription lifecycle (server-side streaming, background workers, custom protocols), use the lower-level ",{"type":47,"tag":103,"props":5159,"children":5161},{"className":5160},[],[5162],{"type":52,"value":450},{"type":52,"value":5164}," API directly.",{"type":47,"tag":1518,"props":5166,"children":5168},{"id":5167},"server-action-mint-a-token-with-the-lower-level-helper",[5169],{"type":52,"value":5170},"Server action: mint a token with the lower-level helper",{"type":47,"tag":465,"props":5172,"children":5174},{"className":467,"code":5173,"language":469,"meta":470,"style":470},"\u002F\u002F src\u002Fapp\u002Forders\u002F[orderId]\u002Factions.ts\n'use server';\n\nimport { getSubscriptionToken } from 'inngest\u002Frealtime';\nimport { inngest } from '@\u002Finngest\u002Fclient';\nimport { orderChannel } from '@\u002Finngest\u002Fchannels';\n\nexport async function fetchOrderSubscriptionTokenLowLevel(orderId: string) {\n  \u002F\u002F ⚠ AUTHORIZATION GATE: same as Step 3 — verify ownership before minting.\n\n  const token = await getSubscriptionToken(inngest, {\n    channel: orderChannel(orderId),\n    topics: ['step'],\n  });\n\n  \u002F\u002F ⚠ CRITICAL: strip the ChannelInstance from the response.\n  \u002F\u002F getSubscriptionToken returns { channel: ChannelInstance, ... } where\n  \u002F\u002F ChannelInstance contains zod schema methods (a class with prototypes).\n  \u002F\u002F Next.js refuses to serialize classes across the server-action → client-component\n  \u002F\u002F boundary, so return ONLY primitives.\n  return {\n    channel: orderChannel(orderId).name as string,\n    topics: ['step'] as const,\n    key: token.key,\n    apiBaseUrl: token.apiBaseUrl,\n  };\n}\n",[5175],{"type":47,"tag":103,"props":5176,"children":5177},{"__ignoreMap":470},[5178,5185,5204,5211,5251,5290,5329,5336,5380,5388,5395,5435,5466,5501,5516,5523,5531,5539,5547,5555,5563,5574,5621,5664,5693,5722,5730],{"type":47,"tag":476,"props":5179,"children":5180},{"class":478,"line":479},[5181],{"type":47,"tag":476,"props":5182,"children":5183},{"style":483},[5184],{"type":52,"value":3583},{"type":47,"tag":476,"props":5186,"children":5187},{"class":478,"line":489},[5188,5192,5196,5200],{"type":47,"tag":476,"props":5189,"children":5190},{"style":499},[5191],{"type":52,"value":533},{"type":47,"tag":476,"props":5193,"children":5194},{"style":526},[5195],{"type":52,"value":3595},{"type":47,"tag":476,"props":5197,"children":5198},{"style":499},[5199],{"type":52,"value":533},{"type":47,"tag":476,"props":5201,"children":5202},{"style":499},[5203],{"type":52,"value":538},{"type":47,"tag":476,"props":5205,"children":5206},{"class":478,"line":541},[5207],{"type":47,"tag":476,"props":5208,"children":5209},{"emptyLinePlaceholder":586},[5210],{"type":52,"value":589},{"type":47,"tag":476,"props":5212,"children":5213},{"class":478,"line":582},[5214,5218,5222,5227,5231,5235,5239,5243,5247],{"type":47,"tag":476,"props":5215,"children":5216},{"style":493},[5217],{"type":52,"value":496},{"type":47,"tag":476,"props":5219,"children":5220},{"style":499},[5221],{"type":52,"value":502},{"type":47,"tag":476,"props":5223,"children":5224},{"style":505},[5225],{"type":52,"value":5226}," getSubscriptionToken",{"type":47,"tag":476,"props":5228,"children":5229},{"style":499},[5230],{"type":52,"value":513},{"type":47,"tag":476,"props":5232,"children":5233},{"style":493},[5234],{"type":52,"value":518},{"type":47,"tag":476,"props":5236,"children":5237},{"style":499},[5238],{"type":52,"value":523},{"type":47,"tag":476,"props":5240,"children":5241},{"style":526},[5242],{"type":52,"value":108},{"type":47,"tag":476,"props":5244,"children":5245},{"style":499},[5246],{"type":52,"value":533},{"type":47,"tag":476,"props":5248,"children":5249},{"style":499},[5250],{"type":52,"value":538},{"type":47,"tag":476,"props":5252,"children":5253},{"class":478,"line":27},[5254,5258,5262,5266,5270,5274,5278,5282,5286],{"type":47,"tag":476,"props":5255,"children":5256},{"style":493},[5257],{"type":52,"value":496},{"type":47,"tag":476,"props":5259,"children":5260},{"style":499},[5261],{"type":52,"value":502},{"type":47,"tag":476,"props":5263,"children":5264},{"style":505},[5265],{"type":52,"value":1740},{"type":47,"tag":476,"props":5267,"children":5268},{"style":499},[5269],{"type":52,"value":513},{"type":47,"tag":476,"props":5271,"children":5272},{"style":493},[5273],{"type":52,"value":518},{"type":47,"tag":476,"props":5275,"children":5276},{"style":499},[5277],{"type":52,"value":523},{"type":47,"tag":476,"props":5279,"children":5280},{"style":526},[5281],{"type":52,"value":3683},{"type":47,"tag":476,"props":5283,"children":5284},{"style":499},[5285],{"type":52,"value":533},{"type":47,"tag":476,"props":5287,"children":5288},{"style":499},[5289],{"type":52,"value":538},{"type":47,"tag":476,"props":5291,"children":5292},{"class":478,"line":600},[5293,5297,5301,5305,5309,5313,5317,5321,5325],{"type":47,"tag":476,"props":5294,"children":5295},{"style":493},[5296],{"type":52,"value":496},{"type":47,"tag":476,"props":5298,"children":5299},{"style":499},[5300],{"type":52,"value":502},{"type":47,"tag":476,"props":5302,"children":5303},{"style":505},[5304],{"type":52,"value":1781},{"type":47,"tag":476,"props":5306,"children":5307},{"style":499},[5308],{"type":52,"value":513},{"type":47,"tag":476,"props":5310,"children":5311},{"style":493},[5312],{"type":52,"value":518},{"type":47,"tag":476,"props":5314,"children":5315},{"style":499},[5316],{"type":52,"value":523},{"type":47,"tag":476,"props":5318,"children":5319},{"style":526},[5320],{"type":52,"value":3723},{"type":47,"tag":476,"props":5322,"children":5323},{"style":499},[5324],{"type":52,"value":533},{"type":47,"tag":476,"props":5326,"children":5327},{"style":499},[5328],{"type":52,"value":538},{"type":47,"tag":476,"props":5330,"children":5331},{"class":478,"line":640},[5332],{"type":47,"tag":476,"props":5333,"children":5334},{"emptyLinePlaceholder":586},[5335],{"type":52,"value":589},{"type":47,"tag":476,"props":5337,"children":5338},{"class":478,"line":713},[5339,5343,5347,5351,5356,5360,5364,5368,5372,5376],{"type":47,"tag":476,"props":5340,"children":5341},{"style":493},[5342],{"type":52,"value":606},{"type":47,"tag":476,"props":5344,"children":5345},{"style":609},[5346],{"type":52,"value":2119},{"type":47,"tag":476,"props":5348,"children":5349},{"style":609},[5350],{"type":52,"value":3754},{"type":47,"tag":476,"props":5352,"children":5353},{"style":625},[5354],{"type":52,"value":5355}," fetchOrderSubscriptionTokenLowLevel",{"type":47,"tag":476,"props":5357,"children":5358},{"style":499},[5359],{"type":52,"value":632},{"type":47,"tag":476,"props":5361,"children":5362},{"style":659},[5363],{"type":52,"value":662},{"type":47,"tag":476,"props":5365,"children":5366},{"style":499},[5367],{"type":52,"value":651},{"type":47,"tag":476,"props":5369,"children":5370},{"style":669},[5371],{"type":52,"value":672},{"type":47,"tag":476,"props":5373,"children":5374},{"style":499},[5375],{"type":52,"value":255},{"type":47,"tag":476,"props":5377,"children":5378},{"style":499},[5379],{"type":52,"value":729},{"type":47,"tag":476,"props":5381,"children":5382},{"class":478,"line":732},[5383],{"type":47,"tag":476,"props":5384,"children":5385},{"style":483},[5386],{"type":52,"value":5387},"  \u002F\u002F ⚠ AUTHORIZATION GATE: same as Step 3 — verify ownership before minting.\n",{"type":47,"tag":476,"props":5389,"children":5390},{"class":478,"line":749},[5391],{"type":47,"tag":476,"props":5392,"children":5393},{"emptyLinePlaceholder":586},[5394],{"type":52,"value":589},{"type":47,"tag":476,"props":5396,"children":5397},{"class":478,"line":784},[5398,5402,5407,5411,5415,5419,5423,5427,5431],{"type":47,"tag":476,"props":5399,"children":5400},{"style":609},[5401],{"type":52,"value":4284},{"type":47,"tag":476,"props":5403,"children":5404},{"style":505},[5405],{"type":52,"value":5406}," token",{"type":47,"tag":476,"props":5408,"children":5409},{"style":499},[5410],{"type":52,"value":2066},{"type":47,"tag":476,"props":5412,"children":5413},{"style":493},[5414],{"type":52,"value":2733},{"type":47,"tag":476,"props":5416,"children":5417},{"style":625},[5418],{"type":52,"value":5226},{"type":47,"tag":476,"props":5420,"children":5421},{"style":717},[5422],{"type":52,"value":632},{"type":47,"tag":476,"props":5424,"children":5425},{"style":505},[5426],{"type":52,"value":8},{"type":47,"tag":476,"props":5428,"children":5429},{"style":499},[5430],{"type":52,"value":865},{"type":47,"tag":476,"props":5432,"children":5433},{"style":499},[5434],{"type":52,"value":729},{"type":47,"tag":476,"props":5436,"children":5437},{"class":478,"line":819},[5438,5442,5446,5450,5454,5458,5462],{"type":47,"tag":476,"props":5439,"children":5440},{"style":717},[5441],{"type":52,"value":3898},{"type":47,"tag":476,"props":5443,"children":5444},{"style":499},[5445],{"type":52,"value":651},{"type":47,"tag":476,"props":5447,"children":5448},{"style":625},[5449],{"type":52,"value":1781},{"type":47,"tag":476,"props":5451,"children":5452},{"style":717},[5453],{"type":52,"value":632},{"type":47,"tag":476,"props":5455,"children":5456},{"style":505},[5457],{"type":52,"value":662},{"type":47,"tag":476,"props":5459,"children":5460},{"style":717},[5461],{"type":52,"value":255},{"type":47,"tag":476,"props":5463,"children":5464},{"style":499},[5465],{"type":52,"value":710},{"type":47,"tag":476,"props":5467,"children":5468},{"class":478,"line":907},[5469,5473,5477,5481,5485,5489,5493,5497],{"type":47,"tag":476,"props":5470,"children":5471},{"style":717},[5472],{"type":52,"value":3930},{"type":47,"tag":476,"props":5474,"children":5475},{"style":499},[5476],{"type":52,"value":651},{"type":47,"tag":476,"props":5478,"children":5479},{"style":717},[5480],{"type":52,"value":1936},{"type":47,"tag":476,"props":5482,"children":5483},{"style":499},[5484],{"type":52,"value":533},{"type":47,"tag":476,"props":5486,"children":5487},{"style":526},[5488],{"type":52,"value":2412},{"type":47,"tag":476,"props":5490,"children":5491},{"style":499},[5492],{"type":52,"value":533},{"type":47,"tag":476,"props":5494,"children":5495},{"style":717},[5496],{"type":52,"value":1972},{"type":47,"tag":476,"props":5498,"children":5499},{"style":499},[5500],{"type":52,"value":710},{"type":47,"tag":476,"props":5502,"children":5503},{"class":478,"line":989},[5504,5508,5512],{"type":47,"tag":476,"props":5505,"children":5506},{"style":499},[5507],{"type":52,"value":3966},{"type":47,"tag":476,"props":5509,"children":5510},{"style":717},[5511],{"type":52,"value":255},{"type":47,"tag":476,"props":5513,"children":5514},{"style":499},[5515],{"type":52,"value":538},{"type":47,"tag":476,"props":5517,"children":5518},{"class":478,"line":1023},[5519],{"type":47,"tag":476,"props":5520,"children":5521},{"emptyLinePlaceholder":586},[5522],{"type":52,"value":589},{"type":47,"tag":476,"props":5524,"children":5525},{"class":478,"line":1040},[5526],{"type":47,"tag":476,"props":5527,"children":5528},{"style":483},[5529],{"type":52,"value":5530},"  \u002F\u002F ⚠ CRITICAL: strip the ChannelInstance from the response.\n",{"type":47,"tag":476,"props":5532,"children":5533},{"class":478,"line":1049},[5534],{"type":47,"tag":476,"props":5535,"children":5536},{"style":483},[5537],{"type":52,"value":5538},"  \u002F\u002F getSubscriptionToken returns { channel: ChannelInstance, ... } where\n",{"type":47,"tag":476,"props":5540,"children":5541},{"class":478,"line":1058},[5542],{"type":47,"tag":476,"props":5543,"children":5544},{"style":483},[5545],{"type":52,"value":5546},"  \u002F\u002F ChannelInstance contains zod schema methods (a class with prototypes).\n",{"type":47,"tag":476,"props":5548,"children":5549},{"class":478,"line":1075},[5550],{"type":47,"tag":476,"props":5551,"children":5552},{"style":483},[5553],{"type":52,"value":5554},"  \u002F\u002F Next.js refuses to serialize classes across the server-action → client-component\n",{"type":47,"tag":476,"props":5556,"children":5557},{"class":478,"line":1083},[5558],{"type":47,"tag":476,"props":5559,"children":5560},{"style":483},[5561],{"type":52,"value":5562},"  \u002F\u002F boundary, so return ONLY primitives.\n",{"type":47,"tag":476,"props":5564,"children":5565},{"class":478,"line":1092},[5566,5570],{"type":47,"tag":476,"props":5567,"children":5568},{"style":493},[5569],{"type":52,"value":3870},{"type":47,"tag":476,"props":5571,"children":5572},{"style":499},[5573],{"type":52,"value":729},{"type":47,"tag":476,"props":5575,"children":5576},{"class":478,"line":1125},[5577,5581,5585,5589,5593,5597,5601,5605,5609,5613,5617],{"type":47,"tag":476,"props":5578,"children":5579},{"style":717},[5580],{"type":52,"value":3898},{"type":47,"tag":476,"props":5582,"children":5583},{"style":499},[5584],{"type":52,"value":651},{"type":47,"tag":476,"props":5586,"children":5587},{"style":625},[5588],{"type":52,"value":1781},{"type":47,"tag":476,"props":5590,"children":5591},{"style":717},[5592],{"type":52,"value":632},{"type":47,"tag":476,"props":5594,"children":5595},{"style":505},[5596],{"type":52,"value":662},{"type":47,"tag":476,"props":5598,"children":5599},{"style":717},[5600],{"type":52,"value":255},{"type":47,"tag":476,"props":5602,"children":5603},{"style":499},[5604],{"type":52,"value":768},{"type":47,"tag":476,"props":5606,"children":5607},{"style":505},[5608],{"type":52,"value":2357},{"type":47,"tag":476,"props":5610,"children":5611},{"style":493},[5612],{"type":52,"value":4773},{"type":47,"tag":476,"props":5614,"children":5615},{"style":669},[5616],{"type":52,"value":672},{"type":47,"tag":476,"props":5618,"children":5619},{"style":499},[5620],{"type":52,"value":710},{"type":47,"tag":476,"props":5622,"children":5623},{"class":478,"line":1154},[5624,5628,5632,5636,5640,5644,5648,5652,5656,5660],{"type":47,"tag":476,"props":5625,"children":5626},{"style":717},[5627],{"type":52,"value":3930},{"type":47,"tag":476,"props":5629,"children":5630},{"style":499},[5631],{"type":52,"value":651},{"type":47,"tag":476,"props":5633,"children":5634},{"style":717},[5635],{"type":52,"value":1936},{"type":47,"tag":476,"props":5637,"children":5638},{"style":499},[5639],{"type":52,"value":533},{"type":47,"tag":476,"props":5641,"children":5642},{"style":526},[5643],{"type":52,"value":2412},{"type":47,"tag":476,"props":5645,"children":5646},{"style":499},[5647],{"type":52,"value":533},{"type":47,"tag":476,"props":5649,"children":5650},{"style":717},[5651],{"type":52,"value":4394},{"type":47,"tag":476,"props":5653,"children":5654},{"style":493},[5655],{"type":52,"value":4399},{"type":47,"tag":476,"props":5657,"children":5658},{"style":609},[5659],{"type":52,"value":612},{"type":47,"tag":476,"props":5661,"children":5662},{"style":499},[5663],{"type":52,"value":710},{"type":47,"tag":476,"props":5665,"children":5666},{"class":478,"line":1170},[5667,5672,5676,5680,5684,5689],{"type":47,"tag":476,"props":5668,"children":5669},{"style":717},[5670],{"type":52,"value":5671},"    key",{"type":47,"tag":476,"props":5673,"children":5674},{"style":499},[5675],{"type":52,"value":651},{"type":47,"tag":476,"props":5677,"children":5678},{"style":505},[5679],{"type":52,"value":5406},{"type":47,"tag":476,"props":5681,"children":5682},{"style":499},[5683],{"type":52,"value":768},{"type":47,"tag":476,"props":5685,"children":5686},{"style":505},[5687],{"type":52,"value":5688},"key",{"type":47,"tag":476,"props":5690,"children":5691},{"style":499},[5692],{"type":52,"value":710},{"type":47,"tag":476,"props":5694,"children":5695},{"class":478,"line":1187},[5696,5701,5705,5709,5713,5718],{"type":47,"tag":476,"props":5697,"children":5698},{"style":717},[5699],{"type":52,"value":5700},"    apiBaseUrl",{"type":47,"tag":476,"props":5702,"children":5703},{"style":499},[5704],{"type":52,"value":651},{"type":47,"tag":476,"props":5706,"children":5707},{"style":505},[5708],{"type":52,"value":5406},{"type":47,"tag":476,"props":5710,"children":5711},{"style":499},[5712],{"type":52,"value":768},{"type":47,"tag":476,"props":5714,"children":5715},{"style":505},[5716],{"type":52,"value":5717},"apiBaseUrl",{"type":47,"tag":476,"props":5719,"children":5720},{"style":499},[5721],{"type":52,"value":710},{"type":47,"tag":476,"props":5723,"children":5724},{"class":478,"line":23},[5725],{"type":47,"tag":476,"props":5726,"children":5727},{"style":499},[5728],{"type":52,"value":5729},"  };\n",{"type":47,"tag":476,"props":5731,"children":5732},{"class":478,"line":1251},[5733],{"type":47,"tag":476,"props":5734,"children":5735},{"style":499},[5736],{"type":52,"value":3982},{"type":47,"tag":1518,"props":5738,"children":5740},{"id":5739},"manual-client-subscription",[5741],{"type":52,"value":5742},"Manual client subscription",{"type":47,"tag":465,"props":5744,"children":5746},{"className":467,"code":5745,"language":469,"meta":470,"style":470},"\u002F\u002F src\u002Fcomponents\u002FOrderStatusManual.tsx\n'use client';\n\nimport * as React from 'react';\nimport { subscribe } from 'inngest\u002Frealtime';\nimport { fetchOrderSubscriptionTokenLowLevel } from '@\u002Fapp\u002Forders\u002F[orderId]\u002Factions';\n\nexport function OrderStatusManual({ orderId }: { orderId: string }) {\n  const [messages, setMessages] = React.useState\u003Cunknown[]>([]);\n\n  React.useEffect(() => {\n    let cancelled = false;\n    let sub: { close?: (reason?: string) => void } | undefined;\n\n    (async () => {\n      const token = await fetchOrderSubscriptionTokenLowLevel(orderId);\n      if (cancelled) return;\n\n      sub = await subscribe(\n        {\n          channel: token.channel,\n          topics: [...token.topics],\n          key: token.key,\n          apiBaseUrl: token.apiBaseUrl,\n        },\n        (message) => {\n          if (cancelled) return;\n          setMessages((prev) => [...prev, message.data]);\n        },\n      );\n    })();\n\n    return () => {\n      cancelled = true;\n      sub?.close?.('unmount');\n    };\n  }, [orderId]);\n\n  \u002F\u002F ... render ...\n}\n",[5747],{"type":47,"tag":103,"props":5748,"children":5749},{"__ignoreMap":470},[5750,5758,5777,5784,5827,5867,5906,5913,5965,6037,6044,6077,6104,6180,6187,6212,6251,6280,6287,6311,6319,6348,6391,6419,6447,6455,6479,6507,6573,6580,6591,6607,6614,6634,6655,6701,6708,6732,6739,6747],{"type":47,"tag":476,"props":5751,"children":5752},{"class":478,"line":479},[5753],{"type":47,"tag":476,"props":5754,"children":5755},{"style":483},[5756],{"type":52,"value":5757},"\u002F\u002F src\u002Fcomponents\u002FOrderStatusManual.tsx\n",{"type":47,"tag":476,"props":5759,"children":5760},{"class":478,"line":489},[5761,5765,5769,5773],{"type":47,"tag":476,"props":5762,"children":5763},{"style":499},[5764],{"type":52,"value":533},{"type":47,"tag":476,"props":5766,"children":5767},{"style":526},[5768],{"type":52,"value":4081},{"type":47,"tag":476,"props":5770,"children":5771},{"style":499},[5772],{"type":52,"value":533},{"type":47,"tag":476,"props":5774,"children":5775},{"style":499},[5776],{"type":52,"value":538},{"type":47,"tag":476,"props":5778,"children":5779},{"class":478,"line":541},[5780],{"type":47,"tag":476,"props":5781,"children":5782},{"emptyLinePlaceholder":586},[5783],{"type":52,"value":589},{"type":47,"tag":476,"props":5785,"children":5786},{"class":478,"line":582},[5787,5791,5796,5800,5805,5810,5814,5819,5823],{"type":47,"tag":476,"props":5788,"children":5789},{"style":493},[5790],{"type":52,"value":496},{"type":47,"tag":476,"props":5792,"children":5793},{"style":499},[5794],{"type":52,"value":5795}," *",{"type":47,"tag":476,"props":5797,"children":5798},{"style":493},[5799],{"type":52,"value":4773},{"type":47,"tag":476,"props":5801,"children":5802},{"style":505},[5803],{"type":52,"value":5804}," React ",{"type":47,"tag":476,"props":5806,"children":5807},{"style":493},[5808],{"type":52,"value":5809},"from",{"type":47,"tag":476,"props":5811,"children":5812},{"style":499},[5813],{"type":52,"value":523},{"type":47,"tag":476,"props":5815,"children":5816},{"style":526},[5817],{"type":52,"value":5818},"react",{"type":47,"tag":476,"props":5820,"children":5821},{"style":499},[5822],{"type":52,"value":533},{"type":47,"tag":476,"props":5824,"children":5825},{"style":499},[5826],{"type":52,"value":538},{"type":47,"tag":476,"props":5828,"children":5829},{"class":478,"line":27},[5830,5834,5838,5843,5847,5851,5855,5859,5863],{"type":47,"tag":476,"props":5831,"children":5832},{"style":493},[5833],{"type":52,"value":496},{"type":47,"tag":476,"props":5835,"children":5836},{"style":499},[5837],{"type":52,"value":502},{"type":47,"tag":476,"props":5839,"children":5840},{"style":505},[5841],{"type":52,"value":5842}," subscribe",{"type":47,"tag":476,"props":5844,"children":5845},{"style":499},[5846],{"type":52,"value":513},{"type":47,"tag":476,"props":5848,"children":5849},{"style":493},[5850],{"type":52,"value":518},{"type":47,"tag":476,"props":5852,"children":5853},{"style":499},[5854],{"type":52,"value":523},{"type":47,"tag":476,"props":5856,"children":5857},{"style":526},[5858],{"type":52,"value":108},{"type":47,"tag":476,"props":5860,"children":5861},{"style":499},[5862],{"type":52,"value":533},{"type":47,"tag":476,"props":5864,"children":5865},{"style":499},[5866],{"type":52,"value":538},{"type":47,"tag":476,"props":5868,"children":5869},{"class":478,"line":600},[5870,5874,5878,5882,5886,5890,5894,5898,5902],{"type":47,"tag":476,"props":5871,"children":5872},{"style":493},[5873],{"type":52,"value":496},{"type":47,"tag":476,"props":5875,"children":5876},{"style":499},[5877],{"type":52,"value":502},{"type":47,"tag":476,"props":5879,"children":5880},{"style":505},[5881],{"type":52,"value":5355},{"type":47,"tag":476,"props":5883,"children":5884},{"style":499},[5885],{"type":52,"value":513},{"type":47,"tag":476,"props":5887,"children":5888},{"style":493},[5889],{"type":52,"value":518},{"type":47,"tag":476,"props":5891,"children":5892},{"style":499},[5893],{"type":52,"value":523},{"type":47,"tag":476,"props":5895,"children":5896},{"style":526},[5897],{"type":52,"value":4207},{"type":47,"tag":476,"props":5899,"children":5900},{"style":499},[5901],{"type":52,"value":533},{"type":47,"tag":476,"props":5903,"children":5904},{"style":499},[5905],{"type":52,"value":538},{"type":47,"tag":476,"props":5907,"children":5908},{"class":478,"line":640},[5909],{"type":47,"tag":476,"props":5910,"children":5911},{"emptyLinePlaceholder":586},[5912],{"type":52,"value":589},{"type":47,"tag":476,"props":5914,"children":5915},{"class":478,"line":713},[5916,5920,5924,5929,5933,5937,5941,5945,5949,5953,5957,5961],{"type":47,"tag":476,"props":5917,"children":5918},{"style":493},[5919],{"type":52,"value":606},{"type":47,"tag":476,"props":5921,"children":5922},{"style":609},[5923],{"type":52,"value":3754},{"type":47,"tag":476,"props":5925,"children":5926},{"style":625},[5927],{"type":52,"value":5928}," OrderStatusManual",{"type":47,"tag":476,"props":5930,"children":5931},{"style":499},[5932],{"type":52,"value":4243},{"type":47,"tag":476,"props":5934,"children":5935},{"style":659},[5936],{"type":52,"value":2039},{"type":47,"tag":476,"props":5938,"children":5939},{"style":499},[5940],{"type":52,"value":4252},{"type":47,"tag":476,"props":5942,"children":5943},{"style":499},[5944],{"type":52,"value":502},{"type":47,"tag":476,"props":5946,"children":5947},{"style":717},[5948],{"type":52,"value":2039},{"type":47,"tag":476,"props":5950,"children":5951},{"style":499},[5952],{"type":52,"value":651},{"type":47,"tag":476,"props":5954,"children":5955},{"style":669},[5956],{"type":52,"value":672},{"type":47,"tag":476,"props":5958,"children":5959},{"style":499},[5960],{"type":52,"value":2014},{"type":47,"tag":476,"props":5962,"children":5963},{"style":499},[5964],{"type":52,"value":729},{"type":47,"tag":476,"props":5966,"children":5967},{"class":478,"line":732},[5968,5972,5976,5980,5984,5989,5993,5997,6002,6006,6011,6015,6019,6024,6028,6033],{"type":47,"tag":476,"props":5969,"children":5970},{"style":609},[5971],{"type":52,"value":4284},{"type":47,"tag":476,"props":5973,"children":5974},{"style":499},[5975],{"type":52,"value":1936},{"type":47,"tag":476,"props":5977,"children":5978},{"style":505},[5979],{"type":52,"value":4663},{"type":47,"tag":476,"props":5981,"children":5982},{"style":499},[5983],{"type":52,"value":865},{"type":47,"tag":476,"props":5985,"children":5986},{"style":505},[5987],{"type":52,"value":5988}," setMessages",{"type":47,"tag":476,"props":5990,"children":5991},{"style":499},[5992],{"type":52,"value":1972},{"type":47,"tag":476,"props":5994,"children":5995},{"style":499},[5996],{"type":52,"value":2066},{"type":47,"tag":476,"props":5998,"children":5999},{"style":505},[6000],{"type":52,"value":6001}," React",{"type":47,"tag":476,"props":6003,"children":6004},{"style":499},[6005],{"type":52,"value":768},{"type":47,"tag":476,"props":6007,"children":6008},{"style":625},[6009],{"type":52,"value":6010},"useState",{"type":47,"tag":476,"props":6012,"children":6013},{"style":499},[6014],{"type":52,"value":2228},{"type":47,"tag":476,"props":6016,"children":6017},{"style":669},[6018],{"type":52,"value":964},{"type":47,"tag":476,"props":6020,"children":6021},{"style":717},[6022],{"type":52,"value":6023},"[]",{"type":47,"tag":476,"props":6025,"children":6026},{"style":499},[6027],{"type":52,"value":4511},{"type":47,"tag":476,"props":6029,"children":6030},{"style":717},[6031],{"type":52,"value":6032},"([])",{"type":47,"tag":476,"props":6034,"children":6035},{"style":499},[6036],{"type":52,"value":538},{"type":47,"tag":476,"props":6038,"children":6039},{"class":478,"line":749},[6040],{"type":47,"tag":476,"props":6041,"children":6042},{"emptyLinePlaceholder":586},[6043],{"type":52,"value":589},{"type":47,"tag":476,"props":6045,"children":6046},{"class":478,"line":784},[6047,6052,6056,6061,6065,6069,6073],{"type":47,"tag":476,"props":6048,"children":6049},{"style":505},[6050],{"type":52,"value":6051},"  React",{"type":47,"tag":476,"props":6053,"children":6054},{"style":499},[6055],{"type":52,"value":768},{"type":47,"tag":476,"props":6057,"children":6058},{"style":625},[6059],{"type":52,"value":6060},"useEffect",{"type":47,"tag":476,"props":6062,"children":6063},{"style":717},[6064],{"type":52,"value":632},{"type":47,"tag":476,"props":6066,"children":6067},{"style":499},[6068],{"type":52,"value":812},{"type":47,"tag":476,"props":6070,"children":6071},{"style":609},[6072],{"type":52,"value":681},{"type":47,"tag":476,"props":6074,"children":6075},{"style":499},[6076],{"type":52,"value":729},{"type":47,"tag":476,"props":6078,"children":6079},{"class":478,"line":819},[6080,6085,6090,6094,6100],{"type":47,"tag":476,"props":6081,"children":6082},{"style":609},[6083],{"type":52,"value":6084},"    let",{"type":47,"tag":476,"props":6086,"children":6087},{"style":505},[6088],{"type":52,"value":6089}," cancelled",{"type":47,"tag":476,"props":6091,"children":6092},{"style":499},[6093],{"type":52,"value":2066},{"type":47,"tag":476,"props":6095,"children":6097},{"style":6096},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[6098],{"type":52,"value":6099}," false",{"type":47,"tag":476,"props":6101,"children":6102},{"style":499},[6103],{"type":52,"value":538},{"type":47,"tag":476,"props":6105,"children":6106},{"class":478,"line":907},[6107,6111,6116,6120,6124,6129,6133,6137,6142,6146,6150,6154,6158,6163,6167,6171,6176],{"type":47,"tag":476,"props":6108,"children":6109},{"style":609},[6110],{"type":52,"value":6084},{"type":47,"tag":476,"props":6112,"children":6113},{"style":505},[6114],{"type":52,"value":6115}," sub",{"type":47,"tag":476,"props":6117,"children":6118},{"style":499},[6119],{"type":52,"value":651},{"type":47,"tag":476,"props":6121,"children":6122},{"style":499},[6123],{"type":52,"value":502},{"type":47,"tag":476,"props":6125,"children":6126},{"style":717},[6127],{"type":52,"value":6128}," close",{"type":47,"tag":476,"props":6130,"children":6131},{"style":499},[6132],{"type":52,"value":2218},{"type":47,"tag":476,"props":6134,"children":6135},{"style":499},[6136],{"type":52,"value":656},{"type":47,"tag":476,"props":6138,"children":6139},{"style":659},[6140],{"type":52,"value":6141},"reason",{"type":47,"tag":476,"props":6143,"children":6144},{"style":499},[6145],{"type":52,"value":2218},{"type":47,"tag":476,"props":6147,"children":6148},{"style":669},[6149],{"type":52,"value":672},{"type":47,"tag":476,"props":6151,"children":6152},{"style":499},[6153],{"type":52,"value":255},{"type":47,"tag":476,"props":6155,"children":6156},{"style":609},[6157],{"type":52,"value":681},{"type":47,"tag":476,"props":6159,"children":6160},{"style":669},[6161],{"type":52,"value":6162}," void",{"type":47,"tag":476,"props":6164,"children":6165},{"style":499},[6166],{"type":52,"value":513},{"type":47,"tag":476,"props":6168,"children":6169},{"style":499},[6170],{"type":52,"value":2173},{"type":47,"tag":476,"props":6172,"children":6173},{"style":669},[6174],{"type":52,"value":6175}," undefined",{"type":47,"tag":476,"props":6177,"children":6178},{"style":499},[6179],{"type":52,"value":538},{"type":47,"tag":476,"props":6181,"children":6182},{"class":478,"line":989},[6183],{"type":47,"tag":476,"props":6184,"children":6185},{"emptyLinePlaceholder":586},[6186],{"type":52,"value":589},{"type":47,"tag":476,"props":6188,"children":6189},{"class":478,"line":1023},[6190,6195,6200,6204,6208],{"type":47,"tag":476,"props":6191,"children":6192},{"style":717},[6193],{"type":52,"value":6194},"    (",{"type":47,"tag":476,"props":6196,"children":6197},{"style":609},[6198],{"type":52,"value":6199},"async",{"type":47,"tag":476,"props":6201,"children":6202},{"style":499},[6203],{"type":52,"value":2775},{"type":47,"tag":476,"props":6205,"children":6206},{"style":609},[6207],{"type":52,"value":681},{"type":47,"tag":476,"props":6209,"children":6210},{"style":499},[6211],{"type":52,"value":729},{"type":47,"tag":476,"props":6213,"children":6214},{"class":478,"line":1040},[6215,6219,6223,6227,6231,6235,6239,6243,6247],{"type":47,"tag":476,"props":6216,"children":6217},{"style":609},[6218],{"type":52,"value":2271},{"type":47,"tag":476,"props":6220,"children":6221},{"style":505},[6222],{"type":52,"value":5406},{"type":47,"tag":476,"props":6224,"children":6225},{"style":499},[6226],{"type":52,"value":2066},{"type":47,"tag":476,"props":6228,"children":6229},{"style":493},[6230],{"type":52,"value":2733},{"type":47,"tag":476,"props":6232,"children":6233},{"style":625},[6234],{"type":52,"value":5355},{"type":47,"tag":476,"props":6236,"children":6237},{"style":717},[6238],{"type":52,"value":632},{"type":47,"tag":476,"props":6240,"children":6241},{"style":505},[6242],{"type":52,"value":662},{"type":47,"tag":476,"props":6244,"children":6245},{"style":717},[6246],{"type":52,"value":255},{"type":47,"tag":476,"props":6248,"children":6249},{"style":499},[6250],{"type":52,"value":538},{"type":47,"tag":476,"props":6252,"children":6253},{"class":478,"line":1049},[6254,6259,6263,6268,6272,6276],{"type":47,"tag":476,"props":6255,"children":6256},{"style":493},[6257],{"type":52,"value":6258},"      if",{"type":47,"tag":476,"props":6260,"children":6261},{"style":717},[6262],{"type":52,"value":656},{"type":47,"tag":476,"props":6264,"children":6265},{"style":505},[6266],{"type":52,"value":6267},"cancelled",{"type":47,"tag":476,"props":6269,"children":6270},{"style":717},[6271],{"type":52,"value":4491},{"type":47,"tag":476,"props":6273,"children":6274},{"style":493},[6275],{"type":52,"value":4496},{"type":47,"tag":476,"props":6277,"children":6278},{"style":499},[6279],{"type":52,"value":538},{"type":47,"tag":476,"props":6281,"children":6282},{"class":478,"line":1058},[6283],{"type":47,"tag":476,"props":6284,"children":6285},{"emptyLinePlaceholder":586},[6286],{"type":52,"value":589},{"type":47,"tag":476,"props":6288,"children":6289},{"class":478,"line":1075},[6290,6295,6299,6303,6307],{"type":47,"tag":476,"props":6291,"children":6292},{"style":505},[6293],{"type":52,"value":6294},"      sub",{"type":47,"tag":476,"props":6296,"children":6297},{"style":499},[6298],{"type":52,"value":2066},{"type":47,"tag":476,"props":6300,"children":6301},{"style":493},[6302],{"type":52,"value":2733},{"type":47,"tag":476,"props":6304,"children":6305},{"style":625},[6306],{"type":52,"value":5842},{"type":47,"tag":476,"props":6308,"children":6309},{"style":717},[6310],{"type":52,"value":1860},{"type":47,"tag":476,"props":6312,"children":6313},{"class":478,"line":1083},[6314],{"type":47,"tag":476,"props":6315,"children":6316},{"style":499},[6317],{"type":52,"value":6318},"        {\n",{"type":47,"tag":476,"props":6320,"children":6321},{"class":478,"line":1092},[6322,6327,6331,6335,6339,6344],{"type":47,"tag":476,"props":6323,"children":6324},{"style":717},[6325],{"type":52,"value":6326},"          channel",{"type":47,"tag":476,"props":6328,"children":6329},{"style":499},[6330],{"type":52,"value":651},{"type":47,"tag":476,"props":6332,"children":6333},{"style":505},[6334],{"type":52,"value":5406},{"type":47,"tag":476,"props":6336,"children":6337},{"style":499},[6338],{"type":52,"value":768},{"type":47,"tag":476,"props":6340,"children":6341},{"style":505},[6342],{"type":52,"value":6343},"channel",{"type":47,"tag":476,"props":6345,"children":6346},{"style":499},[6347],{"type":52,"value":710},{"type":47,"tag":476,"props":6349,"children":6350},{"class":478,"line":1125},[6351,6356,6360,6364,6369,6374,6378,6383,6387],{"type":47,"tag":476,"props":6352,"children":6353},{"style":717},[6354],{"type":52,"value":6355},"          topics",{"type":47,"tag":476,"props":6357,"children":6358},{"style":499},[6359],{"type":52,"value":651},{"type":47,"tag":476,"props":6361,"children":6362},{"style":717},[6363],{"type":52,"value":1936},{"type":47,"tag":476,"props":6365,"children":6366},{"style":499},[6367],{"type":52,"value":6368},"...",{"type":47,"tag":476,"props":6370,"children":6371},{"style":505},[6372],{"type":52,"value":6373},"token",{"type":47,"tag":476,"props":6375,"children":6376},{"style":499},[6377],{"type":52,"value":768},{"type":47,"tag":476,"props":6379,"children":6380},{"style":505},[6381],{"type":52,"value":6382},"topics",{"type":47,"tag":476,"props":6384,"children":6385},{"style":717},[6386],{"type":52,"value":1972},{"type":47,"tag":476,"props":6388,"children":6389},{"style":499},[6390],{"type":52,"value":710},{"type":47,"tag":476,"props":6392,"children":6393},{"class":478,"line":1154},[6394,6399,6403,6407,6411,6415],{"type":47,"tag":476,"props":6395,"children":6396},{"style":717},[6397],{"type":52,"value":6398},"          key",{"type":47,"tag":476,"props":6400,"children":6401},{"style":499},[6402],{"type":52,"value":651},{"type":47,"tag":476,"props":6404,"children":6405},{"style":505},[6406],{"type":52,"value":5406},{"type":47,"tag":476,"props":6408,"children":6409},{"style":499},[6410],{"type":52,"value":768},{"type":47,"tag":476,"props":6412,"children":6413},{"style":505},[6414],{"type":52,"value":5688},{"type":47,"tag":476,"props":6416,"children":6417},{"style":499},[6418],{"type":52,"value":710},{"type":47,"tag":476,"props":6420,"children":6421},{"class":478,"line":1170},[6422,6427,6431,6435,6439,6443],{"type":47,"tag":476,"props":6423,"children":6424},{"style":717},[6425],{"type":52,"value":6426},"          apiBaseUrl",{"type":47,"tag":476,"props":6428,"children":6429},{"style":499},[6430],{"type":52,"value":651},{"type":47,"tag":476,"props":6432,"children":6433},{"style":505},[6434],{"type":52,"value":5406},{"type":47,"tag":476,"props":6436,"children":6437},{"style":499},[6438],{"type":52,"value":768},{"type":47,"tag":476,"props":6440,"children":6441},{"style":505},[6442],{"type":52,"value":5717},{"type":47,"tag":476,"props":6444,"children":6445},{"style":499},[6446],{"type":52,"value":710},{"type":47,"tag":476,"props":6448,"children":6449},{"class":478,"line":1187},[6450],{"type":47,"tag":476,"props":6451,"children":6452},{"style":499},[6453],{"type":52,"value":6454},"        },\n",{"type":47,"tag":476,"props":6456,"children":6457},{"class":478,"line":23},[6458,6463,6467,6471,6475],{"type":47,"tag":476,"props":6459,"children":6460},{"style":499},[6461],{"type":52,"value":6462},"        (",{"type":47,"tag":476,"props":6464,"children":6465},{"style":659},[6466],{"type":52,"value":4535},{"type":47,"tag":476,"props":6468,"children":6469},{"style":499},[6470],{"type":52,"value":255},{"type":47,"tag":476,"props":6472,"children":6473},{"style":609},[6474],{"type":52,"value":681},{"type":47,"tag":476,"props":6476,"children":6477},{"style":499},[6478],{"type":52,"value":729},{"type":47,"tag":476,"props":6480,"children":6481},{"class":478,"line":1251},[6482,6487,6491,6495,6499,6503],{"type":47,"tag":476,"props":6483,"children":6484},{"style":493},[6485],{"type":52,"value":6486},"          if",{"type":47,"tag":476,"props":6488,"children":6489},{"style":717},[6490],{"type":52,"value":656},{"type":47,"tag":476,"props":6492,"children":6493},{"style":505},[6494],{"type":52,"value":6267},{"type":47,"tag":476,"props":6496,"children":6497},{"style":717},[6498],{"type":52,"value":4491},{"type":47,"tag":476,"props":6500,"children":6501},{"style":493},[6502],{"type":52,"value":4496},{"type":47,"tag":476,"props":6504,"children":6505},{"style":499},[6506],{"type":52,"value":538},{"type":47,"tag":476,"props":6508,"children":6509},{"class":478,"line":1284},[6510,6515,6519,6523,6528,6532,6536,6540,6544,6548,6552,6557,6561,6565,6569],{"type":47,"tag":476,"props":6511,"children":6512},{"style":625},[6513],{"type":52,"value":6514},"          setMessages",{"type":47,"tag":476,"props":6516,"children":6517},{"style":717},[6518],{"type":52,"value":632},{"type":47,"tag":476,"props":6520,"children":6521},{"style":499},[6522],{"type":52,"value":632},{"type":47,"tag":476,"props":6524,"children":6525},{"style":659},[6526],{"type":52,"value":6527},"prev",{"type":47,"tag":476,"props":6529,"children":6530},{"style":499},[6531],{"type":52,"value":255},{"type":47,"tag":476,"props":6533,"children":6534},{"style":609},[6535],{"type":52,"value":681},{"type":47,"tag":476,"props":6537,"children":6538},{"style":717},[6539],{"type":52,"value":1936},{"type":47,"tag":476,"props":6541,"children":6542},{"style":499},[6543],{"type":52,"value":6368},{"type":47,"tag":476,"props":6545,"children":6546},{"style":505},[6547],{"type":52,"value":6527},{"type":47,"tag":476,"props":6549,"children":6550},{"style":499},[6551],{"type":52,"value":865},{"type":47,"tag":476,"props":6553,"children":6554},{"style":505},[6555],{"type":52,"value":6556}," message",{"type":47,"tag":476,"props":6558,"children":6559},{"style":499},[6560],{"type":52,"value":768},{"type":47,"tag":476,"props":6562,"children":6563},{"style":505},[6564],{"type":52,"value":2079},{"type":47,"tag":476,"props":6566,"children":6567},{"style":717},[6568],{"type":52,"value":900},{"type":47,"tag":476,"props":6570,"children":6571},{"style":499},[6572],{"type":52,"value":538},{"type":47,"tag":476,"props":6574,"children":6575},{"class":478,"line":1364},[6576],{"type":47,"tag":476,"props":6577,"children":6578},{"style":499},[6579],{"type":52,"value":6454},{"type":47,"tag":476,"props":6581,"children":6582},{"class":478,"line":1396},[6583,6587],{"type":47,"tag":476,"props":6584,"children":6585},{"style":717},[6586],{"type":52,"value":2468},{"type":47,"tag":476,"props":6588,"children":6589},{"style":499},[6590],{"type":52,"value":538},{"type":47,"tag":476,"props":6592,"children":6593},{"class":478,"line":1412},[6594,6598,6603],{"type":47,"tag":476,"props":6595,"children":6596},{"style":499},[6597],{"type":52,"value":3181},{"type":47,"tag":476,"props":6599,"children":6600},{"style":717},[6601],{"type":52,"value":6602},")()",{"type":47,"tag":476,"props":6604,"children":6605},{"style":499},[6606],{"type":52,"value":538},{"type":47,"tag":476,"props":6608,"children":6609},{"class":478,"line":1420},[6610],{"type":47,"tag":476,"props":6611,"children":6612},{"emptyLinePlaceholder":586},[6613],{"type":52,"value":589},{"type":47,"tag":476,"props":6615,"children":6616},{"class":478,"line":1428},[6617,6622,6626,6630],{"type":47,"tag":476,"props":6618,"children":6619},{"style":493},[6620],{"type":52,"value":6621},"    return",{"type":47,"tag":476,"props":6623,"children":6624},{"style":499},[6625],{"type":52,"value":2775},{"type":47,"tag":476,"props":6627,"children":6628},{"style":609},[6629],{"type":52,"value":681},{"type":47,"tag":476,"props":6631,"children":6632},{"style":499},[6633],{"type":52,"value":729},{"type":47,"tag":476,"props":6635,"children":6636},{"class":478,"line":2697},[6637,6642,6646,6651],{"type":47,"tag":476,"props":6638,"children":6639},{"style":505},[6640],{"type":52,"value":6641},"      cancelled",{"type":47,"tag":476,"props":6643,"children":6644},{"style":499},[6645],{"type":52,"value":2066},{"type":47,"tag":476,"props":6647,"children":6648},{"style":6096},[6649],{"type":52,"value":6650}," true",{"type":47,"tag":476,"props":6652,"children":6653},{"style":499},[6654],{"type":52,"value":538},{"type":47,"tag":476,"props":6656,"children":6657},{"class":478,"line":2705},[6658,6662,6667,6672,6676,6680,6684,6689,6693,6697],{"type":47,"tag":476,"props":6659,"children":6660},{"style":505},[6661],{"type":52,"value":6294},{"type":47,"tag":476,"props":6663,"children":6664},{"style":499},[6665],{"type":52,"value":6666},"?.",{"type":47,"tag":476,"props":6668,"children":6669},{"style":625},[6670],{"type":52,"value":6671},"close",{"type":47,"tag":476,"props":6673,"children":6674},{"style":499},[6675],{"type":52,"value":6666},{"type":47,"tag":476,"props":6677,"children":6678},{"style":717},[6679],{"type":52,"value":632},{"type":47,"tag":476,"props":6681,"children":6682},{"style":499},[6683],{"type":52,"value":533},{"type":47,"tag":476,"props":6685,"children":6686},{"style":526},[6687],{"type":52,"value":6688},"unmount",{"type":47,"tag":476,"props":6690,"children":6691},{"style":499},[6692],{"type":52,"value":533},{"type":47,"tag":476,"props":6694,"children":6695},{"style":717},[6696],{"type":52,"value":255},{"type":47,"tag":476,"props":6698,"children":6699},{"style":499},[6700],{"type":52,"value":538},{"type":47,"tag":476,"props":6702,"children":6703},{"class":478,"line":2714},[6704],{"type":47,"tag":476,"props":6705,"children":6706},{"style":499},[6707],{"type":52,"value":2634},{"type":47,"tag":476,"props":6709,"children":6710},{"class":478,"line":2786},[6711,6716,6720,6724,6728],{"type":47,"tag":476,"props":6712,"children":6713},{"style":499},[6714],{"type":52,"value":6715},"  },",{"type":47,"tag":476,"props":6717,"children":6718},{"style":717},[6719],{"type":52,"value":1936},{"type":47,"tag":476,"props":6721,"children":6722},{"style":505},[6723],{"type":52,"value":662},{"type":47,"tag":476,"props":6725,"children":6726},{"style":717},[6727],{"type":52,"value":900},{"type":47,"tag":476,"props":6729,"children":6730},{"style":499},[6731],{"type":52,"value":538},{"type":47,"tag":476,"props":6733,"children":6734},{"class":478,"line":2855},[6735],{"type":47,"tag":476,"props":6736,"children":6737},{"emptyLinePlaceholder":586},[6738],{"type":52,"value":589},{"type":47,"tag":476,"props":6740,"children":6741},{"class":478,"line":2863},[6742],{"type":47,"tag":476,"props":6743,"children":6744},{"style":483},[6745],{"type":52,"value":6746},"  \u002F\u002F ... render ...\n",{"type":47,"tag":476,"props":6748,"children":6749},{"class":478,"line":2872},[6750],{"type":47,"tag":476,"props":6751,"children":6752},{"style":499},[6753],{"type":52,"value":3982},{"type":47,"tag":1518,"props":6755,"children":6757},{"id":6756},"sse-streaming-from-a-route-handler",[6758],{"type":52,"value":6759},"SSE streaming from a route handler",{"type":47,"tag":55,"props":6761,"children":6762},{},[6763],{"type":52,"value":6764},"Subscribe inside a Next.js API route and pipe the stream to the client via SSE:",{"type":47,"tag":465,"props":6766,"children":6768},{"className":467,"code":6767,"language":469,"meta":470,"style":470},"\u002F\u002F src\u002Fapp\u002Fapi\u002Forders\u002F[orderId]\u002Fstream\u002Froute.ts\nimport { inngest } from '@\u002Finngest\u002Fclient';\nimport { subscribe } from 'inngest\u002Frealtime';\nimport { orderChannel } from '@\u002Finngest\u002Fchannels';\n\nexport async function GET(req: Request, { params }: { params: { orderId: string } }) {\n  \u002F\u002F ⚠ AUTHORIZATION GATE: same rule as the server-action token mint above.\n  \u002F\u002F Authenticate the request and confirm the caller owns params.orderId\n  \u002F\u002F before opening the SSE stream. Skipping this leaks every order's\n  \u002F\u002F step events to anyone with a URL.\n\n  const stream = await subscribe({\n    app: inngest,\n    channel: orderChannel(params.orderId),\n    topics: ['step'],\n  });\n\n  return new Response(stream.getEncodedStream(), {\n    headers: {\n      'Content-Type': 'text\u002Fevent-stream',\n      'Cache-Control': 'no-cache',\n      Connection: 'keep-alive',\n    },\n  });\n}\n",[6769],{"type":47,"tag":103,"props":6770,"children":6771},{"__ignoreMap":470},[6772,6780,6819,6858,6897,6904,6999,7007,7015,7023,7031,7038,7070,7090,7130,7165,7180,7187,7234,7250,7288,7325,7354,7361,7376],{"type":47,"tag":476,"props":6773,"children":6774},{"class":478,"line":479},[6775],{"type":47,"tag":476,"props":6776,"children":6777},{"style":483},[6778],{"type":52,"value":6779},"\u002F\u002F src\u002Fapp\u002Fapi\u002Forders\u002F[orderId]\u002Fstream\u002Froute.ts\n",{"type":47,"tag":476,"props":6781,"children":6782},{"class":478,"line":489},[6783,6787,6791,6795,6799,6803,6807,6811,6815],{"type":47,"tag":476,"props":6784,"children":6785},{"style":493},[6786],{"type":52,"value":496},{"type":47,"tag":476,"props":6788,"children":6789},{"style":499},[6790],{"type":52,"value":502},{"type":47,"tag":476,"props":6792,"children":6793},{"style":505},[6794],{"type":52,"value":1740},{"type":47,"tag":476,"props":6796,"children":6797},{"style":499},[6798],{"type":52,"value":513},{"type":47,"tag":476,"props":6800,"children":6801},{"style":493},[6802],{"type":52,"value":518},{"type":47,"tag":476,"props":6804,"children":6805},{"style":499},[6806],{"type":52,"value":523},{"type":47,"tag":476,"props":6808,"children":6809},{"style":526},[6810],{"type":52,"value":3683},{"type":47,"tag":476,"props":6812,"children":6813},{"style":499},[6814],{"type":52,"value":533},{"type":47,"tag":476,"props":6816,"children":6817},{"style":499},[6818],{"type":52,"value":538},{"type":47,"tag":476,"props":6820,"children":6821},{"class":478,"line":541},[6822,6826,6830,6834,6838,6842,6846,6850,6854],{"type":47,"tag":476,"props":6823,"children":6824},{"style":493},[6825],{"type":52,"value":496},{"type":47,"tag":476,"props":6827,"children":6828},{"style":499},[6829],{"type":52,"value":502},{"type":47,"tag":476,"props":6831,"children":6832},{"style":505},[6833],{"type":52,"value":5842},{"type":47,"tag":476,"props":6835,"children":6836},{"style":499},[6837],{"type":52,"value":513},{"type":47,"tag":476,"props":6839,"children":6840},{"style":493},[6841],{"type":52,"value":518},{"type":47,"tag":476,"props":6843,"children":6844},{"style":499},[6845],{"type":52,"value":523},{"type":47,"tag":476,"props":6847,"children":6848},{"style":526},[6849],{"type":52,"value":108},{"type":47,"tag":476,"props":6851,"children":6852},{"style":499},[6853],{"type":52,"value":533},{"type":47,"tag":476,"props":6855,"children":6856},{"style":499},[6857],{"type":52,"value":538},{"type":47,"tag":476,"props":6859,"children":6860},{"class":478,"line":582},[6861,6865,6869,6873,6877,6881,6885,6889,6893],{"type":47,"tag":476,"props":6862,"children":6863},{"style":493},[6864],{"type":52,"value":496},{"type":47,"tag":476,"props":6866,"children":6867},{"style":499},[6868],{"type":52,"value":502},{"type":47,"tag":476,"props":6870,"children":6871},{"style":505},[6872],{"type":52,"value":1781},{"type":47,"tag":476,"props":6874,"children":6875},{"style":499},[6876],{"type":52,"value":513},{"type":47,"tag":476,"props":6878,"children":6879},{"style":493},[6880],{"type":52,"value":518},{"type":47,"tag":476,"props":6882,"children":6883},{"style":499},[6884],{"type":52,"value":523},{"type":47,"tag":476,"props":6886,"children":6887},{"style":526},[6888],{"type":52,"value":3723},{"type":47,"tag":476,"props":6890,"children":6891},{"style":499},[6892],{"type":52,"value":533},{"type":47,"tag":476,"props":6894,"children":6895},{"style":499},[6896],{"type":52,"value":538},{"type":47,"tag":476,"props":6898,"children":6899},{"class":478,"line":27},[6900],{"type":47,"tag":476,"props":6901,"children":6902},{"emptyLinePlaceholder":586},[6903],{"type":52,"value":589},{"type":47,"tag":476,"props":6905,"children":6906},{"class":478,"line":600},[6907,6911,6915,6919,6924,6928,6933,6937,6942,6946,6950,6955,6959,6963,6967,6971,6975,6979,6983,6987,6991,6995],{"type":47,"tag":476,"props":6908,"children":6909},{"style":493},[6910],{"type":52,"value":606},{"type":47,"tag":476,"props":6912,"children":6913},{"style":609},[6914],{"type":52,"value":2119},{"type":47,"tag":476,"props":6916,"children":6917},{"style":609},[6918],{"type":52,"value":3754},{"type":47,"tag":476,"props":6920,"children":6921},{"style":625},[6922],{"type":52,"value":6923}," GET",{"type":47,"tag":476,"props":6925,"children":6926},{"style":499},[6927],{"type":52,"value":632},{"type":47,"tag":476,"props":6929,"children":6930},{"style":659},[6931],{"type":52,"value":6932},"req",{"type":47,"tag":476,"props":6934,"children":6935},{"style":499},[6936],{"type":52,"value":651},{"type":47,"tag":476,"props":6938,"children":6939},{"style":669},[6940],{"type":52,"value":6941}," Request",{"type":47,"tag":476,"props":6943,"children":6944},{"style":499},[6945],{"type":52,"value":865},{"type":47,"tag":476,"props":6947,"children":6948},{"style":499},[6949],{"type":52,"value":502},{"type":47,"tag":476,"props":6951,"children":6952},{"style":659},[6953],{"type":52,"value":6954}," params",{"type":47,"tag":476,"props":6956,"children":6957},{"style":499},[6958],{"type":52,"value":4252},{"type":47,"tag":476,"props":6960,"children":6961},{"style":499},[6962],{"type":52,"value":502},{"type":47,"tag":476,"props":6964,"children":6965},{"style":717},[6966],{"type":52,"value":6954},{"type":47,"tag":476,"props":6968,"children":6969},{"style":499},[6970],{"type":52,"value":651},{"type":47,"tag":476,"props":6972,"children":6973},{"style":499},[6974],{"type":52,"value":502},{"type":47,"tag":476,"props":6976,"children":6977},{"style":717},[6978],{"type":52,"value":2039},{"type":47,"tag":476,"props":6980,"children":6981},{"style":499},[6982],{"type":52,"value":651},{"type":47,"tag":476,"props":6984,"children":6985},{"style":669},[6986],{"type":52,"value":672},{"type":47,"tag":476,"props":6988,"children":6989},{"style":499},[6990],{"type":52,"value":513},{"type":47,"tag":476,"props":6992,"children":6993},{"style":499},[6994],{"type":52,"value":2014},{"type":47,"tag":476,"props":6996,"children":6997},{"style":499},[6998],{"type":52,"value":729},{"type":47,"tag":476,"props":7000,"children":7001},{"class":478,"line":640},[7002],{"type":47,"tag":476,"props":7003,"children":7004},{"style":483},[7005],{"type":52,"value":7006},"  \u002F\u002F ⚠ AUTHORIZATION GATE: same rule as the server-action token mint above.\n",{"type":47,"tag":476,"props":7008,"children":7009},{"class":478,"line":713},[7010],{"type":47,"tag":476,"props":7011,"children":7012},{"style":483},[7013],{"type":52,"value":7014},"  \u002F\u002F Authenticate the request and confirm the caller owns params.orderId\n",{"type":47,"tag":476,"props":7016,"children":7017},{"class":478,"line":732},[7018],{"type":47,"tag":476,"props":7019,"children":7020},{"style":483},[7021],{"type":52,"value":7022},"  \u002F\u002F before opening the SSE stream. Skipping this leaks every order's\n",{"type":47,"tag":476,"props":7024,"children":7025},{"class":478,"line":749},[7026],{"type":47,"tag":476,"props":7027,"children":7028},{"style":483},[7029],{"type":52,"value":7030},"  \u002F\u002F step events to anyone with a URL.\n",{"type":47,"tag":476,"props":7032,"children":7033},{"class":478,"line":784},[7034],{"type":47,"tag":476,"props":7035,"children":7036},{"emptyLinePlaceholder":586},[7037],{"type":52,"value":589},{"type":47,"tag":476,"props":7039,"children":7040},{"class":478,"line":819},[7041,7045,7050,7054,7058,7062,7066],{"type":47,"tag":476,"props":7042,"children":7043},{"style":609},[7044],{"type":52,"value":4284},{"type":47,"tag":476,"props":7046,"children":7047},{"style":505},[7048],{"type":52,"value":7049}," stream",{"type":47,"tag":476,"props":7051,"children":7052},{"style":499},[7053],{"type":52,"value":2066},{"type":47,"tag":476,"props":7055,"children":7056},{"style":493},[7057],{"type":52,"value":2733},{"type":47,"tag":476,"props":7059,"children":7060},{"style":625},[7061],{"type":52,"value":5842},{"type":47,"tag":476,"props":7063,"children":7064},{"style":717},[7065],{"type":52,"value":632},{"type":47,"tag":476,"props":7067,"children":7068},{"style":499},[7069],{"type":52,"value":637},{"type":47,"tag":476,"props":7071,"children":7072},{"class":478,"line":907},[7073,7078,7082,7086],{"type":47,"tag":476,"props":7074,"children":7075},{"style":717},[7076],{"type":52,"value":7077},"    app",{"type":47,"tag":476,"props":7079,"children":7080},{"style":499},[7081],{"type":52,"value":651},{"type":47,"tag":476,"props":7083,"children":7084},{"style":505},[7085],{"type":52,"value":1740},{"type":47,"tag":476,"props":7087,"children":7088},{"style":499},[7089],{"type":52,"value":710},{"type":47,"tag":476,"props":7091,"children":7092},{"class":478,"line":989},[7093,7097,7101,7105,7109,7114,7118,7122,7126],{"type":47,"tag":476,"props":7094,"children":7095},{"style":717},[7096],{"type":52,"value":3898},{"type":47,"tag":476,"props":7098,"children":7099},{"style":499},[7100],{"type":52,"value":651},{"type":47,"tag":476,"props":7102,"children":7103},{"style":625},[7104],{"type":52,"value":1781},{"type":47,"tag":476,"props":7106,"children":7107},{"style":717},[7108],{"type":52,"value":632},{"type":47,"tag":476,"props":7110,"children":7111},{"style":505},[7112],{"type":52,"value":7113},"params",{"type":47,"tag":476,"props":7115,"children":7116},{"style":499},[7117],{"type":52,"value":768},{"type":47,"tag":476,"props":7119,"children":7120},{"style":505},[7121],{"type":52,"value":662},{"type":47,"tag":476,"props":7123,"children":7124},{"style":717},[7125],{"type":52,"value":255},{"type":47,"tag":476,"props":7127,"children":7128},{"style":499},[7129],{"type":52,"value":710},{"type":47,"tag":476,"props":7131,"children":7132},{"class":478,"line":1023},[7133,7137,7141,7145,7149,7153,7157,7161],{"type":47,"tag":476,"props":7134,"children":7135},{"style":717},[7136],{"type":52,"value":3930},{"type":47,"tag":476,"props":7138,"children":7139},{"style":499},[7140],{"type":52,"value":651},{"type":47,"tag":476,"props":7142,"children":7143},{"style":717},[7144],{"type":52,"value":1936},{"type":47,"tag":476,"props":7146,"children":7147},{"style":499},[7148],{"type":52,"value":533},{"type":47,"tag":476,"props":7150,"children":7151},{"style":526},[7152],{"type":52,"value":2412},{"type":47,"tag":476,"props":7154,"children":7155},{"style":499},[7156],{"type":52,"value":533},{"type":47,"tag":476,"props":7158,"children":7159},{"style":717},[7160],{"type":52,"value":1972},{"type":47,"tag":476,"props":7162,"children":7163},{"style":499},[7164],{"type":52,"value":710},{"type":47,"tag":476,"props":7166,"children":7167},{"class":478,"line":1040},[7168,7172,7176],{"type":47,"tag":476,"props":7169,"children":7170},{"style":499},[7171],{"type":52,"value":3966},{"type":47,"tag":476,"props":7173,"children":7174},{"style":717},[7175],{"type":52,"value":255},{"type":47,"tag":476,"props":7177,"children":7178},{"style":499},[7179],{"type":52,"value":538},{"type":47,"tag":476,"props":7181,"children":7182},{"class":478,"line":1049},[7183],{"type":47,"tag":476,"props":7184,"children":7185},{"emptyLinePlaceholder":586},[7186],{"type":52,"value":589},{"type":47,"tag":476,"props":7188,"children":7189},{"class":478,"line":1058},[7190,7194,7199,7204,7208,7213,7217,7222,7226,7230],{"type":47,"tag":476,"props":7191,"children":7192},{"style":493},[7193],{"type":52,"value":3870},{"type":47,"tag":476,"props":7195,"children":7196},{"style":499},[7197],{"type":52,"value":7198}," new",{"type":47,"tag":476,"props":7200,"children":7201},{"style":625},[7202],{"type":52,"value":7203}," Response",{"type":47,"tag":476,"props":7205,"children":7206},{"style":717},[7207],{"type":52,"value":632},{"type":47,"tag":476,"props":7209,"children":7210},{"style":505},[7211],{"type":52,"value":7212},"stream",{"type":47,"tag":476,"props":7214,"children":7215},{"style":499},[7216],{"type":52,"value":768},{"type":47,"tag":476,"props":7218,"children":7219},{"style":625},[7220],{"type":52,"value":7221},"getEncodedStream",{"type":47,"tag":476,"props":7223,"children":7224},{"style":717},[7225],{"type":52,"value":812},{"type":47,"tag":476,"props":7227,"children":7228},{"style":499},[7229],{"type":52,"value":865},{"type":47,"tag":476,"props":7231,"children":7232},{"style":499},[7233],{"type":52,"value":729},{"type":47,"tag":476,"props":7235,"children":7236},{"class":478,"line":1075},[7237,7242,7246],{"type":47,"tag":476,"props":7238,"children":7239},{"style":717},[7240],{"type":52,"value":7241},"    headers",{"type":47,"tag":476,"props":7243,"children":7244},{"style":499},[7245],{"type":52,"value":651},{"type":47,"tag":476,"props":7247,"children":7248},{"style":499},[7249],{"type":52,"value":729},{"type":47,"tag":476,"props":7251,"children":7252},{"class":478,"line":1083},[7253,7258,7263,7267,7271,7275,7280,7284],{"type":47,"tag":476,"props":7254,"children":7255},{"style":499},[7256],{"type":52,"value":7257},"      '",{"type":47,"tag":476,"props":7259,"children":7260},{"style":717},[7261],{"type":52,"value":7262},"Content-Type",{"type":47,"tag":476,"props":7264,"children":7265},{"style":499},[7266],{"type":52,"value":533},{"type":47,"tag":476,"props":7268,"children":7269},{"style":499},[7270],{"type":52,"value":651},{"type":47,"tag":476,"props":7272,"children":7273},{"style":499},[7274],{"type":52,"value":523},{"type":47,"tag":476,"props":7276,"children":7277},{"style":526},[7278],{"type":52,"value":7279},"text\u002Fevent-stream",{"type":47,"tag":476,"props":7281,"children":7282},{"style":499},[7283],{"type":52,"value":533},{"type":47,"tag":476,"props":7285,"children":7286},{"style":499},[7287],{"type":52,"value":710},{"type":47,"tag":476,"props":7289,"children":7290},{"class":478,"line":1092},[7291,7295,7300,7304,7308,7312,7317,7321],{"type":47,"tag":476,"props":7292,"children":7293},{"style":499},[7294],{"type":52,"value":7257},{"type":47,"tag":476,"props":7296,"children":7297},{"style":717},[7298],{"type":52,"value":7299},"Cache-Control",{"type":47,"tag":476,"props":7301,"children":7302},{"style":499},[7303],{"type":52,"value":533},{"type":47,"tag":476,"props":7305,"children":7306},{"style":499},[7307],{"type":52,"value":651},{"type":47,"tag":476,"props":7309,"children":7310},{"style":499},[7311],{"type":52,"value":523},{"type":47,"tag":476,"props":7313,"children":7314},{"style":526},[7315],{"type":52,"value":7316},"no-cache",{"type":47,"tag":476,"props":7318,"children":7319},{"style":499},[7320],{"type":52,"value":533},{"type":47,"tag":476,"props":7322,"children":7323},{"style":499},[7324],{"type":52,"value":710},{"type":47,"tag":476,"props":7326,"children":7327},{"class":478,"line":1125},[7328,7333,7337,7341,7346,7350],{"type":47,"tag":476,"props":7329,"children":7330},{"style":717},[7331],{"type":52,"value":7332},"      Connection",{"type":47,"tag":476,"props":7334,"children":7335},{"style":499},[7336],{"type":52,"value":651},{"type":47,"tag":476,"props":7338,"children":7339},{"style":499},[7340],{"type":52,"value":523},{"type":47,"tag":476,"props":7342,"children":7343},{"style":526},[7344],{"type":52,"value":7345},"keep-alive",{"type":47,"tag":476,"props":7347,"children":7348},{"style":499},[7349],{"type":52,"value":533},{"type":47,"tag":476,"props":7351,"children":7352},{"style":499},[7353],{"type":52,"value":710},{"type":47,"tag":476,"props":7355,"children":7356},{"class":478,"line":1154},[7357],{"type":47,"tag":476,"props":7358,"children":7359},{"style":499},[7360],{"type":52,"value":1046},{"type":47,"tag":476,"props":7362,"children":7363},{"class":478,"line":1170},[7364,7368,7372],{"type":47,"tag":476,"props":7365,"children":7366},{"style":499},[7367],{"type":52,"value":3966},{"type":47,"tag":476,"props":7369,"children":7370},{"style":717},[7371],{"type":52,"value":255},{"type":47,"tag":476,"props":7373,"children":7374},{"style":499},[7375],{"type":52,"value":538},{"type":47,"tag":476,"props":7377,"children":7378},{"class":478,"line":1187},[7379],{"type":47,"tag":476,"props":7380,"children":7381},{"style":499},[7382],{"type":52,"value":3982},{"type":47,"tag":55,"props":7384,"children":7385},{},[7386,7388,7394,7396,7401,7403,7408],{"type":52,"value":7387},"Client consumes via ",{"type":47,"tag":103,"props":7389,"children":7391},{"className":7390},[],[7392],{"type":52,"value":7393},"fetch().getReader()",{"type":52,"value":7395}," rather than the ",{"type":47,"tag":103,"props":7397,"children":7399},{"className":7398},[],[7400],{"type":52,"value":450},{"type":52,"value":7402}," callback. Use this when you want the SSE behavior or when the client-side ",{"type":47,"tag":103,"props":7404,"children":7406},{"className":7405},[],[7407],{"type":52,"value":450},{"type":52,"value":7409}," API doesn't fit your component lifecycle.",{"type":47,"tag":192,"props":7411,"children":7413},{"id":7412},"pattern-human-in-the-loop",[7414],{"type":52,"value":7415},"Pattern: Human-in-the-loop",{"type":47,"tag":55,"props":7417,"children":7418},{},[7419,7421,7426,7428,7434],{"type":52,"value":7420},"Combine ",{"type":47,"tag":103,"props":7422,"children":7424},{"className":7423},[],[7425],{"type":52,"value":408},{"type":52,"value":7427}," with ",{"type":47,"tag":103,"props":7429,"children":7431},{"className":7430},[],[7432],{"type":52,"value":7433},"step.waitForEvent",{"type":52,"value":651},{"type":47,"tag":465,"props":7436,"children":7438},{"className":467,"code":7437,"language":469,"meta":470,"style":470},"import crypto from 'crypto';\n\nexport const reviewWorkflow = inngest.createFunction(\n  { id: 'review-workflow', triggers: [{ event: 'review\u002Fstart' }] },\n  async ({ event, step }) => {\n    const confirmationId = await step.run('gen-id', () => crypto.randomUUID());\n\n    \u002F\u002F Publish a prompt — the client subscribes and renders an approval UI\n    await step.realtime.publish(\n      'publish-prompt',\n      reviewChannel.message,\n      { message: 'Confirm to proceed?', confirmationId },\n    );\n\n    \u002F\u002F Wait up to 15 minutes for the user to send the matching event back\n    const confirmation = await step.waitForEvent('await-confirmation', {\n      event: 'review\u002Fconfirmation',\n      timeout: '15m',\n      if: `async.data.confirmationId == \"${confirmationId}\"`,\n    });\n\n    if (!confirmation) {\n      \u002F\u002F user didn't respond — abort or escalate\n      return { decision: 'timed_out' };\n    }\n    \u002F\u002F continue workflow...\n  },\n);\n",[7439],{"type":47,"tag":103,"props":7440,"children":7441},{"__ignoreMap":470},[7442,7475,7482,7518,7603,7638,7721,7728,7736,7767,7787,7807,7848,7860,7867,7875,7933,7962,7991,8038,8053,8060,8090,8098,8136,8144,8152,8159],{"type":47,"tag":476,"props":7443,"children":7444},{"class":478,"line":479},[7445,7449,7454,7458,7462,7467,7471],{"type":47,"tag":476,"props":7446,"children":7447},{"style":493},[7448],{"type":52,"value":496},{"type":47,"tag":476,"props":7450,"children":7451},{"style":505},[7452],{"type":52,"value":7453}," crypto ",{"type":47,"tag":476,"props":7455,"children":7456},{"style":493},[7457],{"type":52,"value":5809},{"type":47,"tag":476,"props":7459,"children":7460},{"style":499},[7461],{"type":52,"value":523},{"type":47,"tag":476,"props":7463,"children":7464},{"style":526},[7465],{"type":52,"value":7466},"crypto",{"type":47,"tag":476,"props":7468,"children":7469},{"style":499},[7470],{"type":52,"value":533},{"type":47,"tag":476,"props":7472,"children":7473},{"style":499},[7474],{"type":52,"value":538},{"type":47,"tag":476,"props":7476,"children":7477},{"class":478,"line":489},[7478],{"type":47,"tag":476,"props":7479,"children":7480},{"emptyLinePlaceholder":586},[7481],{"type":52,"value":589},{"type":47,"tag":476,"props":7483,"children":7484},{"class":478,"line":541},[7485,7489,7493,7498,7502,7506,7510,7514],{"type":47,"tag":476,"props":7486,"children":7487},{"style":493},[7488],{"type":52,"value":606},{"type":47,"tag":476,"props":7490,"children":7491},{"style":609},[7492],{"type":52,"value":612},{"type":47,"tag":476,"props":7494,"children":7495},{"style":505},[7496],{"type":52,"value":7497}," reviewWorkflow ",{"type":47,"tag":476,"props":7499,"children":7500},{"style":499},[7501],{"type":52,"value":622},{"type":47,"tag":476,"props":7503,"children":7504},{"style":505},[7505],{"type":52,"value":1740},{"type":47,"tag":476,"props":7507,"children":7508},{"style":499},[7509],{"type":52,"value":768},{"type":47,"tag":476,"props":7511,"children":7512},{"style":625},[7513],{"type":52,"value":1855},{"type":47,"tag":476,"props":7515,"children":7516},{"style":505},[7517],{"type":52,"value":1860},{"type":47,"tag":476,"props":7519,"children":7520},{"class":478,"line":582},[7521,7526,7531,7535,7539,7544,7548,7552,7557,7561,7565,7569,7573,7577,7581,7586,7590,7594,7598],{"type":47,"tag":476,"props":7522,"children":7523},{"style":499},[7524],{"type":52,"value":7525},"  {",{"type":47,"tag":476,"props":7527,"children":7528},{"style":717},[7529],{"type":52,"value":7530}," id",{"type":47,"tag":476,"props":7532,"children":7533},{"style":499},[7534],{"type":52,"value":651},{"type":47,"tag":476,"props":7536,"children":7537},{"style":499},[7538],{"type":52,"value":523},{"type":47,"tag":476,"props":7540,"children":7541},{"style":526},[7542],{"type":52,"value":7543},"review-workflow",{"type":47,"tag":476,"props":7545,"children":7546},{"style":499},[7547],{"type":52,"value":533},{"type":47,"tag":476,"props":7549,"children":7550},{"style":499},[7551],{"type":52,"value":865},{"type":47,"tag":476,"props":7553,"children":7554},{"style":717},[7555],{"type":52,"value":7556}," triggers",{"type":47,"tag":476,"props":7558,"children":7559},{"style":499},[7560],{"type":52,"value":651},{"type":47,"tag":476,"props":7562,"children":7563},{"style":505},[7564],{"type":52,"value":1936},{"type":47,"tag":476,"props":7566,"children":7567},{"style":499},[7568],{"type":52,"value":1941},{"type":47,"tag":476,"props":7570,"children":7571},{"style":717},[7572],{"type":52,"value":1946},{"type":47,"tag":476,"props":7574,"children":7575},{"style":499},[7576],{"type":52,"value":651},{"type":47,"tag":476,"props":7578,"children":7579},{"style":499},[7580],{"type":52,"value":523},{"type":47,"tag":476,"props":7582,"children":7583},{"style":526},[7584],{"type":52,"value":7585},"review\u002Fstart",{"type":47,"tag":476,"props":7587,"children":7588},{"style":499},[7589],{"type":52,"value":533},{"type":47,"tag":476,"props":7591,"children":7592},{"style":499},[7593],{"type":52,"value":513},{"type":47,"tag":476,"props":7595,"children":7596},{"style":505},[7597],{"type":52,"value":4394},{"type":47,"tag":476,"props":7599,"children":7600},{"style":499},[7601],{"type":52,"value":7602},"},\n",{"type":47,"tag":476,"props":7604,"children":7605},{"class":478,"line":27},[7606,7610,7614,7618,7622,7626,7630,7634],{"type":47,"tag":476,"props":7607,"children":7608},{"style":609},[7609],{"type":52,"value":1991},{"type":47,"tag":476,"props":7611,"children":7612},{"style":499},[7613],{"type":52,"value":1996},{"type":47,"tag":476,"props":7615,"children":7616},{"style":659},[7617],{"type":52,"value":1946},{"type":47,"tag":476,"props":7619,"children":7620},{"style":499},[7621],{"type":52,"value":865},{"type":47,"tag":476,"props":7623,"children":7624},{"style":659},[7625],{"type":52,"value":2009},{"type":47,"tag":476,"props":7627,"children":7628},{"style":499},[7629],{"type":52,"value":2014},{"type":47,"tag":476,"props":7631,"children":7632},{"style":609},[7633],{"type":52,"value":681},{"type":47,"tag":476,"props":7635,"children":7636},{"style":499},[7637],{"type":52,"value":729},{"type":47,"tag":476,"props":7639,"children":7640},{"class":478,"line":600},[7641,7645,7650,7654,7658,7662,7666,7670,7674,7678,7683,7687,7691,7695,7699,7704,7708,7713,7717],{"type":47,"tag":476,"props":7642,"children":7643},{"style":609},[7644],{"type":52,"value":2030},{"type":47,"tag":476,"props":7646,"children":7647},{"style":505},[7648],{"type":52,"value":7649}," confirmationId",{"type":47,"tag":476,"props":7651,"children":7652},{"style":499},[7653],{"type":52,"value":2066},{"type":47,"tag":476,"props":7655,"children":7656},{"style":493},[7657],{"type":52,"value":2733},{"type":47,"tag":476,"props":7659,"children":7660},{"style":505},[7661],{"type":52,"value":2009},{"type":47,"tag":476,"props":7663,"children":7664},{"style":499},[7665],{"type":52,"value":768},{"type":47,"tag":476,"props":7667,"children":7668},{"style":625},[7669],{"type":52,"value":2746},{"type":47,"tag":476,"props":7671,"children":7672},{"style":717},[7673],{"type":52,"value":632},{"type":47,"tag":476,"props":7675,"children":7676},{"style":499},[7677],{"type":52,"value":533},{"type":47,"tag":476,"props":7679,"children":7680},{"style":526},[7681],{"type":52,"value":7682},"gen-id",{"type":47,"tag":476,"props":7684,"children":7685},{"style":499},[7686],{"type":52,"value":533},{"type":47,"tag":476,"props":7688,"children":7689},{"style":499},[7690],{"type":52,"value":865},{"type":47,"tag":476,"props":7692,"children":7693},{"style":499},[7694],{"type":52,"value":2775},{"type":47,"tag":476,"props":7696,"children":7697},{"style":609},[7698],{"type":52,"value":681},{"type":47,"tag":476,"props":7700,"children":7701},{"style":505},[7702],{"type":52,"value":7703}," crypto",{"type":47,"tag":476,"props":7705,"children":7706},{"style":499},[7707],{"type":52,"value":768},{"type":47,"tag":476,"props":7709,"children":7710},{"style":625},[7711],{"type":52,"value":7712},"randomUUID",{"type":47,"tag":476,"props":7714,"children":7715},{"style":717},[7716],{"type":52,"value":969},{"type":47,"tag":476,"props":7718,"children":7719},{"style":499},[7720],{"type":52,"value":538},{"type":47,"tag":476,"props":7722,"children":7723},{"class":478,"line":640},[7724],{"type":47,"tag":476,"props":7725,"children":7726},{"emptyLinePlaceholder":586},[7727],{"type":52,"value":589},{"type":47,"tag":476,"props":7729,"children":7730},{"class":478,"line":713},[7731],{"type":47,"tag":476,"props":7732,"children":7733},{"style":483},[7734],{"type":52,"value":7735},"    \u002F\u002F Publish a prompt — the client subscribes and renders an approval UI\n",{"type":47,"tag":476,"props":7737,"children":7738},{"class":478,"line":732},[7739,7743,7747,7751,7755,7759,7763],{"type":47,"tag":476,"props":7740,"children":7741},{"style":493},[7742],{"type":52,"value":2649},{"type":47,"tag":476,"props":7744,"children":7745},{"style":505},[7746],{"type":52,"value":2009},{"type":47,"tag":476,"props":7748,"children":7749},{"style":499},[7750],{"type":52,"value":768},{"type":47,"tag":476,"props":7752,"children":7753},{"style":505},[7754],{"type":52,"value":2323},{"type":47,"tag":476,"props":7756,"children":7757},{"style":499},[7758],{"type":52,"value":768},{"type":47,"tag":476,"props":7760,"children":7761},{"style":625},[7762],{"type":52,"value":1514},{"type":47,"tag":476,"props":7764,"children":7765},{"style":717},[7766],{"type":52,"value":1860},{"type":47,"tag":476,"props":7768,"children":7769},{"class":478,"line":749},[7770,7774,7779,7783],{"type":47,"tag":476,"props":7771,"children":7772},{"style":499},[7773],{"type":52,"value":7257},{"type":47,"tag":476,"props":7775,"children":7776},{"style":526},[7777],{"type":52,"value":7778},"publish-prompt",{"type":47,"tag":476,"props":7780,"children":7781},{"style":499},[7782],{"type":52,"value":533},{"type":47,"tag":476,"props":7784,"children":7785},{"style":499},[7786],{"type":52,"value":710},{"type":47,"tag":476,"props":7788,"children":7789},{"class":478,"line":784},[7790,7795,7799,7803],{"type":47,"tag":476,"props":7791,"children":7792},{"style":505},[7793],{"type":52,"value":7794},"      reviewChannel",{"type":47,"tag":476,"props":7796,"children":7797},{"style":499},[7798],{"type":52,"value":768},{"type":47,"tag":476,"props":7800,"children":7801},{"style":505},[7802],{"type":52,"value":4535},{"type":47,"tag":476,"props":7804,"children":7805},{"style":499},[7806],{"type":52,"value":710},{"type":47,"tag":476,"props":7808,"children":7809},{"class":478,"line":819},[7810,7815,7819,7823,7827,7832,7836,7840,7844],{"type":47,"tag":476,"props":7811,"children":7812},{"style":499},[7813],{"type":52,"value":7814},"      {",{"type":47,"tag":476,"props":7816,"children":7817},{"style":717},[7818],{"type":52,"value":6556},{"type":47,"tag":476,"props":7820,"children":7821},{"style":499},[7822],{"type":52,"value":651},{"type":47,"tag":476,"props":7824,"children":7825},{"style":499},[7826],{"type":52,"value":523},{"type":47,"tag":476,"props":7828,"children":7829},{"style":526},[7830],{"type":52,"value":7831},"Confirm to proceed?",{"type":47,"tag":476,"props":7833,"children":7834},{"style":499},[7835],{"type":52,"value":533},{"type":47,"tag":476,"props":7837,"children":7838},{"style":499},[7839],{"type":52,"value":865},{"type":47,"tag":476,"props":7841,"children":7842},{"style":505},[7843],{"type":52,"value":7649},{"type":47,"tag":476,"props":7845,"children":7846},{"style":499},[7847],{"type":52,"value":2460},{"type":47,"tag":476,"props":7849,"children":7850},{"class":478,"line":907},[7851,7856],{"type":47,"tag":476,"props":7852,"children":7853},{"style":717},[7854],{"type":52,"value":7855},"    )",{"type":47,"tag":476,"props":7857,"children":7858},{"style":499},[7859],{"type":52,"value":538},{"type":47,"tag":476,"props":7861,"children":7862},{"class":478,"line":989},[7863],{"type":47,"tag":476,"props":7864,"children":7865},{"emptyLinePlaceholder":586},[7866],{"type":52,"value":589},{"type":47,"tag":476,"props":7868,"children":7869},{"class":478,"line":1023},[7870],{"type":47,"tag":476,"props":7871,"children":7872},{"style":483},[7873],{"type":52,"value":7874},"    \u002F\u002F Wait up to 15 minutes for the user to send the matching event back\n",{"type":47,"tag":476,"props":7876,"children":7877},{"class":478,"line":1040},[7878,7882,7887,7891,7895,7899,7903,7908,7912,7916,7921,7925,7929],{"type":47,"tag":476,"props":7879,"children":7880},{"style":609},[7881],{"type":52,"value":2030},{"type":47,"tag":476,"props":7883,"children":7884},{"style":505},[7885],{"type":52,"value":7886}," confirmation",{"type":47,"tag":476,"props":7888,"children":7889},{"style":499},[7890],{"type":52,"value":2066},{"type":47,"tag":476,"props":7892,"children":7893},{"style":493},[7894],{"type":52,"value":2733},{"type":47,"tag":476,"props":7896,"children":7897},{"style":505},[7898],{"type":52,"value":2009},{"type":47,"tag":476,"props":7900,"children":7901},{"style":499},[7902],{"type":52,"value":768},{"type":47,"tag":476,"props":7904,"children":7905},{"style":625},[7906],{"type":52,"value":7907},"waitForEvent",{"type":47,"tag":476,"props":7909,"children":7910},{"style":717},[7911],{"type":52,"value":632},{"type":47,"tag":476,"props":7913,"children":7914},{"style":499},[7915],{"type":52,"value":533},{"type":47,"tag":476,"props":7917,"children":7918},{"style":526},[7919],{"type":52,"value":7920},"await-confirmation",{"type":47,"tag":476,"props":7922,"children":7923},{"style":499},[7924],{"type":52,"value":533},{"type":47,"tag":476,"props":7926,"children":7927},{"style":499},[7928],{"type":52,"value":865},{"type":47,"tag":476,"props":7930,"children":7931},{"style":499},[7932],{"type":52,"value":729},{"type":47,"tag":476,"props":7934,"children":7935},{"class":478,"line":1049},[7936,7941,7945,7949,7954,7958],{"type":47,"tag":476,"props":7937,"children":7938},{"style":717},[7939],{"type":52,"value":7940},"      event",{"type":47,"tag":476,"props":7942,"children":7943},{"style":499},[7944],{"type":52,"value":651},{"type":47,"tag":476,"props":7946,"children":7947},{"style":499},[7948],{"type":52,"value":523},{"type":47,"tag":476,"props":7950,"children":7951},{"style":526},[7952],{"type":52,"value":7953},"review\u002Fconfirmation",{"type":47,"tag":476,"props":7955,"children":7956},{"style":499},[7957],{"type":52,"value":533},{"type":47,"tag":476,"props":7959,"children":7960},{"style":499},[7961],{"type":52,"value":710},{"type":47,"tag":476,"props":7963,"children":7964},{"class":478,"line":1058},[7965,7970,7974,7978,7983,7987],{"type":47,"tag":476,"props":7966,"children":7967},{"style":717},[7968],{"type":52,"value":7969},"      timeout",{"type":47,"tag":476,"props":7971,"children":7972},{"style":499},[7973],{"type":52,"value":651},{"type":47,"tag":476,"props":7975,"children":7976},{"style":499},[7977],{"type":52,"value":523},{"type":47,"tag":476,"props":7979,"children":7980},{"style":526},[7981],{"type":52,"value":7982},"15m",{"type":47,"tag":476,"props":7984,"children":7985},{"style":499},[7986],{"type":52,"value":533},{"type":47,"tag":476,"props":7988,"children":7989},{"style":499},[7990],{"type":52,"value":710},{"type":47,"tag":476,"props":7992,"children":7993},{"class":478,"line":1075},[7994,7998,8002,8006,8011,8015,8020,8024,8029,8034],{"type":47,"tag":476,"props":7995,"children":7996},{"style":717},[7997],{"type":52,"value":6258},{"type":47,"tag":476,"props":7999,"children":8000},{"style":499},[8001],{"type":52,"value":651},{"type":47,"tag":476,"props":8003,"children":8004},{"style":499},[8005],{"type":52,"value":686},{"type":47,"tag":476,"props":8007,"children":8008},{"style":526},[8009],{"type":52,"value":8010},"async.data.confirmationId == \"",{"type":47,"tag":476,"props":8012,"children":8013},{"style":499},[8014],{"type":52,"value":696},{"type":47,"tag":476,"props":8016,"children":8017},{"style":505},[8018],{"type":52,"value":8019},"confirmationId",{"type":47,"tag":476,"props":8021,"children":8022},{"style":499},[8023],{"type":52,"value":1064},{"type":47,"tag":476,"props":8025,"children":8026},{"style":526},[8027],{"type":52,"value":8028},"\"",{"type":47,"tag":476,"props":8030,"children":8031},{"style":499},[8032],{"type":52,"value":8033},"`",{"type":47,"tag":476,"props":8035,"children":8036},{"style":499},[8037],{"type":52,"value":710},{"type":47,"tag":476,"props":8039,"children":8040},{"class":478,"line":1083},[8041,8045,8049],{"type":47,"tag":476,"props":8042,"children":8043},{"style":499},[8044],{"type":52,"value":3181},{"type":47,"tag":476,"props":8046,"children":8047},{"style":717},[8048],{"type":52,"value":255},{"type":47,"tag":476,"props":8050,"children":8051},{"style":499},[8052],{"type":52,"value":538},{"type":47,"tag":476,"props":8054,"children":8055},{"class":478,"line":1092},[8056],{"type":47,"tag":476,"props":8057,"children":8058},{"emptyLinePlaceholder":586},[8059],{"type":52,"value":589},{"type":47,"tag":476,"props":8061,"children":8062},{"class":478,"line":1125},[8063,8068,8072,8077,8082,8086],{"type":47,"tag":476,"props":8064,"children":8065},{"style":493},[8066],{"type":52,"value":8067},"    if",{"type":47,"tag":476,"props":8069,"children":8070},{"style":717},[8071],{"type":52,"value":656},{"type":47,"tag":476,"props":8073,"children":8074},{"style":499},[8075],{"type":52,"value":8076},"!",{"type":47,"tag":476,"props":8078,"children":8079},{"style":505},[8080],{"type":52,"value":8081},"confirmation",{"type":47,"tag":476,"props":8083,"children":8084},{"style":717},[8085],{"type":52,"value":4491},{"type":47,"tag":476,"props":8087,"children":8088},{"style":499},[8089],{"type":52,"value":637},{"type":47,"tag":476,"props":8091,"children":8092},{"class":478,"line":1154},[8093],{"type":47,"tag":476,"props":8094,"children":8095},{"style":483},[8096],{"type":52,"value":8097},"      \u002F\u002F user didn't respond — abort or escalate\n",{"type":47,"tag":476,"props":8099,"children":8100},{"class":478,"line":1170},[8101,8105,8109,8114,8118,8122,8127,8131],{"type":47,"tag":476,"props":8102,"children":8103},{"style":493},[8104],{"type":52,"value":3122},{"type":47,"tag":476,"props":8106,"children":8107},{"style":499},[8108],{"type":52,"value":502},{"type":47,"tag":476,"props":8110,"children":8111},{"style":717},[8112],{"type":52,"value":8113}," decision",{"type":47,"tag":476,"props":8115,"children":8116},{"style":499},[8117],{"type":52,"value":651},{"type":47,"tag":476,"props":8119,"children":8120},{"style":499},[8121],{"type":52,"value":523},{"type":47,"tag":476,"props":8123,"children":8124},{"style":526},[8125],{"type":52,"value":8126},"timed_out",{"type":47,"tag":476,"props":8128,"children":8129},{"style":499},[8130],{"type":52,"value":533},{"type":47,"tag":476,"props":8132,"children":8133},{"style":499},[8134],{"type":52,"value":8135}," };\n",{"type":47,"tag":476,"props":8137,"children":8138},{"class":478,"line":1187},[8139],{"type":47,"tag":476,"props":8140,"children":8141},{"style":499},[8142],{"type":52,"value":8143},"    }\n",{"type":47,"tag":476,"props":8145,"children":8146},{"class":478,"line":23},[8147],{"type":47,"tag":476,"props":8148,"children":8149},{"style":483},[8150],{"type":52,"value":8151},"    \u002F\u002F continue workflow...\n",{"type":47,"tag":476,"props":8153,"children":8154},{"class":478,"line":1251},[8155],{"type":47,"tag":476,"props":8156,"children":8157},{"style":499},[8158],{"type":52,"value":1055},{"type":47,"tag":476,"props":8160,"children":8161},{"class":478,"line":1284},[8162,8166],{"type":47,"tag":476,"props":8163,"children":8164},{"style":505},[8165],{"type":52,"value":255},{"type":47,"tag":476,"props":8167,"children":8168},{"style":499},[8169],{"type":52,"value":538},{"type":47,"tag":55,"props":8171,"children":8172},{},[8173,8174,8179],{"type":52,"value":5150},{"type":47,"tag":103,"props":8175,"children":8177},{"className":8176},[],[8178],{"type":52,"value":8019},{"type":52,"value":8180}," links the published prompt to the matching reply, so the workflow knows which response to act on.",{"type":47,"tag":192,"props":8182,"children":8184},{"id":8183},"common-pitfalls",[8185],{"type":52,"value":8186},"Common pitfalls",{"type":47,"tag":1518,"props":8188,"children":8190},{"id":8189},"dont-use-inngestrealtime-on-v4",[8191,8193,8198],{"type":52,"value":8192},"Don't use ",{"type":47,"tag":103,"props":8194,"children":8196},{"className":8195},[],[8197],{"type":52,"value":116},{"type":52,"value":8199}," on v4",{"type":47,"tag":55,"props":8201,"children":8202},{},[8203,8205,8210,8212,8217],{"type":52,"value":8204},"The standalone ",{"type":47,"tag":103,"props":8206,"children":8208},{"className":8207},[],[8209],{"type":52,"value":116},{"type":52,"value":8211}," package is for Inngest v3 only. On v4, all realtime APIs are in the SDK subpath ",{"type":47,"tag":103,"props":8213,"children":8215},{"className":8214},[],[8216],{"type":52,"value":108},{"type":52,"value":8218},". Mixing them produces:",{"type":47,"tag":199,"props":8220,"children":8221},{},[8222,8239,8244],{"type":47,"tag":203,"props":8223,"children":8224},{},[8225,8230,8232,8237],{"type":47,"tag":103,"props":8226,"children":8228},{"className":8227},[],[8229],{"type":52,"value":156},{"type":52,"value":8231}," on ",{"type":47,"tag":103,"props":8233,"children":8235},{"className":8234},[],[8236],{"type":52,"value":164},{"type":52,"value":8238}," (v3 middleware class signature mismatch)",{"type":47,"tag":203,"props":8240,"children":8241},{},[8242],{"type":52,"value":8243},"401 Unauthorized on subscription tokens",{"type":47,"tag":203,"props":8245,"children":8246},{},[8247],{"type":52,"value":8248},"TypeScript errors casting middleware",{"type":47,"tag":55,"props":8250,"children":8251},{},[8252,8257,8259,8265,8267,8273,8274,8279],{"type":47,"tag":68,"props":8253,"children":8254},{},[8255],{"type":52,"value":8256},"Verify with:",{"type":52,"value":8258}," ",{"type":47,"tag":103,"props":8260,"children":8262},{"className":8261},[],[8263],{"type":52,"value":8264},"grep '\"inngest\"' package.json",{"type":52,"value":8266}," — if it's ",{"type":47,"tag":103,"props":8268,"children":8270},{"className":8269},[],[8271],{"type":52,"value":8272},"^4.x",{"type":52,"value":1677},{"type":47,"tag":103,"props":8275,"children":8277},{"className":8276},[],[8278],{"type":52,"value":108},{"type":52,"value":8280},". Period.",{"type":47,"tag":1518,"props":8282,"children":8284},{"id":8283},"dont-return-channelinstance-from-a-nextjs-server-action-manual-subscribe-path-only",[8285],{"type":52,"value":8286},"Don't return ChannelInstance from a Next.js server action (manual subscribe path only)",{"type":47,"tag":55,"props":8288,"children":8289},{},[8290,8295,8297,8303],{"type":47,"tag":103,"props":8291,"children":8293},{"className":8292},[],[8294],{"type":52,"value":4013},{"type":52,"value":8296}," returns ",{"type":47,"tag":103,"props":8298,"children":8300},{"className":8299},[],[8301],{"type":52,"value":8302},"{ channel: ChannelInstance, ... }",{"type":52,"value":8304}," where ChannelInstance has zod schema methods (a class). Next.js refuses to serialize classes across the server-action → client-component boundary. Strip to primitives before returning. See \"Pattern: Manual subscribe\" above.",{"type":47,"tag":55,"props":8306,"children":8307},{},[8308,8310,8315,8317,8322,8323,8328],{"type":52,"value":8309},"This gotcha does ",{"type":47,"tag":68,"props":8311,"children":8312},{},[8313],{"type":52,"value":8314},"not",{"type":52,"value":8316}," apply when you use ",{"type":47,"tag":103,"props":8318,"children":8320},{"className":8319},[],[8321],{"type":52,"value":3991},{"type":52,"value":3993},{"type":47,"tag":103,"props":8324,"children":8326},{"className":8325},[],[8327],{"type":52,"value":3643},{"type":52,"value":8329}," (Step 3 — the recommended path). That helper returns a serialization-safe shape directly.",{"type":47,"tag":1518,"props":8331,"children":8333},{"id":8332},"inngest_dev1-is-required-for-local-dev",[8334,8339],{"type":47,"tag":103,"props":8335,"children":8337},{"className":8336},[],[8338],{"type":52,"value":232},{"type":52,"value":8340}," is required for local dev",{"type":47,"tag":55,"props":8342,"children":8343},{},[8344,8346,8352,8354,8360,8362,8367,8369,8374],{"type":52,"value":8345},"Without it, the SDK assumes cloud mode and demands ",{"type":47,"tag":103,"props":8347,"children":8349},{"className":8348},[],[8350],{"type":52,"value":8351},"INNGEST_SIGNING_KEY",{"type":52,"value":8353}," + ",{"type":47,"tag":103,"props":8355,"children":8357},{"className":8356},[],[8358],{"type":52,"value":8359},"INNGEST_EVENT_KEY",{"type":52,"value":8361},". All realtime operations 401 \u002F 500. Add to ",{"type":47,"tag":103,"props":8363,"children":8365},{"className":8364},[],[8366],{"type":52,"value":240},{"type":52,"value":8368},". Hard restart the dev server (Next.js does not hot-reload ",{"type":47,"tag":103,"props":8370,"children":8372},{"className":8371},[],[8373],{"type":52,"value":240},{"type":52,"value":8375}," changes).",{"type":47,"tag":1518,"props":8377,"children":8379},{"id":8378},"channel-topic-schemas-validate-on-publish-not-on-consume",[8380],{"type":52,"value":8381},"Channel topic schemas validate on publish, not on consume",{"type":47,"tag":55,"props":8383,"children":8384},{},[8385,8387,8393,8395,8400],{"type":52,"value":8386},"If your published payload doesn't match the zod schema, the publish fails server-side. Subscriber receives nothing. Catch publish errors during step execution, or run with ",{"type":47,"tag":103,"props":8388,"children":8390},{"className":8389},[],[8391],{"type":52,"value":8392},"validate: false",{"type":52,"value":8394}," in ",{"type":47,"tag":103,"props":8396,"children":8398},{"className":8397},[],[8399],{"type":52,"value":450},{"type":52,"value":8401}," if you have a reason to skip schema validation client-side.",{"type":47,"tag":192,"props":8403,"children":8405},{"id":8404},"reference",[8406],{"type":52,"value":8407},"Reference",{"type":47,"tag":199,"props":8409,"children":8410},{},[8411,8452,8514,8535],{"type":47,"tag":203,"props":8412,"children":8413},{},[8414,8416],{"type":52,"value":8415},"v4 entry points:\n",{"type":47,"tag":199,"props":8417,"children":8418},{},[8419,8430,8441],{"type":47,"tag":203,"props":8420,"children":8421},{},[8422,8428],{"type":47,"tag":103,"props":8423,"children":8425},{"className":8424},[],[8426],{"type":52,"value":8427},"import { channel } from 'inngest\u002Frealtime'",{"type":52,"value":8429}," — channel definitions",{"type":47,"tag":203,"props":8431,"children":8432},{},[8433,8439],{"type":47,"tag":103,"props":8434,"children":8436},{"className":8435},[],[8437],{"type":52,"value":8438},"import { useRealtime, getClientSubscriptionToken } from 'inngest\u002Freact'",{"type":52,"value":8440}," — React hook + matching token helper (Step 3 + Step 4)",{"type":47,"tag":203,"props":8442,"children":8443},{},[8444,8450],{"type":47,"tag":103,"props":8445,"children":8447},{"className":8446},[],[8448],{"type":52,"value":8449},"import { getSubscriptionToken, subscribe } from 'inngest\u002Frealtime'",{"type":52,"value":8451}," — lower-level helpers for non-React or custom transport",{"type":47,"tag":203,"props":8453,"children":8454},{},[8455,8457],{"type":52,"value":8456},"Publish methods:\n",{"type":47,"tag":199,"props":8458,"children":8459},{},[8460,8476,8498],{"type":47,"tag":203,"props":8461,"children":8462},{},[8463,8468,8469,8474],{"type":47,"tag":68,"props":8464,"children":8465},{},[8466],{"type":52,"value":8467},"Outside a step:",{"type":52,"value":8258},{"type":47,"tag":103,"props":8470,"children":8472},{"className":8471},[],[8473],{"type":52,"value":1579},{"type":52,"value":8475}," — wraps in a durable step",{"type":47,"tag":203,"props":8477,"children":8478},{},[8479,8490,8491,8496],{"type":47,"tag":68,"props":8480,"children":8481},{},[8482,8484,8489],{"type":52,"value":8483},"Inside ",{"type":47,"tag":103,"props":8485,"children":8487},{"className":8486},[],[8488],{"type":52,"value":424},{"type":52,"value":651},{"type":52,"value":8258},{"type":47,"tag":103,"props":8492,"children":8494},{"className":8493},[],[8495],{"type":52,"value":1620},{"type":52,"value":8497}," — already inside a memoized step, no wrapping needed",{"type":47,"tag":203,"props":8499,"children":8500},{},[8501,8506,8507,8512],{"type":47,"tag":68,"props":8502,"children":8503},{},[8504],{"type":52,"value":8505},"Outside a function:",{"type":52,"value":8258},{"type":47,"tag":103,"props":8508,"children":8510},{"className":8509},[],[8511],{"type":52,"value":1620},{"type":52,"value":8513}," — allowed but not retry-safe",{"type":47,"tag":203,"props":8515,"children":8516},{},[8517,8519,8525,8527,8533],{"type":52,"value":8518},"Subscribe overloads: ",{"type":47,"tag":103,"props":8520,"children":8522},{"className":8521},[],[8523],{"type":52,"value":8524},"subscribe(token)",{"type":52,"value":8526}," returns a stream; ",{"type":47,"tag":103,"props":8528,"children":8530},{"className":8529},[],[8531],{"type":52,"value":8532},"subscribe(token, callback)",{"type":52,"value":8534}," invokes callback per message",{"type":47,"tag":203,"props":8536,"children":8537},{},[8538,8540,8546,8548,8554,8556,8561],{"type":52,"value":8539},"Next.js Server Action gotcha (manual path only): strip ",{"type":47,"tag":103,"props":8541,"children":8543},{"className":8542},[],[8544],{"type":52,"value":8545},"ChannelInstance",{"type":52,"value":8547}," → return ",{"type":47,"tag":103,"props":8549,"children":8551},{"className":8550},[],[8552],{"type":52,"value":8553},"{ channel: string, topics, key, apiBaseUrl }",{"type":52,"value":8555},". Not needed with ",{"type":47,"tag":103,"props":8557,"children":8559},{"className":8558},[],[8560],{"type":52,"value":3991},{"type":52,"value":768},{"type":47,"tag":8563,"props":8564,"children":8565},"style",{},[8566],{"type":52,"value":8567},"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":8569,"total":989},[8570,8590,8603,8617,8630,8645,8660,8673,8685,8698,8714,8721],{"slug":8571,"name":8571,"fn":8572,"description":8573,"org":8574,"tags":8575,"stars":23,"repoUrl":24,"updatedAt":8589},"inngest-agent-evals","build and debug Inngest agent evals","Use when building, migrating, or debugging Agent Evals on Inngest: scoring AI agent or workflow outcomes, deferred scorers, sessions, traces, step experiments, experiment variant attribution, Insights queries, or production eval loops for prompts, models, tools, providers, and agent behavior. Covers TypeScript SDK v4 scoring beta APIs, `scoreMiddleware`, `step.score`, `inngest.score`, `createScorer`, `defer`, `group.experiment`, `experimentRef`, `meta.sessions`, and when to use durable workflow primitives for outcome-based evaluation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8576,8579,8582,8583,8586],{"name":8577,"slug":8578,"type":15},"Agents","agents",{"name":8580,"slug":8581,"type":15},"Evals","evals",{"name":9,"slug":8,"type":15},{"name":8584,"slug":8585,"type":15},"Observability","observability",{"name":8587,"slug":8588,"type":15},"Workflow Automation","workflow-automation","2026-07-12T07:36:51.711641",{"slug":8591,"name":8591,"fn":8592,"description":8593,"org":8594,"tags":8595,"stars":23,"repoUrl":24,"updatedAt":8602},"inngest-agents","build durable AI agent workflows","Use when building durable AI agents or agentic workflows with Inngest and AgentKit, including model calls, tool calls, multi-agent networks, human approval, realtime progress, provider rate limits, crash-safe execution, and Agent Evals handoff. Covers AgentKit, `step.ai`, `step.run`, `step.waitForEvent`, native realtime, and when to use lower-level Inngest primitives instead of an in-memory agent loop. Use `inngest-agent-evals` with this skill when the user wants scoring, sessions, experiments, deferred scorers, or outcome-based evaluation for the agent.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8596,8597,8598,8599],{"name":8577,"slug":8578,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":8600,"slug":8601,"type":15},"LLM","llm","2026-07-12T07:36:45.984181",{"slug":8604,"name":8604,"fn":8605,"description":8606,"org":8607,"tags":8608,"stars":23,"repoUrl":24,"updatedAt":8616},"inngest-api","interact with Inngest REST API","Use when the user explicitly asks for the Inngest REST API v2, raw HTTP, OpenAPI, API docs, API authentication, or an endpoint that the Inngest CLI does not expose. Covers api-docs.inngest.com, llms.txt, the OpenAPI v2 spec, Bearer authentication with API keys or signing keys, production and local base URLs, raw curl\u002Ffetch requests, request-shape discovery, pagination, secret redaction, and when to prefer the `inngest-api-cli` skill instead.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8609,8612,8615],{"name":8610,"slug":8611,"type":15},"API Development","api-development",{"name":8613,"slug":8614,"type":15},"REST API","rest-api",{"name":8587,"slug":8588,"type":15},"2026-07-12T07:36:39.364409",{"slug":8618,"name":8618,"fn":8619,"description":8620,"org":8621,"tags":8622,"stars":23,"repoUrl":24,"updatedAt":8629},"inngest-api-cli","operate Inngest API resources via CLI","Use when operating Inngest API resources from the terminal with `npx inngest-cli@latest api`: Cloud\u002Flocal run debugging, event-run lookup, function traces, function invocation, app syncs, webhooks, environments, keys, account checks, and Insights queries. Provides prescriptive command routing for agents: which CLI command to run for a run ID, event ID, app ID, function ID, Cloud environment, API key, missing ID, or potentially mutating operation. Use `inngest-cli` for dev server setup\u002Fgeneral CLI workflows and `inngest-api` only when raw REST API v2 docs or OpenAPI fallback are needed.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8623,8624,8625,8628],{"name":8610,"slug":8611,"type":15},{"name":13,"slug":14,"type":15},{"name":8626,"slug":8627,"type":15},"CLI","cli",{"name":9,"slug":8,"type":15},"2026-07-12T07:36:47.58183",{"slug":8631,"name":8631,"fn":8632,"description":8633,"org":8634,"tags":8635,"stars":23,"repoUrl":24,"updatedAt":8644},"inngest-brownfield-audit","audit codebases for Inngest integration","Use when analyzing an existing TypeScript or JavaScript codebase to decide where and how to introduce Inngest. Covers repository discovery, framework and package detection, finding durability gaps in HTTP handlers, webhooks, cron jobs, queues, long-running jobs, AI agents, Agent Evals, polling loops, eval loops, and side-effect-heavy code, then producing and implementing an incremental integration plan.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8636,8637,8640,8643],{"name":13,"slug":14,"type":15},{"name":8638,"slug":8639,"type":15},"Code Analysis","code-analysis",{"name":8641,"slug":8642,"type":15},"Engineering","engineering",{"name":9,"slug":8,"type":15},"2026-07-12T07:36:55.811247",{"slug":8646,"name":8646,"fn":8647,"description":8648,"org":8649,"tags":8650,"stars":23,"repoUrl":24,"updatedAt":8659},"inngest-cli","configure Inngest CLI and dev server","Use when installing or running the Inngest CLI and Dev Server for local development, local testing, serve endpoint debugging, Docker or Docker Compose setup, MCP configuration, self-hosted `inngest start`, or deployment workflow checks. Covers `inngest dev`, `inngest start`, auto-discovery, config files, environment variables, `@inngest\u002Ftest`, local event sending, platform gotchas, and production\u002Fself-hosted server flags.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8651,8652,8655,8656],{"name":8626,"slug":8627,"type":15},{"name":8653,"slug":8654,"type":15},"Docker","docker",{"name":9,"slug":8,"type":15},{"name":8657,"slug":8658,"type":15},"Local Development","local-development","2026-07-12T07:36:40.694652",{"slug":8661,"name":8661,"fn":8662,"description":8663,"org":8664,"tags":8665,"stars":23,"repoUrl":24,"updatedAt":8672},"inngest-durable-functions","build durable and retry-safe functions","Use when building functions that must survive process crashes, retry automatically on failure, run on a schedule, react to events, or maintain state across infrastructure failures — e.g., webhook handlers that drop events, flaky cron jobs, background jobs that fail mid-execution, or workflows that need to resume where they left off. Covers Inngest function configuration, triggers (events, cron, invoke), step execution and memoization, idempotency, cancellation, error handling, retries, logging, and observability.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8666,8667,8670,8671],{"name":13,"slug":14,"type":15},{"name":8668,"slug":8669,"type":15},"Backend","backend",{"name":9,"slug":8,"type":15},{"name":8587,"slug":8588,"type":15},"2026-07-12T07:36:57.141023",{"slug":8674,"name":8674,"fn":8675,"description":8676,"org":8677,"tags":8678,"stars":23,"repoUrl":24,"updatedAt":8684},"inngest-events","design event-driven workflows","Use when designing event-driven workflows, decoupling services, implementing fan-out patterns (one trigger, many downstream handlers), implementing idempotent event handling with IDs (24-hour dedupe window), or handling at-least-once delivery from external sources like Stripe webhooks. Covers Inngest event schema, payload format, naming conventions, IDs for idempotency, the ts param, fan-out patterns, and system events like inngest\u002Ffunction.failed.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8679,8682,8683],{"name":8680,"slug":8681,"type":15},"Data Pipeline","data-pipeline",{"name":9,"slug":8,"type":15},{"name":8587,"slug":8588,"type":15},"2026-07-12T07:36:44.685364",{"slug":8686,"name":8686,"fn":8687,"description":8688,"org":8689,"tags":8690,"stars":23,"repoUrl":24,"updatedAt":8697},"inngest-flow-control","manage API rate limits and load","Use when handling external API rate limits (e.g., OpenAI 429s, HubSpot or Stripe rate limits), preventing duplicate work from rapid event bursts (debouncing user actions), spreading load over time, ensuring per-tenant fairness, processing events in batches, limiting concurrent runs of the same operation, or assigning priority to important runs. Covers Inngest flow control: concurrency limits with keys, throttling, rate limiting, debounce, priority, singleton, and event batching.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8691,8692,8693,8694],{"name":8610,"slug":8611,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":8695,"slug":8696,"type":15},"Performance","performance","2026-07-12T07:36:52.987451",{"slug":8699,"name":8699,"fn":8700,"description":8701,"org":8702,"tags":8703,"stars":23,"repoUrl":24,"updatedAt":8713},"inngest-middleware","add middleware to Inngest durable functions","Use when adding cross-cutting concerns to durable functions — structured logging or tracing across all functions, error tracking with Sentry, payload encryption for sensitive data, dependency injection of clients (DB, Stripe, etc.) into function handlers, custom telemetry, or behavior that should apply uniformly across many functions. Covers Inngest middleware lifecycle, creating custom middleware, dependencyInjectionMiddleware, @inngest\u002Fmiddleware-encryption, @inngest\u002Fmiddleware-sentry, and custom middleware patterns.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8704,8705,8706,8709,8710],{"name":8641,"slug":8642,"type":15},{"name":9,"slug":8,"type":15},{"name":8707,"slug":8708,"type":15},"Middleware","middleware",{"name":8584,"slug":8585,"type":15},{"name":8711,"slug":8712,"type":15},"Sentry","sentry","2026-07-12T07:36:50.127999",{"slug":4,"name":4,"fn":5,"description":6,"org":8715,"tags":8716,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8717,8718,8719,8720],{"name":13,"slug":14,"type":15},{"name":21,"slug":22,"type":15},{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},{"slug":221,"name":221,"fn":8722,"description":8723,"org":8724,"tags":8725,"stars":23,"repoUrl":24,"updatedAt":8731},"build durable TypeScript workflows","Use when adding durable execution to a TypeScript project — building retry-safe webhook handlers, background jobs that survive crashes, scheduled tasks, or long-running workflows that outlive a single request. Covers Inngest SDK installation, client config, environment variables, serve endpoints (Next.js, Express, Hono, Fastify), connect-as-worker mode, and the local dev server.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8726,8727,8728,8729],{"name":13,"slug":14,"type":15},{"name":8668,"slug":8669,"type":15},{"name":9,"slug":8,"type":15},{"name":8730,"slug":469,"type":15},"TypeScript","2026-07-12T07:36:42.004122",{"items":8733,"total":989},[8734,8742,8749,8755,8762,8769,8776],{"slug":8571,"name":8571,"fn":8572,"description":8573,"org":8735,"tags":8736,"stars":23,"repoUrl":24,"updatedAt":8589},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8737,8738,8739,8740,8741],{"name":8577,"slug":8578,"type":15},{"name":8580,"slug":8581,"type":15},{"name":9,"slug":8,"type":15},{"name":8584,"slug":8585,"type":15},{"name":8587,"slug":8588,"type":15},{"slug":8591,"name":8591,"fn":8592,"description":8593,"org":8743,"tags":8744,"stars":23,"repoUrl":24,"updatedAt":8602},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8745,8746,8747,8748],{"name":8577,"slug":8578,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":8600,"slug":8601,"type":15},{"slug":8604,"name":8604,"fn":8605,"description":8606,"org":8750,"tags":8751,"stars":23,"repoUrl":24,"updatedAt":8616},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8752,8753,8754],{"name":8610,"slug":8611,"type":15},{"name":8613,"slug":8614,"type":15},{"name":8587,"slug":8588,"type":15},{"slug":8618,"name":8618,"fn":8619,"description":8620,"org":8756,"tags":8757,"stars":23,"repoUrl":24,"updatedAt":8629},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8758,8759,8760,8761],{"name":8610,"slug":8611,"type":15},{"name":13,"slug":14,"type":15},{"name":8626,"slug":8627,"type":15},{"name":9,"slug":8,"type":15},{"slug":8631,"name":8631,"fn":8632,"description":8633,"org":8763,"tags":8764,"stars":23,"repoUrl":24,"updatedAt":8644},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8765,8766,8767,8768],{"name":13,"slug":14,"type":15},{"name":8638,"slug":8639,"type":15},{"name":8641,"slug":8642,"type":15},{"name":9,"slug":8,"type":15},{"slug":8646,"name":8646,"fn":8647,"description":8648,"org":8770,"tags":8771,"stars":23,"repoUrl":24,"updatedAt":8659},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8772,8773,8774,8775],{"name":8626,"slug":8627,"type":15},{"name":8653,"slug":8654,"type":15},{"name":9,"slug":8,"type":15},{"name":8657,"slug":8658,"type":15},{"slug":8661,"name":8661,"fn":8662,"description":8663,"org":8777,"tags":8778,"stars":23,"repoUrl":24,"updatedAt":8672},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[8779,8780,8781,8782],{"name":13,"slug":14,"type":15},{"name":8668,"slug":8669,"type":15},{"name":9,"slug":8,"type":15},{"name":8587,"slug":8588,"type":15}]