@paramms/chat-widget 1.0.39 → 1.0.40

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.
Files changed (2) hide show
  1. package/README.md +35 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -191,6 +191,40 @@ const signedToken = `${hdr}.${pay}.${sig}`
191
191
  />
192
192
  ```
193
193
 
194
+ ### Launcher message (the teaser card)
195
+
196
+ An optional card shown **above the closed bubble** to invite a conversation.
197
+ Visitors can dismiss it with the ×; it stays dismissed for the browser session
198
+ and retires automatically once the chat is opened.
199
+
200
+ ```tsx
201
+ <ChatWidget
202
+ url="https://api.relay.paramms.com"
203
+ profileId="YOUR_PROFILE_ID"
204
+ launcher
205
+ launcherMessage={{ title: 'Questions? Chat with us', subtitle: 'Start a conversation' }}
206
+ />
207
+ ```
208
+
209
+ A bare string works too (title only): `launcherMessage="Need help?"`.
210
+
211
+ **You usually don't need this prop.** Set the message once per chatroom in the
212
+ dashboard (*Chatrooms → your chatroom → Widget message & availability*) and it
213
+ arrives automatically over the socket. Pass `launcherMessage` only to override
214
+ the dashboard value for one embed (it also renders instantly, before the
215
+ socket connects).
216
+
217
+ Script-tag embeds use data attributes:
218
+
219
+ ```html
220
+ <script
221
+ src="https://relay.paramms.com/embed.js"
222
+ data-relay-app="YOUR_PROFILE_ID"
223
+ data-relay-launcher-message="Questions? Chat with us"
224
+ data-relay-launcher-subtitle="Start a conversation"
225
+ ></script>
226
+ ```
227
+
194
228
  ## Internationalisation
195
229
 
196
230
  ```tsx
@@ -222,6 +256,7 @@ RTL is detected automatically for Arabic, Hebrew, Persian and Urdu browsers.
222
256
  | `accent` | `string` | `#f5713c` | Brand colour (hex) |
223
257
  | `launcher` | `boolean` | `false` | Render as floating button |
224
258
  | `position` | `'bottom-right' \| 'bottom-left'` | `'bottom-right'` | Launcher position |
259
+ | `launcherMessage` | `string \| { title, subtitle? }` | chatroom setting | Teaser card above the closed launcher. Overrides the dashboard's per-chatroom message; dismissible per session |
225
260
  | `translateLang` | `string` | — | Auto-translate incoming messages (ISO language code) |
226
261
  | `quickReplies` | `string[]` | — | Pre-set reply chips shown above input |
227
262
  | `i18n` | `I18nStrings` | English | UI string overrides |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paramms/chat-widget",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "Embeddable real-time chat widget for the Relay platform",
5
5
  "license": "MIT",
6
6
  "repository": {