Documentation

Custom support buttons

Open the rokochat widget from your own buttons, prefill messages, and hide the default floating bubble.

Open chat from any button

After the install snippet is on the page, call Rokochat('open') from a click handler. The call is queued if the widget script is still loading.

<button type="button" onclick="window.Rokochat && window.Rokochat('open')">
  Chat with support
</button>

Prefill the composer

Use Rokochat('openWith', message) when the button should open chat with context already typed in.

<button type="button" onclick="window.Rokochat && window.Rokochat('openWith', 'Hi, I need help')">
  Chat with support
</button>

Hide the default bubble

If you only want custom buttons (no floating launcher), hide the bubble after the widget is ready:

// Hide the floating bubble — use your own buttons only
Rokochat('on', 'ready', function () {
  Rokochat('hide');
});

React / Next.js

function SupportButton() {
  return (
    <button type="button" onClick={() => window.Rokochat?.("open")}>
      Chat with support
    </button>
  );
}

See also the Next.js install guide for app-router setup.

All panel controls

Rokochat('open')
Rokochat('close')
Rokochat('toggle')
Rokochat('hide')   // hide launcher
Rokochat('show')   // show launcher
Rokochat('openWith', 'Hi, I need help with my order')

Full reference: Panel controls