Widget JavaScript API

The embed script exposes window.Sela. The older window.SelaWidget alias still works temporarily for compatibility.

Global Object

Use window.Sela to show the widget and update its runtime configuration in SPA-style apps.

javascript
window.Sela.show();
window.Sela.hide();

Methods

Sela.show()

Opens the widget programmatically.

javascript
document.getElementById('help-btn')?.addEventListener('click', () => {
  window.Sela.show();
});

Sela.hide()

Closes the widget.

javascript
window.Sela.hide();

Sela.updateConfig(config)

Updates visual widget configuration after load.

javascript
window.Sela.updateConfig({
  theme: 'dark',
  primaryColor: '#0f766e',
  widgetIcon: 'headset',
});

Events

You can listen to iframe runtime messages indirectly through your own analytics hooks when needed.

window.SelaWidget

The legacy alias is still available temporarily, but new integrations should use window.Sela.