Skip to content

Widget API

The global function the embed exposes on your page, every command it accepts, and how to identify a signed-in visitor.

The embed defines a single global, $support. It queues calls made before the widget finishes loading, so you never need to wait for a ready event.

$support(command, payload)

identify

Attach the conversation to a customer you already authenticated. Call it once after your own login.

$support('identify', {
  email: 'marta@example.com',
  name:  'Marta Oliveira',
  order: 'SO-48219'
})

This does two things. It stops the widget asking for an email that you already have, and it becomes the verified identity that business API lookups are scoped to. Without it the agent cannot fetch an order until an address is verified inside the conversation.

Call it again on logout with no payload to detach the session.

open and close

$support('open')
$support('close')

Useful for a “chat with us” link in your own navigation, or for opening the widget automatically when a checkout error fires.

on

Subscribe to widget events.

$support('on', {
  event: 'conversation:started',
  handler: () => analytics.track('support_opened')
})

Events emitted: widget:ready, widget:opened, widget:closed, conversation:started, message:sent, message:received.

Masking regions from the recorder

Not a $support call, an attribute. Anything inside a marked element is skipped at capture time, including its layout and its labels.

<div data-hepo-mask>
  <input name="tax_id" />
</div>

Individual input values are masked everywhere by default. This attribute is for when an entire region should not be recorded at all.

Isolation notes

The widget renders inside an open shadow root. Your page styles cannot reach it and its styles cannot reach your page. There is no iframe, which is what makes dragging, file drops and popover positioning behave normally.

Every key it writes to localStorage is namespaced under vsh:, so nothing collides with your own storage even when the console is embedded inside an application that has its own session state.

Something wrong on this page? Mail support@hepo.ai and we will correct it.