Socket
Socket
Sign inDemoInstall

botui

Package Overview
Dependencies
0
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    botui

A JS library for building your bot and its UI


Version published
Weekly downloads
5.2K
increased by1.39%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

logo

npm npm Twitter Follow

A JavaScript framework for creating conversational UIs.

Main Site - Read Docs - Examples

🚨 Note

This version is using a completely different approach for building UIs. Do no use it as a drop-in replacement for the previous version.

Example usage in React

import { useEffect } from 'react'
import { createRoot } from 'react-dom/client'

import { createBot } from 'botui'
import { BotUI, BotUIMessageList, BotUIAction, useBotUI } from '@botui/react'

const myBot = createBot()
<div id="botui-app"></div>
const App = () => {

  useEffect(() => {
    myBot.message.add({
      text: 'hey'
    })
      .then(() => myBot.wait({ waitTime: 1000 }))
      .then(() => myBot.message.add({ text: 'what is your name?' }))
      .then(() =>
        myBot.action.set(
          {
            options: [
              { label: 'John', value: 'john' },
              { label: 'Jane', value: 'jane' },
            ],
          },
          { input: 'select' }
        )
      )
      .then((data) =>
        myBot.message.add({ text: `nice to meet you ${data.text}` })
      )
  }, [])

  return <div>
    <BotUI bot={myBot}>
      <BotUIMessageList />
      <BotUIAction />
    </BotUI>
  </div>
}

const containerElement = document.getElementById('botui-app')
const root = createRoot(containerElement)
root.render(<App />)

License

MIT License - Copyrights (c) 2017-22 - Moin Uddin

Keywords

FAQs

Last updated on 25 Sep 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc