Skip to content

API reference

PropertyTypeDescription
isOpenSignal<boolean>Computed signal indicating if the widget is open
isVisibleSignal<boolean>Computed signal indicating if the widget is visible

Shows the Zendesk widget button if it’s currently hidden.

widget.show();

Hides the Zendesk widget button if it’s currently visible.

widget.hide();

Opens the Zendesk chat window if it’s currently closed.

widget.open();

Closes the Zendesk chat window if it’s currently open.

widget.close();

Convenience method that shows the widget and opens the chat window. Also applies conversation fields if set.

widget.showAndOpen();

setFields(fields: Record<string, string>): void

Section titled “setFields(fields: Record<string, string>): void”

Sets custom conversation fields that will be visible to support agents.

widget.setFields({
userId: '12345',
plan: 'premium',
lastLogin: new Date().toISOString(),
});

Authenticates a user with a JWT token.

await widget.login('your-jwt-token');