Documentation/Widget Integration/Embed Code
Widget Embed Code
How to add the Sensei AI chat widget to a client's website.
Basic Embed Code
Add this script tag to the client's website
<script
src="https://sensei-ai-eight.vercel.app/widget.js"
data-client-id="YOUR_CLIENT_ID_HERE"
defer>
</script>Replace YOUR_CLIENT_ID_HERE with the actual client UUID.
Where to Place the Code
Add the script tag just before the closing </body> tag:
<!DOCTYPE html>
<html>
<head>
<title>Client Website</title>
</head>
<body>
<!-- Website content here -->
<!-- Sensei AI Widget - Add before closing body tag -->
<script
src="https://sensei-ai-eight.vercel.app/widget.js"
data-client-id="d454991a-eddb-4e81-959d-87c868e050ca"
defer>
</script>
</body>
</html>Platform-Specific Instructions
WordPress
Option 1: Use a plugin like "Insert Headers and Footers"
Option 2: Add to theme's footer.php before </body>
Option 3: Use Appearance → Theme Editor → footer.php
Shopify
1. Go to Online Store → Themes
2. Click Actions → Edit code
3. Find theme.liquid
4. Add script before </body>
Squarespace
1. Go to Settings → Advanced
2. Click Code Injection
3. Paste in the Footer section
Wix
1. Go to Settings → Custom Code
2. Click + Add Custom Code
3. Paste code and select "Body - end"
Webflow
1. Go to Project Settings
2. Click Custom Code tab
3. Paste in Footer Code section
React / Next.js
Use next/script component:
<Script
src="https://sensei-ai-eight.vercel.app/widget.js"
data-client-id="..."
strategy="lazyOnload"
/>Verifying Installation
- 1Visit the client's website
- 2Look for the chat button in the bottom-right corner
- 3Click to open and test sending a message
- 4Check Admin → Sessions to see the conversation
Important: Make sure the client has knowledge base content before deploying the widget. An empty knowledge base will result in unhelpful responses.