Skip to content

Commit 8940097

Browse files
committed
chore: update readme
1 parent 2388e15 commit 8940097

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.changeset/cool-plums-go.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-use-zendesk": patch
3+
---
4+
5+
chore: update readme

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
## Features
99
* Web Widget api available. Please see [Zendesk docs](https://developer.zendesk.com/api-reference/widget-messaging/web/core/)
1010
* TypeScript support
11-
* Only 25kb
11+
* Only 40kb
1212
* Working on NextJS/Gatsby
1313

1414

@@ -63,6 +63,7 @@ Place the `ZendeskProvider` as high as possible in your application. This will m
6363
| onOpen | () => void | triggered when the Widget opens (chat is visible). Please see `isOpen` field if you want to get chat state by hooks | | |
6464
| onClose | () => void | triggered when the Widget closes (chat is hidden). Please see `isOpen` field if you want to get chat state by hooks | | |
6565
| 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 | | |
6667

6768

6869
#### Example
@@ -109,6 +110,7 @@ Library add some useful fields.
109110
| setConversationTags | (conversationTags: string[]) => void | Allows custom conversation tags to be set in the client to add contextual data about the conversation
110111
| loginUser | (jwtToken: string) => void | If your application has a login flow, or if a user needs to access the same conversation from multiple devices
111112
| 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.
112114
| isOpen | boolean | this flag indicates if chat is visible or hidden. Derivated from from `onOpen` and `onCLose`
113115
| unreadMessages | number / undefined | this flag indicates number of unread messages . Derivated from from `onUnreadMessages`. Before internal callback this flag is `undefined` |
114116

@@ -136,8 +138,8 @@ const Home = () => {
136138

137139
return (
138140
<>
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>
141143
<button onClick={changeLocale}>Set ES as locale</button>
142144
</>
143145
);

0 commit comments

Comments
 (0)