GithubHelp home page GithubHelp logo

bavard-ai / bavard-react Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 4.96 MB

React components for working with Bavard chatbots

JavaScript 7.18% HTML 3.16% TypeScript 89.66%
chatbot chatbots nlp conversational-ai customer-support customer-service customer-service-chatbot nlp-machine-learning machine-learning conversational-bots

bavard-react's Introduction

Bavard Logo

CircleCI License: MIT

Bavard React Components

A small set of React components for easily including Bavard chatbots within any React app.

Setup

1. Install the npm package.

npm i @bavard/bavard-react

2. Import and use the Bavard React components in your app. For example:

import React from "react";
import { ChatbotWindowPopup } from "@bavard/bavard-react/ChatbotWindowPopup";
import { ChatbotWindowEmbed } from "@bavard/bavard-react/ChatbotWindowEmbed";

function App() {
  return (
    <div style={{ display: "flex", justifyContent: "center" }}>
      <ChatbotWindowPopup agentId="b4d9de5e-2325-4244-98c4-1526643dd0da" />
      <ChatbotWindowEmbed
        agentId="b4d9de5e-2325-4244-98c4-1526643dd0da"
        widgetId={1}
        style={{ height: 600, width: 400 }}
      />
    </div>
  );
}

export default App;

Popup Window

Add a popup chatbot window to your app like this. It's only possible to render a single instance of the popup window at a time.

<ChatbotWindowPopup agentId="b4d9de5e-2325-4244-98c4-1526643dd0da" />

This will cause a popup-style chatbot to appear in the window's lower right corner.

Bavard Popup

Embed Window

Add an embeddable chatbot window to your app as in the code below. You can add as many instances as you like, but each one must have a distinct widgetId number which should be a positive integer. The embed window is rendered inside a div. The dimensions are completely up to you, but we recommend at least 375px in width.

<ChatbotWindowEmbed
  agentId="b4d9de5e-2325-4244-98c4-1526643dd0da"
  widgetId={1}
  style={{ height: 600, width: 400 }}
/>

Here's what an embed chatbot window looks like.

Bavard Embed

bavard-react's People

Contributors

david-wb avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

eyosias6981

bavard-react's Issues

Is this repo active?

Hi, I came across this repo based on search. seems like what I need, however, there is no detailed information about the usage, How to get the key etc...
Please is this an active project.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.