|
8 | 8 | ## Features |
9 | 9 | * Web Widget api available. Please see [Zendesk docs](https://developer.zendesk.com/api-reference/widget-messaging/web/core/) |
10 | 10 | * TypeScript support |
11 | | -* Only 25kb |
| 11 | +* Only 40kb |
12 | 12 | * Working on NextJS/Gatsby |
13 | 13 |
|
14 | 14 |
|
@@ -63,6 +63,7 @@ Place the `ZendeskProvider` as high as possible in your application. This will m |
63 | 63 | | onOpen | () => void | triggered when the Widget opens (chat is visible). Please see `isOpen` field if you want to get chat state by hooks | | | |
64 | 64 | | onClose | () => void | triggered when the Widget closes (chat is hidden). Please see `isOpen` field if you want to get chat state by hooks | | | |
65 | 65 | | onUnreadMessages | (count; number) => void | triggered when the current number of unread messages changes. If attached, Zendesk triggers this callback after initialization. Please see `unreadMessages` field if you want to get the number by hook | | | |
| 66 | +| onResetWidget | () => void | Executes when the widget has been reset successfully completes | | | |
66 | 67 |
|
67 | 68 |
|
68 | 69 | #### Example |
@@ -109,6 +110,7 @@ Library add some useful fields. |
109 | 110 | | setConversationTags | (conversationTags: string[]) => void | Allows custom conversation tags to be set in the client to add contextual data about the conversation |
110 | 111 | | loginUser | (jwtToken: string) => void | If your application has a login flow, or if a user needs to access the same conversation from multiple devices |
111 | 112 | | logoutUser | () => void | Your app may have a logout function that brings users back to a login screen. In this case, revert the messaging Web Widget to a pre-login state |
| 113 | +| resetWidget | () => void | This method clears all widget local state, including user data, conversations, and connections. |
112 | 114 | | isOpen | boolean | this flag indicates if chat is visible or hidden. Derivated from from `onOpen` and `onCLose` |
113 | 115 | | unreadMessages | number / undefined | this flag indicates number of unread messages . Derivated from from `onUnreadMessages`. Before internal callback this flag is `undefined` | |
114 | 116 |
|
@@ -136,8 +138,8 @@ const Home = () => { |
136 | 138 |
|
137 | 139 | return ( |
138 | 140 | <> |
139 | | - <p>you have {unreadMessages} unread messages</p> |
140 | | - <p>your chat is ${isOpen ? "visible" : "hidden"}</p> |
| 141 | + <p>you have {unreadMessages} unread messages</p> |
| 142 | + <p>your chat is ${isOpen ? "visible" : "hidden"}</p> |
141 | 143 | <button onClick={changeLocale}>Set ES as locale</button> |
142 | 144 | </> |
143 | 145 | ); |
|
0 commit comments