cdl-ruby-chat
v0.0.57
Published
UI for Ruby Chat Bot
Downloads
84
Readme
CDL ruby chat
Description
Chat component for the Ruby chatbot.
Usage
First, you need to install the @tanstack/react-query
package:
npm install @tanstack/react-query
Then, wrap your app with the QueryClientProvider
and pass it a QueryClient
instance:
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
const queryClient = new QueryClient();
export default function App() {
return (
<QueryClientProvider client={queryClient}>
<YourApp />
</QueryClientProvider>
);
}
Finally, you can use the component anywhere in your app:
import Chat from "cdl-ruby-chat";
export default function YourApp() {
return <Chat />;
}
Props
user
: Currently logged in user. If the user is not logged in, you will only be able to send 5 messages per day.loginUser
: A function that receives data that has theuser
object as well as theaccessToken
and sets them insidelocalStorage
.