Drop in one script tag. WebChat.js reads your entire site, understands context, and gives visitors instant AI-powered answers — no backend, zero dependencies, no fuss.
Production-ready from day one. WebChat.js handles the hard parts so you can focus on your site.
Guarantees 100/100 Core Web Vitals. The full UI and site scraping are deferred until the user interacts, ensuring your page load speed is never compromised.
Core Web Vitals SafeOn demand, WebChat silently reads your current page and all linked internal pages — building a rich knowledge base in seconds.
Up to 10 pagesWhen all API providers fail, a local NLP engine answers from scraped content. Your bot never goes dark, regardless of API status.
Always availableDetects frustrated, urgent, or happy users and adjusts tone automatically. Empathy built directly into the logic.
Realtime NLPContext-aware quick-reply chips generated from your actual site content — nav items, section headings, and FAQs.
Auto-generatedColors, fonts, position, bot name, avatar. Dark/light/auto theme. Glassmorphism UI with smooth spring animations.
40+ optionsFull-screen takeover on mobile with smooth slide-up animation. Touch-optimized, accessible, and fully responsive.
100% responsiveContextual engagement popups built from your scraped content. Stops automatically when the chat window is opened.
Content-awareIn-chat search, conversation export as JSON, reaction buttons (👍/👎), copy-to-clipboard, and read receipts.
Power user featuresWebChat tries each provider in order and falls back automatically. You only need one free API key to get started.
Sentiment detected
If key present
On DS failure
On Groq failure
Always responds
Two ways to add WebChat.js to any website. Pick the one that fits your workflow. Lazy loading is enabled by default.
<!-- Add before </body> on any page --> <script src="https://webchat-js.pages.dev/webchat.min.js" data-webchat data-deepseek-key="sk-YOUR_DEEPSEEK_KEY" data-groq-key="gsk_YOUR_GROQ_KEY" data-glm-key="YOUR_GLM_KEY" data-bot-name="My Assistant" data-primary-color="#7c3aed" data-accent-color="#00e5cc" data-position="bottom-right" data-theme="auto" data-lazy-load="true" data-lazy-scrape="true" data-enable-popup="true"></script>
<script src="https://webchat-js.pages.dev/webchat.min.js"></script> <script> const chat = new WebChat({ deepseekApiKey: 'sk-xxx', groqApiKey: 'gsk_xxx', glmApiKey: 'xxx', botName: 'Maya', primaryColor: '#7c3aed', accentColor: '#00e5cc', position: 'bottom-right', theme: 'auto', lazyLoad: true, lazyScrape: true, enablePopup: true, showBranding: true, }); </script>
<script> // Split keys for basic obfuscation (optional) const deepseekKey = ["sk-XXX.....", "............"].join(""); const groqKey = ["gsk_XXX.....", "............"].join(""); // Inject script dynamically with lazy load enabled const s = document.createElement("script"); s.src = "https://webchat-js.pages.dev/webchat.min.js"; s.setAttribute("data-webchat", ""); s.setAttribute("data-deepseek-key", deepseekKey); s.setAttribute("data-groq-key", groqKey); s.setAttribute("data-bot-name", "Maya"); s.setAttribute("data-lazy-load", "true"); s.setAttribute("data-enable-popup", "true"); document.body.appendChild(s); </script>
| Attribute | Type | Default | Description |
|---|---|---|---|
| data-deepseek-key | string | '' | DeepSeek API key (priority 1) |
| data-groq-key | string | '' | Groq API key (priority 2, free tier) |
| data-glm-key | string | '' | GLM-4 API key (priority 3, free tier) |
| data-bot-name | string | 'Site Assistant' | Chatbot display name in header |
| data-primary-color | color | '#7c3aed' | Main brand color (hex) |
| data-accent-color | color | '#00e5cc' | Gradient accent color (hex) |
| data-position | string | 'bottom-right' | bottom-right | bottom-left | bottom-center |
| data-theme | string | 'auto' | auto | light | dark |
| data-lazy-load | boolean | true | Defer UI init until interaction |
| data-lazy-scrape | boolean | true | Defer site scraping until chat opens |
| data-init-delay | number | 2000 | Lazy init fallback timeout (ms) |
| data-scrape-delay | number | 500 | Delay before scraping on open (ms) |
| data-enable-popup | boolean | true | Show contextual engagement popups |
| data-popup-interval | number | 3000 | Milliseconds between popups |
| data-max-popups | number | 5 | Max popups per session |
| data-bot-avatar | url | null | Custom avatar image URL |
Script loads with zero performance impact. Only the toggle button renders initially. The full UI and scraping are deferred until the user interacts or a short timeout passes.
When triggered, extracts headings, section text, FAQs, contact info, navigation links, and structured lists. Builds a ~12,000-character knowledge context.
Message arrives → Sentiment detection (positive/negative/urgent/neutral) → Rate limit check → Context preparation with last N messages.
Tries DeepSeek → Groq → GLM-4 in priority order. Each provider gets 2 retry strikes before being skipped. Smart Local Fallback always catches the ball.
Typewriter animation renders the response. Suggestions refresh based on context. Read receipts, reactions, and copy button appear on hover.
Whether you're a solo developer or a growing business — WebChat.js adapts to your content and your audience.
Let visitors ask about your skills, projects, and availability without reading every section.
Instantly answer pricing questions, feature comparisons, and integration queries from prospects.
Help developers find the right API endpoint, config option, or tutorial in seconds.
Answer shipping, return policy, and product specification questions to reduce support tickets.
Guide readers to related articles, summarize long posts, and surface evergreen content.
Qualify leads, answer service questions, and capture contact info — all automated, 24/7.
Everything you need to know about WebChat.js. Can't find an answer? Open an issue on GitHub.
new WebChat({...})) for lifecycle control, or the simple script tag approach for drop-in installation.
Access the WebChat instance anywhere to trigger actions, inspect state, or integrate with your app.
// Open chat when user clicks a custom button document.getElementById('my-help-btn').addEventListener('click', () => { window._webChat.open(); }); // Pre-fill a message based on page context if (location.pathname === '/pricing') { setTimeout(() => window._webChat.send('Tell me about pricing'), 2000); } // Export conversation on page leave window.addEventListener('beforeunload', () => { const history = window._webChat.getHistory(); console.log('Session ended:', history.length, 'messages'); });
Get started in under 60 seconds. No signup. No backend. Just intelligence.