{"repo":"XD2Sketch/react-chat-stream","free":true,"listed":false,"github":"https://github.com/XD2Sketch/react-chat-stream","clone":"git clone https://github.com/XD2Sketch/react-chat-stream.git","description":"⚛️ React Hook to add 🤖 ChatGPT-like word-by-word event streams","language":"TypeScript","stars":74,"topics":["chatgpt","event","event-stream","nextjs","react"],"license":"MIT","category":"chat-messaging","readme_excerpt":"@magicul/react-chat-stream Introducing @magicul/react-chat-stream: A React hook designed to simplify integrating chat streams returned by your backend. Let messages appear word-by-word similar to ChatGPT. What's this package about? Are you building a ChatGPT-like chat interface? Then most likely you'll want to integrate a chat that has the messages appear word-by-word, similar to ChatGPT. Vercel recently released the Vercel AI SDK which adds Streaming First UI Helper , but what if you want to integrate your own backend? This package solves exactly that pain point. We've abstracted the logic into a React Hook to take care of handling everything for you. How does it work? If you're backend returns text/event-stream then you can use this package. This package does not \"fake\" this response by imitating the word-by-word appearance. It will literally take the responses from your backend as them come in through the stream. The hook provides a messages object which will change so you can display it as the result gets delivered. Installation Install this package with npm Or with yarn Stream chat-like messages from your backend to your React app (similar to ChatGPT). With the useChatStream hook, you can easily integrate your own API to stream chat responses ( text/event-stream ). Responses from your backend will appear word-by-word to give it a ChatGPT-like user experience. The following example demonstrates how to use the hook to integrate your own API that streams the results. Please","default_branch":null,"files":null,"tree":[],"storefront":"/r/XD2Sketch","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/XD2Sketch/react-chat-stream/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}