Skip to main content

Any website (HTML)

This is the installation for every site: plain HTML, a PHP or Django template, a static site generator, anything that gives you a <body>. The other pages in this section only show where the same line goes on a particular platform.

1. Allow your website​

In the console → Widget & SDK → Allowed websites, add the address of your site:

What you addWhat it allows
https://acme.comExactly that site.
https://*.acme.comEvery sub-site (shop.acme.com, help.acme.com), but not acme.com itself: add both.
http://localhost:3000Your own machine while developing. http:// is only accepted for localhost.

Up to 20 entries. No paths (https://acme.com/pricing isn't a website), and no wildcards on a whole top-level domain. Changes save as you make them, with no Save button: a website works as soon as you press Add (or Enter), and removing one (×) stops the chat there at once.

Empty list = no chat anywhere

Until you add your website, the widget refuses to start. That's deliberate: nobody can put your chat, and your credits, on a site you didn't name.

2. Paste the snippet​

Copy it from Widget & SDK (it has your site key filled in), and put it just before </body> on every page where the bubble should appear:

Before </body>, on every page
<script src="https://api.mysarthi.tech/widget/v1.js" data-site-key="ws_acme_7f3a9c" async></script>
  • async means the script loads after your page and never blocks it.
  • The widget renders inside its own Shadow DOM: your stylesheet can't change it, and its stylesheet can't change your page.
  • Only the site key is in your page. It's public by design; the allowed-websites list is what protects you.

That's the whole installation for anonymous visitors. If people log in on your site, continue with signed-in customers.

What happens next​

  • The script fetches the widget from api.mysarthi.tech and shows the bubble bottom-right in your brand colour.
  • The chat starts when the visitor opens the bubble, not before. A visitor who never opens it costs nothing.
  • If the visitor reloads the page, the same chat continues (it remembers the chat in this browser). After 30 minutes of silence the chat ends.
  • Updates to the widget reach your site automatically; you never redeploy for a Sarthi update.

Checking it works​

  1. Open your site. The bubble should appear within a second or two of the page loading.
  2. Click it. You should see your greeting (or the form, if you turned it on).
  3. In the console, Conversations shows the new chat live.

If the bubble shows "Chat isn't available on this website", your address isn't in the allowed list yet. Every message the widget can show, and what it means, is in Troubleshooting.