developers/Article

JavaScript API Reference

3 min read 2k views Share

JavaScript Widget API

Control the chat widget programmatically using the window.Dexra object.

Initialization

import { Dexra } from '@dexra/client-sdk';

const chat = new Dexra({
  appId: 'YOUR_APP_ID',
  region: 'us-east-1'
});

Methods

  • chat.open() - Expands the widget.
  • chat.close() - Minimizes the widget.
  • chat.identify(userId, traits) - Logs in a user.

Was this article helpful?