The async iterator
The TypeScript SDK exposes streaming as client.messages.stream(...) returning an async iterator of typed events plus a finalMessage() promise. Iterate with for await; await finalMessage for usage. Same shape as Python, just typed.
Next.js Route Handlers and ReadableStream
Next.js App Router Route Handlers can return a Response with a ReadableStream body. Pipe the SDK's text stream into the Response stream and the browser sees tokens as they arrive. cwk-site uses this pattern; the same shape works on Vercel Edge.
Backpressure and cancellation
If the client disconnects mid-stream, you want to stop generating to save tokens. Wire the request's AbortSignal to the SDK call so server-side generation halts when the browser tab closes. The SDK accepts signal in every method.