@repzo/widget-react-native 1.0.0 → 1.0.4
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 +167 -74
- package/lib/commonjs/api/client.js +3 -1
- package/lib/commonjs/api/client.js.map +1 -1
- package/lib/commonjs/api/realtime.js +2 -0
- package/lib/commonjs/api/realtime.js.map +1 -1
- package/lib/commonjs/attachments/pickers.js +493 -0
- package/lib/commonjs/attachments/pickers.js.map +1 -0
- package/lib/commonjs/i18n.js +45 -0
- package/lib/commonjs/i18n.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/locales.js +21 -0
- package/lib/commonjs/locales.js.map +1 -1
- package/lib/commonjs/state/widget-store.js +256 -18
- package/lib/commonjs/state/widget-store.js.map +1 -1
- package/lib/commonjs/types.js +16 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/ui/WidgetProvider.js +70 -10
- package/lib/commonjs/ui/WidgetProvider.js.map +1 -1
- package/lib/commonjs/ui/components/AttachmentChips.js +135 -0
- package/lib/commonjs/ui/components/AttachmentChips.js.map +1 -0
- package/lib/commonjs/ui/components/AttachmentMenu.js +125 -0
- package/lib/commonjs/ui/components/AttachmentMenu.js.map +1 -0
- package/lib/commonjs/ui/components/ImageViewer.js +181 -0
- package/lib/commonjs/ui/components/ImageViewer.js.map +1 -0
- package/lib/commonjs/ui/components/InAppNotification.js +210 -0
- package/lib/commonjs/ui/components/InAppNotification.js.map +1 -0
- package/lib/commonjs/ui/components/TeamAvatars.js +63 -0
- package/lib/commonjs/ui/components/TeamAvatars.js.map +1 -0
- package/lib/commonjs/ui/components/icons.js +50 -0
- package/lib/commonjs/ui/components/icons.js.map +1 -1
- package/lib/commonjs/ui/screens/chat/ChatView.js +303 -24
- package/lib/commonjs/ui/screens/chat/ChatView.js.map +1 -1
- package/lib/commonjs/ui/screens/chat/ChatView.styles.js +70 -0
- package/lib/commonjs/ui/screens/chat/ChatView.styles.js.map +1 -1
- package/lib/module/api/client.js +3 -1
- package/lib/module/api/client.js.map +1 -1
- package/lib/module/api/realtime.js +2 -0
- package/lib/module/api/realtime.js.map +1 -1
- package/lib/module/attachments/pickers.js +479 -0
- package/lib/module/attachments/pickers.js.map +1 -0
- package/lib/module/i18n.js +44 -0
- package/lib/module/i18n.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/locales.js +21 -0
- package/lib/module/locales.js.map +1 -1
- package/lib/module/state/widget-store.js +256 -18
- package/lib/module/state/widget-store.js.map +1 -1
- package/lib/module/types.js +16 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/ui/WidgetProvider.js +71 -11
- package/lib/module/ui/WidgetProvider.js.map +1 -1
- package/lib/module/ui/components/AttachmentChips.js +131 -0
- package/lib/module/ui/components/AttachmentChips.js.map +1 -0
- package/lib/module/ui/components/AttachmentMenu.js +120 -0
- package/lib/module/ui/components/AttachmentMenu.js.map +1 -0
- package/lib/module/ui/components/ImageViewer.js +177 -0
- package/lib/module/ui/components/ImageViewer.js.map +1 -0
- package/lib/module/ui/components/InAppNotification.js +208 -0
- package/lib/module/ui/components/InAppNotification.js.map +1 -0
- package/lib/module/ui/components/TeamAvatars.js +59 -0
- package/lib/module/ui/components/TeamAvatars.js.map +1 -0
- package/lib/module/ui/components/icons.js +49 -0
- package/lib/module/ui/components/icons.js.map +1 -1
- package/lib/module/ui/screens/chat/ChatView.js +306 -27
- package/lib/module/ui/screens/chat/ChatView.js.map +1 -1
- package/lib/module/ui/screens/chat/ChatView.styles.js +70 -0
- package/lib/module/ui/screens/chat/ChatView.styles.js.map +1 -1
- package/lib/typescript/commonjs/api/client.d.ts +8 -2
- package/lib/typescript/commonjs/api/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/api/realtime.d.ts.map +1 -1
- package/lib/typescript/commonjs/attachments/pickers.d.ts +81 -0
- package/lib/typescript/commonjs/attachments/pickers.d.ts.map +1 -0
- package/lib/typescript/commonjs/i18n.d.ts +23 -0
- package/lib/typescript/commonjs/i18n.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/locales.d.ts.map +1 -1
- package/lib/typescript/commonjs/state/widget-store.d.ts +40 -2
- package/lib/typescript/commonjs/state/widget-store.d.ts.map +1 -1
- package/lib/typescript/commonjs/types.d.ts +88 -1
- package/lib/typescript/commonjs/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/WidgetProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AttachmentChips.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/AttachmentChips.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/AttachmentMenu.d.ts +28 -0
- package/lib/typescript/commonjs/ui/components/AttachmentMenu.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ImageViewer.d.ts +23 -0
- package/lib/typescript/commonjs/ui/components/ImageViewer.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/InAppNotification.d.ts +28 -0
- package/lib/typescript/commonjs/ui/components/InAppNotification.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/TeamAvatars.d.ts +17 -0
- package/lib/typescript/commonjs/ui/components/TeamAvatars.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/icons.d.ts +2 -0
- package/lib/typescript/commonjs/ui/components/icons.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts +3 -2
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.styles.d.ts +69 -0
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts +41 -2
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts.map +1 -1
- package/lib/typescript/module/api/client.d.ts +8 -2
- package/lib/typescript/module/api/client.d.ts.map +1 -1
- package/lib/typescript/module/api/realtime.d.ts.map +1 -1
- package/lib/typescript/module/attachments/pickers.d.ts +81 -0
- package/lib/typescript/module/attachments/pickers.d.ts.map +1 -0
- package/lib/typescript/module/i18n.d.ts +23 -0
- package/lib/typescript/module/i18n.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/locales.d.ts.map +1 -1
- package/lib/typescript/module/state/widget-store.d.ts +40 -2
- package/lib/typescript/module/state/widget-store.d.ts.map +1 -1
- package/lib/typescript/module/types.d.ts +88 -1
- package/lib/typescript/module/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/WidgetProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AttachmentChips.d.ts +16 -0
- package/lib/typescript/module/ui/components/AttachmentChips.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/AttachmentMenu.d.ts +28 -0
- package/lib/typescript/module/ui/components/AttachmentMenu.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ImageViewer.d.ts +23 -0
- package/lib/typescript/module/ui/components/ImageViewer.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/InAppNotification.d.ts +28 -0
- package/lib/typescript/module/ui/components/InAppNotification.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/TeamAvatars.d.ts +17 -0
- package/lib/typescript/module/ui/components/TeamAvatars.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/icons.d.ts +2 -0
- package/lib/typescript/module/ui/components/icons.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/chat/ChatView.d.ts +3 -2
- package/lib/typescript/module/ui/screens/chat/ChatView.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/chat/ChatView.styles.d.ts +69 -0
- package/lib/typescript/module/ui/screens/chat/ChatView.styles.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts +41 -2
- package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts.map +1 -1
- package/metro.js +17 -32
- package/package.json +18 -1
- package/src/api/client.ts +5 -3
- package/src/api/realtime.ts +2 -0
- package/src/attachments/pickers.ts +515 -0
- package/src/i18n.ts +48 -0
- package/src/index.tsx +4 -0
- package/src/locales.ts +21 -0
- package/src/state/widget-store.ts +256 -19
- package/src/types.ts +95 -0
- package/src/ui/WidgetProvider.tsx +90 -9
- package/src/ui/components/AttachmentChips.tsx +135 -0
- package/src/ui/components/AttachmentMenu.tsx +132 -0
- package/src/ui/components/ImageViewer.tsx +178 -0
- package/src/ui/components/InAppNotification.tsx +225 -0
- package/src/ui/components/TeamAvatars.tsx +58 -0
- package/src/ui/components/icons.tsx +37 -0
- package/src/ui/screens/chat/ChatView.styles.ts +70 -0
- package/src/ui/screens/chat/ChatView.tsx +345 -35
- package/src/ui/screens/chat/ChatView.types.ts +51 -2
package/README.md
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
# @repzo/widget-react-native
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@repzo/widget-react-native)
|
|
4
|
+
[](https://www.npmjs.com/package/@repzo/widget-react-native)
|
|
5
|
+
[](https://www.npmjs.com/package/@repzo/widget-react-native)
|
|
6
|
+

|
|
7
|
+

|
|
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
|
|
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
|
|
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
|
-
|
|
40
|
-
|
|
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
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
|
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(
|
|
75
|
-
// Your existing config.
|
|
76
|
-
}));
|
|
109
|
+
module.exports = withRepzoWidget(yourMetroConfig);
|
|
77
110
|
```
|
|
78
111
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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.
|
|
123
|
-
|
|
124
|
-
`
|
|
125
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
438
|
-
|
|
439
|
-
|
|
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.
|
|
@@ -206,7 +206,9 @@ class WidgetApiClient {
|
|
|
206
206
|
return this.request('/api/widget/conversations');
|
|
207
207
|
}
|
|
208
208
|
listMessages(conversationId, cursor) {
|
|
209
|
-
|
|
209
|
+
// includeDeleted: get a content-free placeholder where a teammate deleted a
|
|
210
|
+
// message, so the thread can show "This message was deleted".
|
|
211
|
+
const query = `?includeDeleted=1${cursor ? `&cursor=${encodeURIComponent(cursor)}` : ''}`;
|
|
210
212
|
return this.request(`/api/widget/conversations/${encodeURIComponent(conversationId)}/messages${query}`);
|
|
211
213
|
}
|
|
212
214
|
|
|
@@ -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;
|
|
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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,CAAC;MACf,GAAG4E;IACL,CAAC,CAAC;EACJ;AACF;AAAChF,OAAA,CAAAC,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -21,6 +21,8 @@ var _sseParser = require("./sse-parser.js");
|
|
|
21
21
|
const SERVER_EVENTS = {
|
|
22
22
|
connected: 'connected',
|
|
23
23
|
'widget.message.new': 'message.new',
|
|
24
|
+
'widget.message.deleted': 'message.deleted',
|
|
25
|
+
'widget.message.status': 'message.status',
|
|
24
26
|
'widget.typing.start': 'typing.start',
|
|
25
27
|
'widget.typing.stop': 'typing.stop',
|
|
26
28
|
'widget.conversation.updated': 'conversation.updated',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_client","require","_sseParser","SERVER_EVENTS","connected","BASE_RECONNECT_MS","MAX_RECONNECT_MS","XHR_DONE","AUTH_ERROR_BODY_WAIT_MS","WidgetRealtime","source","reconnectTimer","attempt","closedByUs","url","token","handler","authHooks","authErrorTimer","connect","baseUrl","close","replace","open","XMLHttpRequest","offset","isCurrent","parser","SseParser","name","raw","Object","prototype","hasOwnProperty","call","payload","JSON","parse","reconnect","scheduleReconnect","read","readyState","complete","status","setTimeout","handleAuthError","responseText","text","chunk","slice","length","push","onreadystatechange","onprogress","onerror","ontimeout","onabort","timeout","setRequestHeader","send","rawBody","hooks","onUnauthorized","body","onForbidden","RepzoWidgetError","fromResponse","teardownSource","delay","Math","min","jittered","random","clearTimeout","abort","isConnected","exports"],"sourceRoot":"../../../src","sources":["api/realtime.ts"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA,MAAME,aAAa,GAAG;EACpBC,SAAS,EAAE,WAAW;EACtB,oBAAoB,EAAE,aAAa;EACnC,qBAAqB,EAAE,cAAc;EACrC,oBAAoB,EAAE,aAAa;EACnC,6BAA6B,EAAE,sBAAsB;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,CAAC,CAAC;IACb,CAAC,EAAEgD,QAAQ,CAAC;EACd;EAEQJ,cAAcA,CAAA,EAAS;IAC7B,MAAMzD,MAAM,GAAG,IAAI,CAACA,MAAM;IAC1B,IAAI,CAACA,MAAM,GAAG,IAAI;IAClB,IAAI,CAACN,SAAS,GAAG,KAAK;IACtB,IAAI,IAAI,CAACc,cAAc,EAAE;MACvBuD,YAAY,CAAC,IAAI,CAACvD,cAAc,CAAC;MACjC,IAAI,CAACA,cAAc,GAAG,IAAI;IAC5B;IACA,IAAI,CAACR,MAAM,EAAE;IACbA,MAAM,CAAC0C,kBAAkB,GAAG,IAAI;IAChC1C,MAAM,CAAC2C,UAAU,GAAG,IAAI;IACxB3C,MAAM,CAAC4C,OAAO,GAAG,IAAI;IACrB5C,MAAM,CAAC6C,SAAS,GAAG,IAAI;IACvB7C,MAAM,CAAC8C,OAAO,GAAG,IAAI;IACrB9C,MAAM,CAACgE,KAAK,CAAC,CAAC;EAChB;EAEA,IAAIC,WAAWA,CAAA,EAAY;IACzB;IACA;IACA,OAAO,IAAI,CAACjE,MAAM,KAAK,IAAI;EAC7B;EAEAW,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACR,UAAU,GAAG,IAAI;IACtB,IAAI,CAACD,OAAO,GAAG,CAAC;IAChB,IAAI,IAAI,CAACD,cAAc,EAAE;MACvB8D,YAAY,CAAC,IAAI,CAAC9D,cAAc,CAAC;MACjC,IAAI,CAACA,cAAc,GAAG,IAAI;IAC5B;IACA,IAAI,IAAI,CAACO,cAAc,EAAE;MACvBuD,YAAY,CAAC,IAAI,CAACvD,cAAc,CAAC;MACjC,IAAI,CAACA,cAAc,GAAG,IAAI;IAC5B;IACA,IAAI,CAACiD,cAAc,CAAC,CAAC;EACvB;AACF;AAACS,OAAA,CAAAnE,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_client","require","_sseParser","SERVER_EVENTS","connected","BASE_RECONNECT_MS","MAX_RECONNECT_MS","XHR_DONE","AUTH_ERROR_BODY_WAIT_MS","WidgetRealtime","source","reconnectTimer","attempt","closedByUs","url","token","handler","authHooks","authErrorTimer","connect","baseUrl","close","replace","open","XMLHttpRequest","offset","isCurrent","parser","SseParser","name","raw","Object","prototype","hasOwnProperty","call","payload","JSON","parse","reconnect","scheduleReconnect","read","readyState","complete","status","setTimeout","handleAuthError","responseText","text","chunk","slice","length","push","onreadystatechange","onprogress","onerror","ontimeout","onabort","timeout","setRequestHeader","send","rawBody","hooks","onUnauthorized","body","onForbidden","RepzoWidgetError","fromResponse","teardownSource","delay","Math","min","jittered","random","clearTimeout","abort","isConnected","exports"],"sourceRoot":"../../../src","sources":["api/realtime.ts"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA,MAAME,aAAa,GAAG;EACpBC,SAAS,EAAE,WAAW;EACtB,oBAAoB,EAAE,aAAa;EACnC,wBAAwB,EAAE,iBAAiB;EAC3C,uBAAuB,EAAE,gBAAgB;EACzC,qBAAqB,EAAE,cAAc;EACrC,oBAAoB,EAAE,aAAa;EACnC,6BAA6B,EAAE,sBAAsB;EACrD,2BAA2B,EAAE;AAC/B,CAAU;AAIV,MAAMC,iBAAiB,GAAG,KAAK;AAC/B,MAAMC,gBAAgB,GAAG,MAAM;AAC/B;AACA,MAAMC,QAAQ,GAAG,CAAC;AAClB;AACA,MAAMC,uBAAuB,GAAG,KAAK;AAW9B,MAAMC,cAAc,CAAC;EAClBC,MAAM,GAA0B,IAAI;EAEpCN,SAAS,GAAG,KAAK;EAEjBO,cAAc,GAAyC,IAAI;EAE3DC,OAAO,GAAG,CAAC;EAEXC,UAAU,GAAG,KAAK;EAElBC,GAAG,GAAkB,IAAI;EAEzBC,KAAK,GAAkB,IAAI;EAE3BC,OAAO,GAA2B,IAAI;EAEtCC,SAAS,GAA6B,IAAI;EAE1C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