A react widget like the intercom chat, but driven by your chat lines, and easy to connect to your own backend.
import{FloatingWidget,ChatFn}from'botz';import'botz/styles.css';constchat: ChatFn=async(bot)=>{awaitbot.say(`Hi! Please enter your email to subscribe.`);constemail=awaitbot.ask(`What's your email?`,{validate: async(value)=>{if(/^.+@.+\.+.+$/.test(value))returntrue;awaitbot.say('Sorry, this does not look like a proper email address. Wanna try again?');returnfalse;},});awaitfetch('https://example.com/signup',{method: 'POST',body: email});awaitbot.say(`Sweet! You're signed up!`);};constApp=()=>{return(<div><FloatingWidgetchat={chat}/></div>);};