Plain HTML websites
- Copy the newest embed code from your Dashboard.
- Paste it before the closing
</body>tag. - Save and republish your site.
If your chatbot is not showing correctly, start here. This guide is beginner-friendly and step-by-step.
Take a breath, take one step at a time, and keep going with faith.
Type a word or phrase. Topics that contain it stay listed below, and each match is highlighted in soft gold so you can see it at a glance. Press Esc to clear.
Showing all 7 topics below.
First choose your website type so you do not accidentally install the widget twice.
Plain HTML websites
</body> tag.Next.js / React websites
If it still does not work, use the sections below.
Some sites use the chatbot embed directly in plain HTML. In Next.js and React, it is usually safer to place this logic in a dedicated client component and import it into your layout once.
Quick glossary: 'use client' means the file runs in the browser, useEffect([]) means run once when the component loads, and layout.tsx is the shared wrapper for your pages.
Create src/components/PrayerChatWidget.tsx (or your own name). Use this format:
'use client'
import { useEffect } from 'react'
export default function PrayerChatWidget() {
useEffect(() => {
const embedCode = 'your-embed-code'
const baseUrl = 'https://your-backend-domain.com'
const script = document.createElement('script')
script.src = baseUrl + '/js/chatbot-widget.js'
script.async = true
script.onerror = () => {
const el = document.getElementById('prayer-chat-chatbot-' + embedCode)
if (el) {
el.innerHTML =
'<p style="padding:12px;background:#fff3cd;border:1px solid #ffc107;border-radius:8px;font-family:sans-serif;font-size:14px;">Chat could not load. Check browser console (F12).</p>'
}
}
script.onload = () => {
if (typeof (window as any).PrayerChat !== 'undefined') {
;(window as any).PrayerChat.init({
embedCode,
apiUrl: baseUrl + '/api',
})
} else {
const el = document.getElementById('prayer-chat-chatbot-' + embedCode)
if (el) {
el.innerHTML =
'<p style="padding:12px;background:#f8d7da;border:1px solid #f5c6cb;border-radius:8px;font-family:sans-serif;font-size:14px;">Chat failed to start. Open console (F12) for details.</p>'
}
}
}
document.head.appendChild(script)
}, [])
return (
<div
id={'prayer-chat-chatbot-' + 'your-embed-code'}
data-embed-code="your-embed-code"
suppressHydrationWarning={true}
/>
)
}In Next.js, import the component in src/app/layout.tsx and render it once near the bottom of <body>, for example right before closing </body>.
baseUrl (HTTPS).If you are not comfortable coding this by hand, paste your plain embed script into your AI assistant and ask it to convert it into a Next.js/React client component.
Convert this Prayer Chat embed snippet into:
1) a Next.js client component file: src/components/PrayerChatWidget.tsx
2) the import + usage snippet for src/app/layout.tsx
Requirements:
- use useEffect([]) so init runs once
- load script from baseUrl + '/js/chatbot-widget.js'
- call PrayerChat.init({ embedCode, apiUrl: baseUrl + '/api' })
- include script onerror/onload fallback text
- keep the code beginner-friendly and fully copy/paste ready.Always double-check the generated code, especially your embedCode and backend URL.
Your old bot appears, but your new bot does not. This usually means your website is still using an old embed code or your app replaced the widget after load.
What to do
If the chatbot appears for a moment and then disappears, your app is likely re-rendering and removing the widget DOM.
What to do
Your website's global CSS (common on Tailwind/Vercel themes) can inherit light text into the embed. The widget script now forces readable colors automatically.
What to do
Common reasons: script in wrong place, stale cache, browser extension blocking scripts, HTTPS mismatch, or a strict security policy.
What to do
If the embed is added in multiple places, or initialized repeatedly, you may get duplicate widgets or odd behavior.
What to do
Mobile browsers can cache aggressively, and overlays can hide floating UI.
What to do
If you only have a plain HTML embed snippet, convert it into a client component and mount that component once in your app layout.
What to do
</body>.If you followed this guide and still have issues, send us:
We will do our best to help quickly and kindly.
Never put your embedCode or apiUrl directly in source code files.
NEXT_PUBLIC_PRAYER_EMBED_CODE=your-embed-code-hereNEXT_PUBLIC_CHAT_BASE_URL=https://chatbot-java-spring-ai.onrender.com.env.local (for local development) and in your hosting platform settings (for live site).This keeps your secrets out of GitHub and safe.