1. Home
  2. Docs
  3. Javascript
  4. Invoke methods

Invoke methods

When a custom tab is required on a page, it is possible to create an HTML element instead of the ROBIN tab (make sure to hide the ROBIN tab using robin_settings.hide_tab = true). The click event on the HTML element needs to activate the ROBIN contact form (this can be achieved by using the following code __robin.show('contact_form')). This and other things can be done by invoking methods on the ROBIN javascript API. The Supported methods are the following:


show(channel)Activates the ROBIN contact form using the specified channel ('contact_form', 'chat' or 'phone'). When channel is undefined, the channel is determined depending on the online status of the webstore.
hide()Hides the ROBIN contact form.
setShopper(emailAddress, name)Identify a user on a page, when this method is invoked, ROBIN shows the name and email address specified in the contact form when it is shown. When anonymous chat is enabled, the name and email address are sent when a conversation is started, so the information becomes available to the agent that handles the conversation.
chat(emailAddress)Starts a chat conversation with a specific agent identified by emailAddress. When the agent is not online, an offline conversation is started with that agent (making the specific agent more important than the online status). This feature is known as personal routing.
reset()ROBIN uses session cookies that identify current channel, current agent, shopper data etc. Using the reset method, all session cookies are deleted, making it a fresh (first) visit to the page after a refresh.