peppermint-chatbot-sdk
v0.2.4
Published
Embeddable chatbot widget for React, Vue, Svelte, and vanilla JS
Maintainers
Readme
peppermint-chatbot-sdk
Embeddable chatbot widget for React, Vue, Svelte, and vanilla JS. Built with TypeScript and styled-components (React).
Published on npm.
Install
yarn add peppermint-chatbot-sdk
# peer deps for React
yarn add react react-dom styled-componentsReact
import { PeppermintChatbot } from "peppermint-chatbot-sdk/react";
<PeppermintChatbot
layout="page"
greetingMessage="Hi! How can I help?"
chatbotName="Assistant"
onSendMessage={(text) => console.log(text)}
/>;Vanilla JS / Vue / Svelte
import { createChatbot } from "peppermint-chatbot-sdk/vanilla";
const { unmount } = createChatbot(document.getElementById("chat"), {
layout: "widget",
greetingMessage: "Hello!",
});
// later: unmount();Requires react and react-dom on the page (the widget mounts the React component).
Props
layout:"widget"|"page"greetingMessage,chatbotName,chatbotProfileImage,userProfileImagebackgroundColor,fontColor,chatbotBubbleColor,userBubbleColorinitialMessages,onSendMessage,className
Development
yarn install
yarn buildLicense
MIT
