@techmindsolutions/chatbot-iframe
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

@techmindsolutions/chatbot-iframe

A React component package for embedding a floating chatbot iframe in your application.

Installation

To install this private package in your projects:

  1. Make sure you are logged in to npm with an account that has access(talk to publisher for access):
npm login
  1. Install the package:
npm install @techmindsolutions/chatbot-iframe

Usage

import { FloatingChatbot } from '@techmindsolutions/chatbot-iframe';
import '@techmindsolutions/chatbot-iframe/style.css';

function App() {
  const handleFormSubmission = (payload: any) => {
    console.log('Form submission from chatbot:', payload);
  };

  return (
    <FloatingChatbot
      chatbotUrl="http://localhost:3000"
      onFormSubmit={handleFormSubmission}
    />
  );
}

Props

Prop Type Required Description
chatbotUrl string Yes The URL where your chatbot iframe is hosted
buttonStyles React.CSSProperties No Custom styles for the chat toggle button
containerStyles React.CSSProperties No Custom styles for the chatbot container
onFormSubmit (payload: any) => void No Callback function that gets called when the chatbot submits a form

Advanced Usage

You can also access the chatbot store directly for more control:

import { useChatbotStore } from '@formbay/chatbot-iframe';

function App() {
  const { setIsOpen, sendDataToChatbot } = useChatbotStore();

  const sendDataToChatBot = () => {
    sendDataToChatbot({
      someKey: 'Custom data to send to chatbot'
    });
  };

  return (
    // Your component code
  );
}

Readme

Keywords

none

Package Sidebar

Install

npm i @techmindsolutions/chatbot-iframe

Weekly Downloads

1

Version

1.0.8

License

none

Unpacked Size

4.68 kB

Total Files

5

Last publish

Collaborators

  • samaghapour_techmindsolutions
  • samaghapour