Home/Documentation/Widget and appearance

Your own button and JavaScript on your website

Open the chat or the callback window from your own button on your website.

On a page with the widget code, you can open its windows from your own buttons and links. Examples for your developer:

  • window.CallsYou.openChat() - opens the chat. You can pass a text: window.CallsYou.openChat('Question about my order').
  • window.CallsYou.openCallback() - opens the callback window.
  • window.CallbackWidget.open('601234567') - opens callback with the number filled in, window.CallbackWidget.close() - closes the window.

Attributes in the widget code: data-key (required, your key), data-lang (forced language) and data-color (color).

More in the Installation tab, in the “For developers: custom form and API” section.

Logged-in user of your website

If people log in on your website, tell the widget who the person in the chat is:

  • window.CallsYou.identify({ id: '100', name: 'John Smith', email: 'john@company.com', profileUrl: 'https://yourcompany.com/profile/john', avatar: 'https://…' }) - after login (every field is optional),
  • window.CallsYou.reset() - after logout.

In Chat you'll then see the full name with a “↗” link to the profile, the user ID and email. The AI assistant knows the customer's email, so it doesn't have to ask for it.

The same conversation after login and on another device

A conversation started before login stays after login and gets the person's details right away. To load the account's latest open conversation after logging in on another device, also pass sig in identify - an HMAC-SHA256 signature of the account number (id) with the notification secret from Integrations, computed on your server. Without a signature, conversations from other devices aren't loaded (nobody can read someone else's conversation by passing their number).

Something missing?This documentation describes what the dashboard does today. If something doesn't match or you couldn't find it, ask in the help chat in your dashboard or send a request. Help & support →

See CallsYou in your business

3 days free. Enter your website, check the assistant's answers and paste one line of code.