mycheekybot
v0.0.8
Published
A reusable chatbot component for React/Next.js applications.
Downloads
8
Maintainers
Readme
My Cheeky Bot Chatbot Widget
A reusable chatbot component for React/Next.js applications.
Installation
Install the package using npm or yarn:
npm install mycheekybot
# or
yarn add mycheekybot
Usage
Import and use the ChatbotWidget
component in your application:
import React from "react";
import { ChatbotWidget } from "mycheekybot";
const MyApp = () => {
return (
<div>
<h1>My Application</h1>
<div style={{ height: "75vh" }}>
<ChatbotWidget botId="12345" />
</div>
</div>
);
};
export default MyApp;
Props
The ChatbotWidget
component accepts the following props:
botId
(string): The ID of the bot to be used.
Example with Next.js
Here’s an example of how you can use the ChatbotWidget
component in a Next.JS 13+ app. The widget is compatible in both server and client components:
// app/index.js or app/index.tsx
import React from "react";
import { ChatbotWidget } from "mycheekybot";
const HomePage = () => {
return (
<div>
<h1>Welcome to My Next.js App</h1>
<div style={{ height: "75vh" }}>
<ChatbotWidget botId="12345" />
</div>
</div>
);
};
export default HomePage;
License
This project is licensed under the MIT License - see the LICENSE.md file for details.