API reference
ZendeskWebWidget service
Section titled “ZendeskWebWidget service”Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
isOpen | Signal<boolean> | Computed signal indicating if the widget is open |
isVisible | Signal<boolean> | Computed signal indicating if the widget is visible |
Methods
Section titled “Methods”show(): void
Section titled “show(): void”Shows the Zendesk widget button if it’s currently hidden.
widget.show();hide(): void
Section titled “hide(): void”Hides the Zendesk widget button if it’s currently visible.
widget.hide();open(): void
Section titled “open(): void”Opens the Zendesk chat window if it’s currently closed.
widget.open();close(): void
Section titled “close(): void”Closes the Zendesk chat window if it’s currently open.
widget.close();showAndOpen(): void
Section titled “showAndOpen(): void”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(),});login(token: string): Promise<void>
Section titled “login(token: string): Promise<void>”Authenticates a user with a JWT token.
await widget.login('your-jwt-token');