On this page

Which ModelRiver package should I install?

Updated

It depends on what you're building. Install @modelriver/client to show AI answers live in your frontend, and @modelriver/cli to test webhooks and async requests on your own machine. Neither is needed for plain server-side calls; any HTTP client or the OpenAI SDK works for those.

What does @modelriver/client do?#

It's a small (about 15 KB) browser library that connects to an async request and streams the answer into your UI. It handles reconnects and picks the request back up after a page refresh, and ships with TypeScript types.

npm install @modelriver/client

It has a useModelRiver hook for React, plus helpers for Vue, Angular and Svelte, and works in plain JavaScript too. There's also a CDN build for pages without a bundler:

<script src="https://cdn.modelriver.com/client/latest/modelriver.min.js"></script>

What does @modelriver/cli do?#

It's a command-line tool for local development: receive webhooks on localhost without a public URL, send test async requests, check WebSocket connections and complete backend pipeline callbacks.

npm install -g @modelriver/cli

Or run it without installing: npx @modelriver/cli listen --print. See How do I test webhooks locally?

Do I need either for a simple chatbot?#

Not necessarily. If your server calls ModelRiver and returns the answer, you need neither. Add the client SDK when you want answers to stream into the browser directly.

Are they free?#

Yes. Both are free to install and use. Requests they make count toward your plan like any other request; test requests don't.

Learn more#

Was this article helpful?