@anthive/webchat
v0.1.1
Published
Anthive webchat widget — embeddable chat powered by anthive workers
Readme
@anthive/webchat
Embeddable chat widget powered by anthive AI agents. Drop it into a React app as a component, or embed it in any website with a single <script> tag — no React required.
Getting a channel ID
Before using the widget you need a channel_id. This identifies which of your anthive agents answers the chat — it's a public identifier, safe to expose in client-side code (same as a Stripe publishable key or an Intercom app ID).
To create one:
- Log in to anthive.work.
- Go to Canales de Comunicación.
- Click Agregar canal and select Web Chat.
- Copy the
channel_idshown for the new channel.
Option 1: Script tag (any website)
No build step, no framework required.
<script src="https://anthive.work/widget/widget.js" data-channel-id="YOUR_CHANNEL_ID" defer></script>Paste this before the closing </body> tag. The widget mounts itself as a floating chat bubble in the bottom-right corner.
Option 2: React component
npm install @anthive/webchatimport { AnthiveWebchat } from '@anthive/webchat';
function App() {
return <AnthiveWebchat channelId="YOUR_CHANNEL_ID" />;
}React and React DOM (>=18) are peer dependencies — bring your own, they aren't bundled with this build.
Props
| Prop | Type | Required | Description |
| ----------- | -------- | -------- | ----------------------------------------------- |
| channelId | string | Yes | The channel_id of your Web Chat channel. |
If channelId is omitted or empty, the widget renders nothing.
License
MIT
