@repzo/widget-react-native 1.0.0 → 1.0.1

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 (126) hide show
  1. package/README.md +167 -74
  2. package/lib/commonjs/api/client.js.map +1 -1
  3. package/lib/commonjs/attachments/pickers.js +493 -0
  4. package/lib/commonjs/attachments/pickers.js.map +1 -0
  5. package/lib/commonjs/i18n.js +19 -0
  6. package/lib/commonjs/i18n.js.map +1 -1
  7. package/lib/commonjs/index.js.map +1 -1
  8. package/lib/commonjs/locales.js +16 -0
  9. package/lib/commonjs/locales.js.map +1 -1
  10. package/lib/commonjs/state/widget-store.js +147 -13
  11. package/lib/commonjs/state/widget-store.js.map +1 -1
  12. package/lib/commonjs/types.js +14 -0
  13. package/lib/commonjs/types.js.map +1 -1
  14. package/lib/commonjs/ui/WidgetProvider.js +53 -8
  15. package/lib/commonjs/ui/WidgetProvider.js.map +1 -1
  16. package/lib/commonjs/ui/components/AttachmentChips.js +135 -0
  17. package/lib/commonjs/ui/components/AttachmentChips.js.map +1 -0
  18. package/lib/commonjs/ui/components/AttachmentMenu.js +125 -0
  19. package/lib/commonjs/ui/components/AttachmentMenu.js.map +1 -0
  20. package/lib/commonjs/ui/components/ImageViewer.js +181 -0
  21. package/lib/commonjs/ui/components/ImageViewer.js.map +1 -0
  22. package/lib/commonjs/ui/components/InAppNotification.js +210 -0
  23. package/lib/commonjs/ui/components/InAppNotification.js.map +1 -0
  24. package/lib/commonjs/ui/screens/chat/ChatView.js +198 -18
  25. package/lib/commonjs/ui/screens/chat/ChatView.js.map +1 -1
  26. package/lib/commonjs/ui/screens/chat/ChatView.styles.js +19 -0
  27. package/lib/commonjs/ui/screens/chat/ChatView.styles.js.map +1 -1
  28. package/lib/module/api/client.js.map +1 -1
  29. package/lib/module/attachments/pickers.js +479 -0
  30. package/lib/module/attachments/pickers.js.map +1 -0
  31. package/lib/module/i18n.js +19 -0
  32. package/lib/module/i18n.js.map +1 -1
  33. package/lib/module/index.js.map +1 -1
  34. package/lib/module/locales.js +16 -0
  35. package/lib/module/locales.js.map +1 -1
  36. package/lib/module/state/widget-store.js +147 -13
  37. package/lib/module/state/widget-store.js.map +1 -1
  38. package/lib/module/types.js +14 -0
  39. package/lib/module/types.js.map +1 -1
  40. package/lib/module/ui/WidgetProvider.js +53 -8
  41. package/lib/module/ui/WidgetProvider.js.map +1 -1
  42. package/lib/module/ui/components/AttachmentChips.js +131 -0
  43. package/lib/module/ui/components/AttachmentChips.js.map +1 -0
  44. package/lib/module/ui/components/AttachmentMenu.js +120 -0
  45. package/lib/module/ui/components/AttachmentMenu.js.map +1 -0
  46. package/lib/module/ui/components/ImageViewer.js +177 -0
  47. package/lib/module/ui/components/ImageViewer.js.map +1 -0
  48. package/lib/module/ui/components/InAppNotification.js +208 -0
  49. package/lib/module/ui/components/InAppNotification.js.map +1 -0
  50. package/lib/module/ui/screens/chat/ChatView.js +201 -21
  51. package/lib/module/ui/screens/chat/ChatView.js.map +1 -1
  52. package/lib/module/ui/screens/chat/ChatView.styles.js +19 -0
  53. package/lib/module/ui/screens/chat/ChatView.styles.js.map +1 -1
  54. package/lib/typescript/commonjs/api/client.d.ts +8 -2
  55. package/lib/typescript/commonjs/api/client.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/attachments/pickers.d.ts +81 -0
  57. package/lib/typescript/commonjs/attachments/pickers.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/i18n.d.ts +16 -0
  59. package/lib/typescript/commonjs/i18n.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/index.d.ts +1 -1
  61. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  62. package/lib/typescript/commonjs/locales.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/state/widget-store.d.ts +23 -2
  64. package/lib/typescript/commonjs/state/widget-store.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/types.d.ts +74 -0
  66. package/lib/typescript/commonjs/types.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/ui/WidgetProvider.d.ts.map +1 -1
  68. package/lib/typescript/commonjs/ui/components/AttachmentChips.d.ts +16 -0
  69. package/lib/typescript/commonjs/ui/components/AttachmentChips.d.ts.map +1 -0
  70. package/lib/typescript/commonjs/ui/components/AttachmentMenu.d.ts +28 -0
  71. package/lib/typescript/commonjs/ui/components/AttachmentMenu.d.ts.map +1 -0
  72. package/lib/typescript/commonjs/ui/components/ImageViewer.d.ts +23 -0
  73. package/lib/typescript/commonjs/ui/components/ImageViewer.d.ts.map +1 -0
  74. package/lib/typescript/commonjs/ui/components/InAppNotification.d.ts +28 -0
  75. package/lib/typescript/commonjs/ui/components/InAppNotification.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts +3 -2
  77. package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts.map +1 -1
  78. package/lib/typescript/commonjs/ui/screens/chat/ChatView.styles.d.ts +18 -0
  79. package/lib/typescript/commonjs/ui/screens/chat/ChatView.styles.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts +28 -2
  81. package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts.map +1 -1
  82. package/lib/typescript/module/api/client.d.ts +8 -2
  83. package/lib/typescript/module/api/client.d.ts.map +1 -1
  84. package/lib/typescript/module/attachments/pickers.d.ts +81 -0
  85. package/lib/typescript/module/attachments/pickers.d.ts.map +1 -0
  86. package/lib/typescript/module/i18n.d.ts +16 -0
  87. package/lib/typescript/module/i18n.d.ts.map +1 -1
  88. package/lib/typescript/module/index.d.ts +1 -1
  89. package/lib/typescript/module/index.d.ts.map +1 -1
  90. package/lib/typescript/module/locales.d.ts.map +1 -1
  91. package/lib/typescript/module/state/widget-store.d.ts +23 -2
  92. package/lib/typescript/module/state/widget-store.d.ts.map +1 -1
  93. package/lib/typescript/module/types.d.ts +74 -0
  94. package/lib/typescript/module/types.d.ts.map +1 -1
  95. package/lib/typescript/module/ui/WidgetProvider.d.ts.map +1 -1
  96. package/lib/typescript/module/ui/components/AttachmentChips.d.ts +16 -0
  97. package/lib/typescript/module/ui/components/AttachmentChips.d.ts.map +1 -0
  98. package/lib/typescript/module/ui/components/AttachmentMenu.d.ts +28 -0
  99. package/lib/typescript/module/ui/components/AttachmentMenu.d.ts.map +1 -0
  100. package/lib/typescript/module/ui/components/ImageViewer.d.ts +23 -0
  101. package/lib/typescript/module/ui/components/ImageViewer.d.ts.map +1 -0
  102. package/lib/typescript/module/ui/components/InAppNotification.d.ts +28 -0
  103. package/lib/typescript/module/ui/components/InAppNotification.d.ts.map +1 -0
  104. package/lib/typescript/module/ui/screens/chat/ChatView.d.ts +3 -2
  105. package/lib/typescript/module/ui/screens/chat/ChatView.d.ts.map +1 -1
  106. package/lib/typescript/module/ui/screens/chat/ChatView.styles.d.ts +18 -0
  107. package/lib/typescript/module/ui/screens/chat/ChatView.styles.d.ts.map +1 -1
  108. package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts +28 -2
  109. package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts.map +1 -1
  110. package/metro.js +17 -32
  111. package/package.json +18 -1
  112. package/src/api/client.ts +2 -2
  113. package/src/attachments/pickers.ts +515 -0
  114. package/src/i18n.ts +20 -0
  115. package/src/index.tsx +4 -0
  116. package/src/locales.ts +16 -0
  117. package/src/state/widget-store.ts +152 -16
  118. package/src/types.ts +79 -0
  119. package/src/ui/WidgetProvider.tsx +65 -6
  120. package/src/ui/components/AttachmentChips.tsx +135 -0
  121. package/src/ui/components/AttachmentMenu.tsx +132 -0
  122. package/src/ui/components/ImageViewer.tsx +178 -0
  123. package/src/ui/components/InAppNotification.tsx +225 -0
  124. package/src/ui/screens/chat/ChatView.styles.ts +19 -0
  125. package/src/ui/screens/chat/ChatView.tsx +235 -16
  126. package/src/ui/screens/chat/ChatView.types.ts +38 -2
package/README.md CHANGED
@@ -1,14 +1,19 @@
1
1
  # @repzo/widget-react-native
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@repzo/widget-react-native.svg)](https://www.npmjs.com/package/@repzo/widget-react-native)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@repzo/widget-react-native.svg)](https://www.npmjs.com/package/@repzo/widget-react-native)
5
+ [![license](https://img.shields.io/npm/l/@repzo/widget-react-native.svg)](https://www.npmjs.com/package/@repzo/widget-react-native)
6
+ ![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20Android-lightgrey.svg)
7
+ ![Expo Go](https://img.shields.io/badge/Expo%20Go-supported-000020.svg)
8
+
3
9
  The Repzo chat widget for React Native — an Intercom-style messenger that drops
4
10
  into any app. Pure JavaScript/TypeScript: **no native modules of its own, no
5
11
  config plugin, no `pod install`**. Works on iOS and Android, Expo and bare
6
12
  React Native, old and new architecture.
7
13
 
8
- It talks to the same `/api/widget/*` endpoints as the web widget (Workstation →
14
+ It connects to the same channel as your Repzo website chat (Workstation →
9
15
  Settings → Inbox Channels → Website Chat), so a message sent from the app lands
10
- in the CRM Inbox as a `web_widget` conversation and agent replies stream back
11
- live over SSE.
16
+ in your Repzo Inbox and agent replies arrive live.
12
17
 
13
18
  **Features**
14
19
 
@@ -18,6 +23,7 @@ live over SSE.
18
23
  - Live agent replies, typing indicators, unread badges (server-backed counts)
19
24
  - Catches up after a dropped connection or a trip to the background — no missed or duplicated replies
20
25
  - Agent UI blocks: product cards, slot pickers, lead forms, quotes, receipts
26
+ - **Photo and file attachments** (optional — with `expo-image-picker` / `expo-document-picker`, or your own picker)
21
27
  - **Push notifications via FCM** (optional — needs `@react-native-firebase/messaging` in the host app)
22
28
  - Theme cached on-device, so relaunches paint your colors instantly
23
29
  - Events for building your own badge, in-app banner, and tray cleanup
@@ -31,57 +37,81 @@ live over SSE.
31
37
  | `@react-native-firebase/app` + `@react-native-firebase/messaging` | optional — only for push notifications (v22+ and v26+ modular API both supported) |
32
38
  | `react-native-linear-gradient` | optional — gradient home backgrounds |
33
39
  | `react-native-safe-area-context` | optional — safe-area insets from the host provider |
40
+ | `expo-image-picker` | optional — "Photo library" and "Take photo" attachments (v16+ / SDK 52+) |
41
+ | `expo-document-picker` | optional — "File" attachments |
42
+ | `expo-file-system` | optional — reads picked files as base64 (falls back to `fetch` without it) |
43
+ | `expo-image-manipulator` | optional — shrinks photos so camera shots fit the 1.5 MB attachment limit |
34
44
 
35
45
  Realtime uses React Native’s built-in streaming XMLHttpRequest; there are no bundled runtime dependencies.
36
46
 
37
47
  ## Installation
38
48
 
39
- Not on npm yet — install from Git. The fixes below are on `main`; replace it
40
- with a release tag to pin a version after the next release:
49
+ Published on npm as
50
+ [`@repzo/widget-react-native`](https://www.npmjs.com/package/@repzo/widget-react-native):
41
51
 
42
52
  ```sh
43
- # Yarn / Expo projects
44
- yarn add @repzo/widget-react-native@git+https://github.com/Repzo/repzo-widget-react-native.git#main
45
-
46
53
  # npm
47
- npm install @repzo/widget-react-native@git+https://github.com/Repzo/repzo-widget-react-native.git#main
54
+ npm install @repzo/widget-react-native
55
+
56
+ # Yarn
57
+ yarn add @repzo/widget-react-native
58
+
59
+ # pnpm
60
+ pnpm add @repzo/widget-react-native
61
+
62
+ # Expo
63
+ npx expo install @repzo/widget-react-native
64
+ ```
65
+
66
+ No Metro change is needed with the standard Expo or React Native Metro config —
67
+ see [Metro setup](#metro-setup) if you build yours from bare `metro-config`.
68
+
69
+ Recommended: add async-storage so sessions survive app restarts (without it, or
70
+ a [custom adapter](#custom-storage), they only last until the app is killed):
71
+
72
+ ```sh
73
+ # Expo
74
+ npx expo install @react-native-async-storage/async-storage
75
+
76
+ # Bare React Native
77
+ npm install @react-native-async-storage/async-storage && cd ios && pod install
48
78
  ```
49
79
 
80
+ The other optional peers are `react-native-safe-area-context` (safe-area insets
81
+ — most apps already have it) and `react-native-linear-gradient` (gradient home
82
+ backgrounds; a native module, so not in Expo Go — without it the SDK draws a
83
+ banded approximation). Push notifications need Firebase, see
84
+ [Push notifications](#push-notifications-optional).
85
+
50
86
  Expo: no config plugin and no `npx expo prebuild` needed — the SDK itself runs
51
87
  in **Expo Go**. (Push notifications are the one exception: they need a
52
88
  development build, see below.)
53
89
 
90
+ To upgrade later: `npm install @repzo/widget-react-native@latest` (or
91
+ `yarn upgrade @repzo/widget-react-native --latest`).
92
+
54
93
  ## Metro setup
55
94
 
56
- Wrap your app's final Metro config with `withRepzoWidget`. **This is required
57
- when any optional integration is absent.** Metro resolves static `require()`
58
- calls before JavaScript runs, so runtime `try/catch` alone cannot make an
59
- uninstalled integration optional.
95
+ Nothing to do for most apps. Every optional integration is loaded with a
96
+ `require()` inside a `try` block, and the default Expo
97
+ (`expo/metro-config`) and React Native (`@react-native/metro-config`) configs
98
+ enable Metro's `allowOptionalDependencies`, so a missing integration simply
99
+ turns into a require that fails at runtime and is caught.
60
100
 
61
- ```js
62
- // metro.config.js — Expo
63
- const { getDefaultConfig } = require('expo/metro-config');
64
- const { withRepzoWidget } = require('@repzo/widget-react-native/metro');
65
-
66
- module.exports = withRepzoWidget(getDefaultConfig(__dirname));
67
- ```
101
+ Only if your config starts from bare `metro-config` defaults (where
102
+ `allowOptionalDependencies` is off) wrap it with `withRepzoWidget`, which just
103
+ turns that flag on:
68
104
 
69
105
  ```js
70
- // metro.config.js — bare React Native
71
- const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
106
+ // metro.config.js
72
107
  const { withRepzoWidget } = require('@repzo/widget-react-native/metro');
73
108
 
74
- module.exports = withRepzoWidget(mergeConfig(getDefaultConfig(__dirname), {
75
- // Your existing config.
76
- }));
109
+ module.exports = withRepzoWidget(yourMetroConfig);
77
110
  ```
78
111
 
79
- Keep your existing config/plugins and apply this wrapper last. It preserves
80
- installed integrations and existing custom resolvers, substituting an empty
81
- module only for missing optional imports made by this widget. Missing host
82
- imports and broken installed packages still report their errors. Restart Metro
83
- with its cache reset after changing the config (`npx expo start --clear` or
84
- `npx react-native start --reset-cache`).
112
+ Earlier versions of this helper installed a custom resolver; that broke Expo
113
+ development builds at startup (`Property 'MessageQueue' doesn't exist`).
114
+ Upgrade, or remove the wrapper.
85
115
 
86
116
  ## Quick start
87
117
 
@@ -119,23 +149,22 @@ await RepzoWidget.logout();
119
149
  ```
120
150
 
121
151
  `channelAccountId` is the last path segment of
122
- `/settings/inbox-channels/<id>/widget` in Workstation. For a dev/staging CRM
123
- pass `baseUrl` too — Android emulators reach a CRM on your machine via
124
- `http://10.0.2.2:3000`, never `localhost`. `baseUrl` must be `https://`;
125
- `boot()` throws for plain `http://` unless the host is `localhost`,
126
- `127.0.0.1`, `10.0.2.2` or `*.local`, or the app is a `__DEV__` build.
152
+ `/settings/inbox-channels/<id>/widget` in Workstation. Pass `baseUrl` only if
153
+ Repzo gave you a different environment to connect to. `baseUrl` must be
154
+ `https://`; `boot()` throws for plain `http://` (local addresses in `__DEV__`
155
+ builds excepted).
127
156
 
128
157
  ## Signing out (host duties)
129
158
 
130
159
  Call `await RepzoWidget.logout()` whenever your user signs out, **before**
131
160
  the next person can use the device. It:
132
161
 
133
- 1. revokes the visitor token on the server (`POST /api/widget/logout`) and
162
+ 1. revokes the visitor token on the server and
134
163
  removes this device's push registration — best-effort, each capped at 5s,
135
164
  never re-initing a session;
136
165
  2. wipes every user-scoped key (token, user key, unread counts) and rotates
137
166
  the anonymous device id, so the next visitor gets a brand-new identity;
138
- 3. closes the SSE stream, drops the app-state listeners and resets the UI.
167
+ 3. closes the live connection, drops the app-state listeners and resets the UI.
139
168
 
140
169
  Only the cached channel theme survives. Nothing reconnects until your next
141
170
  `boot()` / `loginUser…()` call.
@@ -254,6 +283,77 @@ await RepzoWidget.boot({
254
283
  Only accept deep links you would be comfortable with *anyone* sending your
255
284
  user in a chat message.
256
285
 
286
+ ## Attachments
287
+
288
+ Visitors can send photos and files from the paperclip button beside the
289
+ message field. The SDK has no picker of its own; it uses whatever your app
290
+ installs:
291
+
292
+ ```sh
293
+ npx expo install expo-image-picker expo-document-picker expo-file-system expo-image-manipulator
294
+ ```
295
+
296
+ | Installed | Menu options |
297
+ | --- | --- |
298
+ | `expo-image-picker` | Photo library, Take photo |
299
+ | `expo-document-picker` | File |
300
+ | `expo-file-system` | nothing new — reads picked files faster (SDK 53's `readAsStringAsync` and SDK 54+'s `File` both work) |
301
+ | `expo-image-manipulator` | nothing new — shrinks photos so camera shots fit the size limit (recommended) |
302
+
303
+ With none of them (and no `pick` below) the button isn't shown. It is also
304
+ hidden when attachments are switched off for the channel in Workstation.
305
+ These are Expo modules: they run in Expo Go, and bare React Native apps need
306
+ [`expo`](https://docs.expo.dev/bare/installing-expo-modules/) installed to use
307
+ them. Taking photos needs `NSCameraUsageDescription` in `Info.plist` (the
308
+ `expo-image-picker` config plugin adds it).
309
+
310
+ **Limits** — the server's, enforced before anything is sent so the visitor
311
+ gets a clear message instead of a silently missing file:
312
+
313
+ - 5 files per message
314
+ - 1.5 MB per file
315
+ - 6 MB for all files in one message together (they travel base64-encoded in
316
+ one JSON request)
317
+
318
+ With `expo-image-manipulator` installed, photos are scaled to at most 1600 px
319
+ on the longest edge and saved as 70% JPEG — typically 200–500 KB, so camera
320
+ shots fit comfortably. Without it they're only compressed, and a
321
+ full-resolution camera photo can still exceed 1.5 MB and is then refused with
322
+ a message. A message can be attachments only,
323
+ with no text. If a send fails, the attachments stay in the composer so the
324
+ visitor can retry.
325
+
326
+ ### Your own picker
327
+
328
+ Apps that use `react-native-image-picker`, `react-native-document-picker` or
329
+ anything else can plug it in. `pick` replaces the Expo pickers entirely; return
330
+ the files (`base64` or a readable `file://` `uri`), or `null` on cancel:
331
+
332
+ ```ts
333
+ import { launchImageLibrary } from 'react-native-image-picker';
334
+
335
+ await RepzoWidget.boot({
336
+ channelAccountId: '<widget id>',
337
+ attachments: {
338
+ sources: ['photo'], // menu options to offer (default: all three)
339
+ pick: async (source) => { // 'photo' | 'camera' | 'file'
340
+ const result = await launchImageLibrary({ mediaType: 'photo', includeBase64: true, quality: 0.7 });
341
+ if (result.didCancel || !result.assets) return null;
342
+ return result.assets.map((asset) => ({
343
+ name: asset.fileName ?? 'photo.jpg',
344
+ type: asset.type ?? 'image/jpeg',
345
+ size: asset.fileSize,
346
+ uri: asset.uri,
347
+ base64: asset.base64,
348
+ }));
349
+ },
350
+ },
351
+ });
352
+ ```
353
+
354
+ The limits still apply to whatever `pick` returns. To turn attachments off in
355
+ the app regardless of the channel setting, pass `attachments: { enabled: false }`.
356
+
257
357
  ## Errors
258
358
 
259
359
  `boot()` / login calls reject with a `RepzoWidgetError` (`status`, `code`).
@@ -274,10 +374,34 @@ get a plain message and no Retry.
274
374
  Expired or revoked tokens (401) are handled silently: the SDK re-inits once
275
375
  (shared by all concurrent requests) and retries.
276
376
 
377
+ ## In-app notifications
378
+
379
+ When a team reply arrives while the app is open but the messenger is closed,
380
+ a card slides up at the bottom of the screen with the agent's avatar, the
381
+ message and "Reply from {agent}". It stays until the visitor:
382
+
383
+ - **taps it** — opens that conversation, or
384
+ - **swipes it left or right** — dismisses it (the thread stays unread, so the
385
+ badge keeps counting it).
386
+
387
+ Only the newest reply is shown; it also goes away by itself when the messenger
388
+ opens or the thread is read on another device. Replies that arrived while the
389
+ app was closed get the same card once when the app starts (newest unread
390
+ thread only), so visitors without push still notice them. Screen readers announce it and
391
+ offer a "Dismiss" action. It is on by default and needs
392
+ `<RepzoWidgetProvider>` mounted at the root; to turn it off:
393
+
394
+ ```tsx
395
+ await RepzoWidget.boot({ channelAccountId: '…', inAppNotifications: false });
396
+ ```
397
+
398
+ While the app is in the background the system push notification (below) does
399
+ this job instead.
400
+
277
401
  ## Push notifications (optional)
278
402
 
279
403
  Agent replies are pushed **only when the user has no live connection** (app
280
- backgrounded or killed — a visitor watching the chat gets the message over SSE
404
+ backgrounded or killed — a visitor watching the chat gets the message live
281
405
  instead). Several replies collapse into one notification per conversation, and
282
406
  tapping it deep-links straight into that conversation from both background and
283
407
  killed states. Delivery is FCM-only: Firebase relays iOS pushes through APNs
@@ -413,7 +537,7 @@ sub.remove();
413
537
 
414
538
  | Method | Notes |
415
539
  | --- | --- |
416
- | `boot({ channelAccountId, baseUrl?, user?, push?, onOpenUrl? })` | Mints/resumes the session and connects SSE. Idempotent; safe to call repeatedly. |
540
+ | `boot({ channelAccountId, baseUrl?, user?, push?, onOpenUrl?, attachments? })` | Mints/resumes the session and connects the live stream. Idempotent; safe to call repeatedly. |
417
541
  | `loginUserWithUserAttributes({ userId?, email?, name?, phone?, userHash? })` | Identifies the visitor; moves anonymous history over. A different stored user is signed out first. |
418
542
  | `loginUnidentifiedUser()` | Drops the identity (signing out a stored user), fresh anonymous session. |
419
543
  | `updateUser(attributes)` | Custom attributes agents see on the conversation (≤30 keys, 64-char keys, 512-char values). |
@@ -434,9 +558,9 @@ container, it positions itself absolutely.
434
558
 
435
559
  ## Troubleshooting
436
560
 
437
- - **No push arrives** — check in this order: the device registered (a row in
438
- Workstation's `widget_push_tokens` after boot + login), channel provider is
439
- FCM with an Apps entry whose bundle id matches, the `.p8` is uploaded (iOS),
561
+ - **No push arrives** — check in this order: `boot()` with `push.enabled` and a
562
+ login both succeeded, the channel provider is FCM with an Apps entry whose
563
+ bundle id matches, the `.p8` is uploaded (iOS),
440
564
  and the app was **killed or backgrounded** during the test — an open chat
441
565
  never pushes, by design. The SDK logs every push problem with a
442
566
  `[repzo-widget]` prefix.
@@ -449,34 +573,3 @@ container, it positions itself absolutely.
449
573
  testing.
450
574
  - **`SENDER_ID_MISMATCH` in Workstation logs** — the app's Google config files
451
575
  and the uploaded service-account key are from different Firebase projects.
452
- - **Widget can't reach a local CRM from a device** — tunnel it (ngrok) or use
453
- `10.0.2.2` on Android emulators.
454
-
455
- ## Source layout
456
-
457
- ```
458
- src/
459
- index.tsx public API: RepzoWidget, provider, launcher, types
460
- api/ HTTP client and the SSE realtime stream
461
- push/ FCM token registration + notification tap handling
462
- state/ widget store and the hook that subscribes to it
463
- ui/
464
- WidgetProvider.tsx root: mounts the modal and switches between screens
465
- screens/ home/ chat/ conversations/ pre-chat/
466
- components/ rows, avatar, icons, gradients, panel chrome, launcher
467
- styles/ theme.ts (tokens, color helpers), global.ts
468
- hooks/ utils/
469
- ```
470
-
471
- ## Releasing
472
-
473
- ```sh
474
- # bump "version" in package.json and SDK_VERSION in src/state/widget-store.ts
475
- npx tsc --noEmit
476
- git commit -am "..." && git tag v0.1.x
477
- git push origin main --tags # github.com/Repzo
478
- git push public main --tags # github.com/yousef-repzo (mirror)
479
- ```
480
-
481
- Consumers pin the tag, so a release is only "live" for an app after its
482
- `package.json` pin is bumped and dependencies reinstalled.
@@ -1 +1 @@
1
- {"version":3,"names":["_storage","require","_safeUrl","TERMINAL_CODES","Set","isTerminalErrorCode","code","has","RepzoWidgetError","Error","constructor","message","status","name","fromResponse","body","payload","exports","WidgetApiClient","baseUrl","channelAccountId","token","tokenLoaded","reauthorize","onTerminalError","configure","replace","getBaseUrl","getChannelAccountId","getToken","SecureStorage","getItem","TOKEN_KEY","setToken","setItem","clearToken","removeItem","resolveUrl","url","trimmed","trim","isHttpUrl","urlScheme","resolved","startsWith","request","path","options","sentToken","send","headers","authToken","undefined","Authorization","fetch","method","JSON","stringify","error","response","skipReauth","refreshed","ok","json","catch","getConfig","platform","query","encodeURIComponent","getOutboundMessage","init","params","visitorToken","resumeToken","user","email","phone","userId","user_id","userHash","user_hash","trackingVisitorId","sdkVersion","logout","sendMessage","data","listConversations","listMessages","conversationId","cursor","markConversationRead","identify","sendTyping","isTyping","trackEvent","registerPushToken","removePushToken","auth"],"sourceRoot":"../../../src","sources":["api/client.ts"],"mappings":";;;;;;;AAUA,IAAAA,QAAA,GAAAC,OAAA;AAYA,IAAAC,QAAA,GAAAD,OAAA;AAtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA,MAAME,cAAc,GAAG,IAAIC,GAAG,CAAuB,CACnD,wBAAwB,EACxB,8BAA8B,CAC/B,CAAC;AAEK,SAASC,mBAAmBA,CAACC,IAA+B,EAAW;EAC5E,OAAO,CAAC,CAACA,IAAI,IAAIH,cAAc,CAACI,GAAG,CAACD,IAA4B,CAAC;AACnE;AAEO,MA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Ac;QAAEK;MAAS;IACnC,CAAC,CAAC;EACJ;EAEAC,UAAUA,CAACT,IAIV,EAAiB;IAChB,OAAO,IAAI,CAACxC,OAAO,CAAC,oBAAoB,EAAE;MACxCU,MAAM,EAAE,MAAM;MACdxC,IAAI,EAAE;QAAE,GAAGsE,IAAI;QAAEjE,gBAAgB,EAAE,IAAI,CAACA;MAAiB;IAC3D,CAAC,CAAC;EACJ;EAEA2E,iBAAiBA,CAACV,IAIjB,EAAiB;IAChB,OAAO,IAAI,CAACxC,OAAO,CAAC,wBAAwB,EAAE;MAAEU,MAAM,EAAE,MAAM;MAAExC,IAAI,EAAEsE;IAAK,CAAC,CAAC;EAC/E;;EAEA;EACAW,eAAeA,CACb3E,KAAa,EACb4E,IAAyD,GAAG,CAAC,CAAC,EAC/C;IACf,OAAO,IAAI,CAACpD,OAAO,CAAC,wBAAwB,EAAE;MAC5CU,MAAM,EAAE,QAAQ;MAChBxC,IAAI,EAAE;QAAEM;MAAM,CAAC;MACf,GAAG4E;IACL,CAAC,CAAC;EACJ;AACF;AAAChF,OAAA,CAAAC,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_storage","require","_safeUrl","TERMINAL_CODES","Set","isTerminalErrorCode","code","has","RepzoWidgetError","Error","constructor","message","status","name","fromResponse","body","payload","exports","WidgetApiClient","baseUrl","channelAccountId","token","tokenLoaded","reauthorize","onTerminalError","configure","replace","getBaseUrl","getChannelAccountId","getToken","SecureStorage","getItem","TOKEN_KEY","setToken","setItem","clearToken","removeItem","resolveUrl","url","trimmed","trim","isHttpUrl","urlScheme","resolved","startsWith","request","path","options","sentToken","send","headers","authToken","undefined","Authorization","fetch","method","JSON","stringify","error","response","skipReauth","refreshed","ok","json","catch","getConfig","platform","query","encodeURIComponent","getOutboundMessage","init","params","visitorToken","resumeToken","user","email","phone","userId","user_id","userHash","user_hash","trackingVisitorId","sdkVersion","logout","sendMessage","data","listConversations","listMessages","conversationId","cursor","markConversationRead","identify","sendTyping","isTyping","trackEvent","registerPushToken","removePushToken","auth"],"sourceRoot":"../../../src","sources":["api/client.ts"],"mappings":";;;;;;;AAUA,IAAAA,QAAA,GAAAC,OAAA;AAWA,IAAAC,QAAA,GAAAD,OAAA;AArBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA,MAAME,cAAc,GAAG,IAAIC,GAAG,CAAuB,CACnD,wBAAwB,EACxB,8BAA8B,CAC/B,CAAC;AAEK,SAASC,mBAAmBA,CAACC,IAA+B,EAAW;EAC5E,OAAO,CAAC,CAACA,IAAI,IAAIH,cAAc,CAACI,GAAG,CAACD,IAA4B,CAAC;AACnE;AAEO,MAAME,gBAAgB,SAASC,KAAK,CAAC;EAK1CC,WAAWA,CAACC,OAAe,EAAEC,MAAc,EAAEN,IAA0B,GAAG,MAAM,EAAE;IAChF,KAAK,CAACK,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,kBAAkB;IAC9B,IAAI,CAACD,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACN,IAAI,GAAGA,IAAI;EAClB;;EAEA;EACA,OAAOQ,YAAYA,CAACF,MAAc,EAAEG,IAAa,EAAoB;IACnE,MAAMC,OAAO,GAAID,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAG,CAAC,CAG3D;IACD,MAAMJ,OAAO,GAAG,OAAOK,OAAO,CAACL,OAAO,KAAK,QAAQ,IAAIK,OAAO,CAACL,OAAO,GAAGK,OAAO,CAACL,OAAO,GAAG,IAAI;IAC/F,MAAML,IAAI,GACRM,MAAM,KAAK,GAAG,IAAI,OAAOI,OAAO,CAACV,IAAI,KAAK,QAAQ,IAAID,mBAAmB,CAACW,OAAO,CAACV,IAAI,CAAC,GAClFU,OAAO,CAACV,IAAI,GACb,MAAM;IACZ,OAAO,IAAIE,gBAAgB,CAACG,OAAO,IAAI,QAAQC,MAAM,EAAE,EAAEA,MAAM,EAAEN,IAAI,CAAC;EACxE;AACF;AAACW,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