createStreamableValue

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.

Create a stream that sends values from the server to the client. The value can be any serializable data.

Import

import { createStreamableValue } from "@ai-sdk/rsc"

API Signature

Parameters

value:

any

Returns

value:

StreamableValue

Methods

update:

(value: T) => StreamableValueWrapper

append:

(value: T) => StreamableValueWrapper

done:

(value?: T) => StreamableValueWrapper

error:

(error: any) => StreamableValueWrapper