API methods provided by chat

The chat widget provides several API methods to help you customize it to your specific needs.


To be able to use the following methods, you must first initialize the API by calling the following code:


List of methods:

  • Opening the chat

  • Method allows you to open the chat widget.

  • Method allows you to open the chat form.

  • Method allows you to open a minimized window or open a new widget window.

  • Opening a callback

    Method allows you to open the callback widget.


    Method allows you to open the callback widget form.

  • Opening an email message

    Method allows you to open the email widget.

  • Closing the widget

    Method allows you to close an open widget.

  • Minimizing the conversation window

    Method allows you to minimize the conversation window.

  • Set default customer data (Name, email address, chat queue, phone number, callback queue)

    Method allows you to set the customer's default name, email and phone number and select a queue for chats and callbacks.

    _tc('set_user', 'name', 'email_address', topicId, 'phone', queueId);
  • Setting the element in which the widget will be placed

    Method allows you to select the element to which the widget will be attached (by default BODY). It takes as parameter the identifier (id) of the corresponding element.

    _tc('set_container', 'element-id');
  • Listening for events (such as the start of a conversation)

    Method allows you to run the code after a specific event (such as starting a conversation).

    _tc('event_listener', function(event) {
        alert('Zdarzenie: ' + event);

    Supported events:

    • conversation_created - conversation start,
    • conversation_finished - end of conversation,
    • callback_created - ordered callback for now,
    • callback_finished - completed callback,
    • callback_scheduled - ordered callback for the date of your choice,
    • ticket_created - message left,
    • poke_showed - poke shown,
    • minimized - minimized the widget window via the button "_",
    • closed - window closed with "x",
    • opened - minimized or closed widget opened.

Example use:

Set customer data and open chat after clicking on a link on the page


<a href="#" id="open-chat-link">open chat</a>


window.addEventListener('load', function () {
    window._tc = window._tc || function () {
        (_tc.q = _tc.q || []).push(arguments);

        .addEventListener('click', function () {
            _tc('set_user', 'Janko Walski', '');

Was this information helpful?


My name is Łukasz and I take care of Thulium's knowledge base. I'd love to keep it accurate and understandable. If you have any remarks or suggestions for improvement - let me read them.

Drop me a line at: