Skip to content

Commit f3db807

Browse files
authored
feat: expose setConversationCustomAttributes method (#149)
This commit exposes the method setConversationCustomAttributes from Chatwoot.
1 parent 67f8f5b commit f3db807

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ const { isModalVisible, toggle, toggleBubbleVisibility, popoutChatWindow } = use
129129
| toggle | `'open' or 'close' - Function ` | You can open and close the chat |
130130
| setUser | `key: string, args: ChatwootSetUserProps - Function` | You can send user information to chatwoot panel. |
131131
| setCustomAttributes | `attributes: { [key: string]: string } - Function` | You can send custom attributes to chatwoot panel. |
132+
| setConversationCustomAttributes | `attributes: { [key: string]: string } - Function` | You can send conversation custom attributes to chatwoot panel. |
132133
| deleteCustomAttribute | `key: string - Function` | You can delete custom attributes to chatwoot panel. |
133134
| setLocale | `local: string - Function` | Change widget locale |
134135
| setLabel | `label: string - Function` | You can send label to chatwoot panel. |

src/runtime/vue/vue.ts

+8
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export interface Chatwoot {
119119
toggle: (state?: 'open' | 'close') => void
120120
setUser: (key: string, args: ChatwootSetUserProps) => void
121121
setCustomAttributes: (attributes: { [key: string]: string }) => void
122+
setConversationCustomAttributes: (attributes: { [key: string]: string }) => void
122123
deleteCustomAttribute: (key: string) => void
123124
setLocale: (local: string) => void
124125
setLabel: (label: string) => void
@@ -286,6 +287,12 @@ export function useChatWoot() {
286287
isLoadTimer().then(() => window.$chatwoot.setCustomAttributes(attributes))
287288
}
288289

290+
const setConversationCustomAttributes = (
291+
attributes: Parameters<Chatwoot['setConversationCustomAttributes']>[0],
292+
) => {
293+
isLoadTimer().then(() => window.$chatwoot.setConversationCustomAttributes(attributes))
294+
}
295+
289296
const deleteCustomAttribute = (
290297
attributes: Parameters<Chatwoot['deleteCustomAttribute']>[0],
291298
) => {
@@ -327,6 +334,7 @@ export function useChatWoot() {
327334
toggle,
328335
setUser,
329336
setCustomAttributes,
337+
setConversationCustomAttributes,
330338
deleteCustomAttribute,
331339
setLocale,
332340
setLabel,

0 commit comments

Comments
 (0)