Bit by ChatbyteBit by Chatbyte

Frontend API

Control Bit from your frontend.

This reference lists the core Bit API exposed by createBit.

For JavaScript examples, see Frontend API (JavaScript).

Methods

open()

Opens the Bit widget.

close()

Closes the Bit widget.

toggle()

Toggles the widget open/closed.

showNotification(options)

Shows a contextual notification next to the launcher.

bit.showNotification({
  id: 'pricing-page',
  text: 'Ask us about this page.',
  oncePerSession: true,
});

Returns the notification ID, or null when the text is empty. Saved automatic prompts are configured in Chatbyte settings. Use this method for runtime context from the host page.

hideNotification(id?)

Removes a runtime notification by ID. Without an ID, removes all current runtime notifications. Saved automatic prompts keep their own dismissal behavior.

setNavigationHandler(handler)

Called when the widget requests navigation.

identify({ token })

Associates a JWT with the current session.

onRequestToken(handler)

Registers a callback for Bit to request a fresh JWT.

getBit(agentId)

Returns a previously initialized widget instance.

On this page