@ai-sdk/rsc
v3.0.177
Published
Readme
AI SDK - React Server Components integration
React Server Components for the AI SDK:
Setup
npm i @ai-sdk/rscUsage
'use server';
import { createStreamableUI } from '@ai-sdk/rsc';
export async function getWeather() {
const weatherUI = createStreamableUI();
weatherUI.update(<div style={{ color: 'gray' }}>Loading...</div>);
setTimeout(() => {
weatherUI.done(<div>It's a sunny day!</div>);
}, 1000);
return weatherUI.value;
}See the React Server Components documentation for more information.
