Minichat (website chat)
Add a floating chat button to your website so visitors can talk to your avatar.
The Minichat is a chat widget for your website. A floating button appears in the corner of the page; the visitor clicks it and talks to the avatar without leaving your site. Conversations appear in Conversations, and messages your team sends from the platform reach the visitor in real time.
Before you start
- Your avatar's slug: the name in the avatar link, as in
https://tolky.to/your-slug. It is in Settings › General. - Access to the HTML of your website, or to someone who can edit it.
- Your site's domain authorized by Tolky. The widget only loads on authorized domains.
Install
Ask for domain authorization
https://www.example.com.Paste the code
</body> tag of your pages. Keep the configuration block before the script.Set your slug
your-slug with your avatar's slug.Publish
<script>
window.tolky = window.tolky || {
config: {
slug: "your-slug",
},
};
</script>
<script type="module" src="https://minichat.tolky.to/main.js" async></script>You do not need a stylesheet <link>: the widget loads its own styles.
Change the appearance
Go to Settings › Minichat and click Save after your changes. They apply to every page that has the widget.
| Setting | Options |
|---|---|
| Configuration mode | Default configuration: the button shows the default image with the call-to-action text. Custom configuration: the button shows only your image. |
| Button image | Custom mode only. Square, between 256 and 1024 pixels per side, PNG, JPG or WebP. |
| Theme | Automatic (follows the visitor's system), Light or Dark. |
| Button size on desktop / Button size on mobile | Default, Extra small, Small, Medium or Large. |
| Language | Fixed on Automatic for now: the widget uses the visitor's browser language. |
Values written in the code on your site take priority over what you save here.
Test
Open your site, click the floating button and send a message. The avatar answers, and the conversation appears in Conversations.
Remove
Delete the code from your pages. The button disappears on the next page load.
Common problems
| Symptom | What to do |
|---|---|
| The button does not appear | Check that the domain is authorized by Tolky (including www or not, and https), that slug is correct and that the configuration block comes before the script. |
| "Upload an image to save." | In Custom configuration, upload a button image before clicking Save. |
| "Unsupported format. Use PNG, JPG or WebP." | Convert the image to one of these formats. |
| "The image must be square." | Crop the image so width and height are equal. |
| "Each side must be between 256 and 1024 pixels." | Resize the image. |
| "This host has no active configuration. Contact support." | Ask Tolky support to activate the account configuration. |
Configuration, network and CSPTechnical details
Configuration options
All options go in window.tolky.config. The order of priority is: the code on your site, then Settings › Minichat, then the widget default.
| Option | Type | Description |
|---|---|---|
slug | string | Required. Your avatar's slug. Without it, the widget does not render. |
subSlug | string | Opens the conversation with a specific avatar of your account. |
theme | "auto", "light", "dark" | Overrides the theme. |
iconImageUrl | string (URL) | Image of the floating button. When set, the button shows only the image. |
iconSizeDesktop | "xsmall", "small", "medium", "large" | Button width on desktop: 100, 120, 160 or 200 px. Default medium. |
iconSizeMobile | "xsmall", "small", "medium", "large" | Button width on mobile: 70, 72, 92 or 120 px. Default medium. |
showCtaTextDesktop / showCtaTextMobile | boolean | false hides the call-to-action text on the button; true shows it, even over a custom image. Only the site code controls this. |
Any other size value, including a number of pixels, is ignored and the default size is used. The code generated by the avatar creation wizard also includes firstMessage; the widget does not read it. The greeting comes from the avatar.
How it runs
- The widget renders inside a Shadow DOM: your site's CSS does not change the widget, and the widget's CSS does not leak into your site.
- Visitors can attach one image or PDF per message, up to 10 MB.
- Requests from a domain that is not authorized get
403 Forbidden, and the widget does not appear.
Network and Content Security Policy
If your site uses a Content Security Policy, allow:
| Directive | Values |
|---|---|
script-src | https://minichat.tolky.to https://api.tolky.to |
style-src | https://minichat.tolky.to |
connect-src | https://minichat.tolky.to https://api.tolky.to wss://api.tolky.to |
img-src | blob: (preview of an attachment before it is sent) |
Avatar pictures and attachments are served from Tolky file storage. If your policy restricts img-src and images do not show, ask Tolky support for the hosts to allow.
Real-time messages use a secure WebSocket (wss://api.tolky.to). If it is blocked by a proxy or firewall, the avatar still answers, but messages sent by your team only show up after the visitor reopens the chat.