How to use streamObject in a NextJS API route? #1962
-
I was following the documentation example here: https://sdk.vercel.ai/examples/next-app/basics/streaming-object-generation and set up similar code within a NextJS API Route like so,
But how should I consume this stream from the client? Trying to use I don't see an equivalent documentation page under NextJS pages router, so is streaming objects from an API route just not supported yet? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
There is no hook / data transport for |
Beta Was this translation helpful? Give feedback.
-
We have a |
Beta Was this translation helpful? Give feedback.
-
@DavidMelnychuk Hey, please can you send the full code, I am trying this but stuck with the errors. |
Beta Was this translation helpful? Give feedback.
We have a
useObject
hook now: https://sdk.vercel.ai/docs/reference/ai-sdk-ui/use-object