You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

botz

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

botz

A react widget like the intercom chat, but driven by your chat lines, and easy to connect to your own backend.


Version published
Weekly downloads
166
decreased by-65.05%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Botz

A react widget like the intercom chat, but driven by your chat lines, and easy to connect to your own backend.

Usage

import { FloatingWidget, ChatFn } from 'botz';
import 'botz/styles.css';

const chat: ChatFn = async (bot) => {
  await bot.say(`Hi! Please enter your email to subscribe.`);

  const email = await bot.ask(`What's your email?`, {
    validate: async (value) => {
      if (/^.+@.+\.+.+$/.test(value)) return true;
      await bot.say(
        'Sorry, this does not look like a proper email address. Wanna try again?'
      );
      return false;
    },
  });

  await fetch('https://example.com/signup', { method: 'POST', body: email });
  await bot.say(`Sweet! You're signed up!`);
};

const App = () => {
  return (
    <div>
      <FloatingWidget chat={chat} />
    </div>
  );
};

FAQs

Package last updated on 21 Dec 2022

Did you know?

Socket

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc