@_solaris/messenger-widget 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -1
- package/dist/messenger.cjs +24 -24
- package/dist/messenger.embed.js +30 -30
- package/dist/messenger.js +1173 -1145
- package/dist/style.css +1 -1
- package/dist/types/core/config.d.ts +11 -0
- package/dist/types/core/store.d.ts +5 -0
- package/dist/types/core/transport.d.ts +1 -1
- package/dist/types/core/types.d.ts +24 -2
- package/dist/types/embed.d.ts +12 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,6 +19,12 @@ import '@_solaris/messenger-widget/style.css';
|
|
|
19
19
|
|
|
20
20
|
// In a Vue 3 app:
|
|
21
21
|
// <Messenger :base-url="..." :widget-id="..." :user-id="..." :user-hash="..." display-mode="floating" />
|
|
22
|
+
//
|
|
23
|
+
// Optionally pass customer data / variables as a flat object — pushed once
|
|
24
|
+
// to PATCH /customers/me on boot so the agent has it as context. `name` and
|
|
25
|
+
// `email` map to the customer's columns; any other key is a named variable
|
|
26
|
+
// value (server does a partial set, keeping ones you don't pass):
|
|
27
|
+
// :customer="{ name: 'Jane', email: 'jane@acme.io', plan: 'pro', seats: 12 }"
|
|
22
28
|
```
|
|
23
29
|
|
|
24
30
|
It also exports the individual presentational components, the design tokens and
|
|
@@ -43,7 +49,13 @@ import {
|
|
|
43
49
|
widgetId: '…',
|
|
44
50
|
userId: '…',
|
|
45
51
|
userHash: '…', // HMAC-SHA256(secret, userId), computed server-side
|
|
46
|
-
displayMode: 'floating'
|
|
52
|
+
displayMode: 'floating',// 'floating' | 'sheet' | 'embedded'
|
|
53
|
+
customer: { // optional — pushed once to PATCH /customers/me
|
|
54
|
+
name: 'Jane Doe', // so the agent has it as context
|
|
55
|
+
email: 'jane@acme.io',
|
|
56
|
+
plan: 'pro', // any extra key → named variable (values)
|
|
57
|
+
seats: 12, // server keeps variables you don't pass
|
|
58
|
+
},
|
|
47
59
|
});
|
|
48
60
|
// Messenger.destroy() to tear it down.
|
|
49
61
|
</script>
|