Quick start
Add your chatbot to your website in under 60 seconds:Installation
The simplest way to add your chatbot:Replace
YOUR_CHATBOT_ID with your actual chatbot ID from the Installation page.Configuration via URL parameters
You can customize the chatbot behavior by adding URL parameters to the widget script:hideBubble=true- Hide the default chat bubbleopen=true- Open the chat widget automaticallymobile=false- Hide the chat widget on mobile devicesdelay=2000- Delay widget initialization (in milliseconds)
SDK methods reference
Control your chatbot programmatically using the$sitegpt JavaScript SDK. All commands use the push method: window.$sitegpt.push([command, ...args])
For a complete interactive reference with copy-paste examples, visit the SDK Methods page in your chatbot dashboard under Installation.
Control widget visibility
Open the chat widget
Programmatically opens the chat widget window.Close the chat widget
Programmatically closes the chat widget window.Toggle the chat widget
Opens the chat widget if it’s closed, and closes it if it’s open.Open with fresh conversation
Opens the chat widget and resets the conversation in a single flicker-free step. If there is an existing conversation, it will be cleared and a new one will be started.Send messages programmatically
Send a message immediately
Sends a message to the chatbot immediately. The chat widget will open automatically if it’s closed.Prefill the message input
Prefills the message input field with text. Users can edit the message before sending. The input field will be focused automatically.Manage conversations
Reset the current conversation
Resets the current conversation thread and returns to the widget home page. This clears the conversation history and allows the user to start over.This command is useful when you want to give users a clean slate, such as after completing a transaction, switching topics, or when they explicitly request to start over. The user will be returned to the widget home page where they can see their conversation history.
Enhance chatbot context
Give extra context
Provide additional information to your SiteGPT bot for more relevant and contextual conversations, such as the current page the user is on.Manage user sessions
Automatically log the user in
Automatically log users into the chatbot without requiring email verification. This requires generating a secure signature on your backend.Generating signatures (Node.js backend example)
- Use HMAC-SHA256 algorithm only
- Generate signatures on your backend server
- Never expose your API key in frontend code
- Each signature is unique to the email and your API key
Security of user verification
User verification uses theHMAC-SHA256 signature algorithm, a standard and secure method for authenticating data.
When setting a user email via the $sitegpt object, you must provide the signature computed on your backend. This signature uses your secret API key, known only to you and SiteGPT. Because only you and SiteGPT can generate valid signatures for a given email, an attacker without your API key cannot impersonate users.
Customize widget appearance
Add custom CSS
Apply your own CSS to the chatbot widget and style it according to your branding.Common use cases
Custom chat trigger
Hide the default bubble and use your own button:Context-aware chatbot
Provide page-specific context:Pre-filled messages
Suggest messages based on user actions:Authenticated users
Auto-login authenticated users by fetching signature from your backend:Styling
Custom CSS
Apply custom styles to the chat widget:Available CSS variables
The widget supports these CSS variables:--chat-color- Primary brand color (used for bubble, buttons, etc.)--chat-text-color- Text color for elements using the brand color--chat-font-size- Base font size for the chat interface
The widget uses Tailwind CSS internally. You can target specific elements with custom CSS, but the available CSS variables are limited to those listed above.
Best practices
Load asynchronously
The recommended installation method already loads the SDK asynchronously to avoid blocking page rendering:Handle loading state
Check if the SDK is loaded before calling methods:Provide context
Give your chatbot context about the current page:Test thoroughly
Test your integration across:- Different browsers (Chrome, Firefox, Safari, Edge)
- Mobile devices (iOS, Android)
- Different screen sizes
- With ad blockers enabled
Troubleshooting
Chatbot not appearing
Chatbot not appearing
If your chatbot doesn’t appear, try these solutions:
Ensure the script is added before
</body> and the chatbot ID is correct.Check browser consoleLook for JavaScript errors that might prevent loading.Verify chatbot is published
Ensure your chatbot is published in the dashboard.Test in incognito mode
Rule out browser extensions or cached files.
Methods not working
Methods not working
If SDK methods aren’t working, verify these items:
Ensure the SDK is fully loaded before calling methods.Check syntax
Verify you’re using the correct method syntax.Review console errors
Check for JavaScript errors in the browser console.
Styling issues
Styling issues
If custom styles aren’t applying, try these fixes:
Your styles may need
!important to override defaults.Verify CSS syntaxEnsure your CSS is valid.Clear cache
Clear browser cache and reload the page.
Next steps
Installation guide
Detailed installation instructions
Tracking events
Track chatbot activity in GTM, GA4, or custom analytics
Webhooks
Set up webhooks for real-time events
Appearance
Customize chatbot appearance
API reference
Explore the REST API