Installation
Mevichat provides multiple integration options depending on your stack.
JS snippet (any site)
The easiest option — copy-paste the snippet:
<script async src="https://app.mevichat.com/widget.js"
data-bot-key="bot_pub_xxx"
data-allowed-domains="example.com"></script>
Paste before </body>. Widget auto-initializes.
React integration
For Next.js / React sites:
import Script from 'next/script';
export function MevichatWidget() {
return (
<Script
async
src="https://app.mevichat.com/widget.js"
data-bot-key={process.env.NEXT_PUBLIC_MEVICHAT_KEY}
data-allowed-domains="example.com"
/>
);
}
Content Security Policy
If your site has a CSP, allow:
script-src 'self' https://app.mevichat.com;
connect-src 'self' https://api.mevichat.com;
frame-src 'self' https://app.mevichat.com;
Custom domain (Scale plan)
Contact sales for white-label setup: widget loads from chat.yourbrand.com instead of app.mevichat.com.
Troubleshooting
- Widget not appearing: check browser console for CSP or CORS errors
- "Invalid API key": verify
data-bot-keymatches your bot's public key - "Domain not allowed": add your domain to
allowed_domainsin bot settings