@_solaris/messenger-widget 0.3.13 → 0.4.0

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 CHANGED
@@ -20,11 +20,16 @@ import '@_solaris/messenger-widget/style.css';
20
20
  // In a Vue 3 app:
21
21
  // <Messenger :base-url="..." :widget-id="..." :user-id="..." :user-hash="..." display-mode="floating" />
22
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 }"
23
+ // UI language: pass `language` ('fr' | 'en'). When omitted, it falls back to
24
+ // the authenticated customer's `language`, then the widget config's
25
+ // `default_language`, then French:
26
+ // <Messenger ... language="en" />
27
+ //
28
+ // Optionally pass agent context. `context.customer` is a flat object —
29
+ // pushed once to PATCH /customers/me on boot so the agent has it as context.
30
+ // `name` and `email` map to the customer's columns; any other key is a named
31
+ // variable value (server does a partial set, keeping ones you don't pass):
32
+ // :context="{ customer: { name: 'Jane', email: 'jane@acme.io', plan: 'pro', seats: 12 } }"
28
33
  ```
29
34
 
30
35
  It also exports the individual presentational components, the design tokens and
@@ -50,11 +55,14 @@ import {
50
55
  userId: '…',
51
56
  userHash: '…', // HMAC-SHA256(secret, userId), computed server-side
52
57
  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
+ language: 'en', // optional — 'fr' | 'en'; else customer.language / widget.default_language
59
+ context: { // optional agent context
60
+ customer: { // pushed once to PATCH /customers/me
61
+ name: 'Jane Doe', // so the agent has it as context
62
+ email: 'jane@acme.io',
63
+ plan: 'pro', // any extra key → named variable (values)
64
+ seats: 12, // server keeps variables you don't pass
65
+ },
58
66
  },
59
67
  });
60
68
  // Messenger.destroy() to tear it down.