File: read-streamable-value.md | Updated: 11/15/2025
Menu
v5 (Latest)
AI SDK 5.x
Model Context Protocol (MCP) Tools
Copy markdown
================================================================================================================
AI SDK RSC is currently experimental. We recommend using AI SDK UI for production. For guidance on migrating from RSC to UI, see our migration guide .
It is a function that helps you read the streamable value from the client that was originally created using createStreamableValue
on the server.
import { readStreamableValue } from "@ai-sdk/rsc"
app/actions.ts
async function generate() { 'use server'; const streamable = createStreamableValue();
streamable.update(1); streamable.update(2); streamable.done(3);
return streamable.value;}
app/page.tsx
import { readStreamableValue } from '@ai-sdk/rsc';
export default function Page() { const [generation, setGeneration] = useState('');
return ( <div> <button onClick={async () => { const stream = await generate();
for await (const delta of readStreamableValue(stream)) { setGeneration(generation => generation + delta); } }} > Generate </button> </div> );}
StreamableValue
The streamable value to read from.
It returns an async iterator that contains the values emitted by the streamable value.
On this page
Deploy and Scale AI Apps with Vercel.
Vercel delivers the infrastructure and developer experience you need to ship reliable AI-powered applications at scale.
Trusted by industry leaders: