chatbox-nps-chat-widget
v0.1.0
Published
Plain HTML/CSS/JS embed for the AI chat UI. This package injects a floating button and popup iframe that loads your chat app.
Readme
Chat Widget (npm)
Plain HTML/CSS/JS embed for the AI chat UI. This package injects a floating button and popup iframe that loads your chat app.
Install
npm install chatbox-nps-chat-widgetPlain HTML usage
<link
rel="stylesheet"
href="/node_modules/chatbox-nps-chat-widget/dist/chat-widget.css"
/>
<script src="/node_modules/chatbox-nps-chat-widget/dist/chat-widget.iife.js"></script>
<script>
NpssChatWidget.initChatWidget({
iframeUrl: "https://app.yourdomain.com/embed?ai=1"
});
</script>ESM usage
import { initChatWidget } from "chatbox-nps-chat-widget";
import "chatbox-nps-chat-widget/dist/chat-widget.css";
initChatWidget({
iframeUrl: "https://app.yourdomain.com/embed?ai=1",
});Options
iframeUrl(required)position("bottom-right" | "bottom-left" | "top-right" | "top-left")primaryColorbuttonTextbuttonLabelbuttonSizepopupWidthpopupHeightoffsetpopupOffsetzIndextitlepreloadinjectStyles(default true; set false if you always load CSS manually)
Build
npm run build