@redacto.io/consent-sdk-react-native 3.0.0 → 3.1.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 +47 -16
- package/dist/privacy-center.js +994 -816
- package/dist/privacy-center.mjs +901 -715
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -21,28 +21,49 @@ pnpm add @redacto.io/consent-sdk-react-native react-native-svg
|
|
|
21
21
|
|
|
22
22
|
### Peer Dependencies
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
|
|
34
|
-
If you only use the consent notice components, install just the SDK + `react-native-svg`. If you use the Privacy Center, install the optional peers as well:
|
|
24
|
+
Install peers based on which SDK entry point you use.
|
|
25
|
+
|
|
26
|
+
#### Consent notice only (`@redacto.io/consent-sdk-react-native`)
|
|
27
|
+
|
|
28
|
+
| Peer | Required | Version | Notes |
|
|
29
|
+
| ------------------ | -------- | ------------ | ----------------------------------------------- |
|
|
30
|
+
| `react` | Yes | `^18 \|\| ^19` | |
|
|
31
|
+
| `react-native` | Yes | `>=0.72` | |
|
|
32
|
+
| `react-native-svg` | Yes | `>=13` | Must be linked for native builds |
|
|
33
|
+
| `expo-audio` | No | `>=0.4.0` | Enables TTS playback in the consent notice |
|
|
35
34
|
|
|
36
35
|
```sh
|
|
37
|
-
pnpm add @
|
|
36
|
+
pnpm add @redacto.io/consent-sdk-react-native react-native-svg
|
|
37
|
+
pnpm add expo-audio # optional, for TTS
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
#### Privacy Center (`@redacto.io/consent-sdk-react-native/privacy-center`)
|
|
41
|
+
|
|
42
|
+
Install **all notice peers above**, plus:
|
|
43
|
+
|
|
44
|
+
| Peer | Required | Version | Used for |
|
|
45
|
+
| ----------------------------------------- | -------- | ------------ | --------------------------------------------- |
|
|
46
|
+
| `@tanstack/react-query` | Yes | `^5.0.0` | Data fetching hooks |
|
|
47
|
+
| `i18next` | Yes | `^23.0.0` | Translations |
|
|
48
|
+
| `react-i18next` | Yes | `^13.0.0` | Translations |
|
|
49
|
+
| `dayjs` | Yes | `^1.11.0` | Date formatting |
|
|
50
|
+
| `expo-file-system` | Yes* | `>=16.0.0` | Receipt PDF download |
|
|
51
|
+
| `expo-sharing` | Yes* | `>=11.0.0` | Receipt PDF share sheet |
|
|
52
|
+
| `expo-document-picker` | Yes* | `>=11.0.0` | Case / form document uploads |
|
|
53
|
+
| `@react-native-community/datetimepicker` | Yes* | `>=7.0.0` | Receipt date filters |
|
|
54
|
+
|
|
55
|
+
\*Required for the corresponding Privacy Center feature. Without them the SDK shows a friendly alert instead of crashing, but that feature will not work.
|
|
41
56
|
|
|
42
57
|
```sh
|
|
43
|
-
pnpm add
|
|
58
|
+
pnpm add @tanstack/react-query i18next react-i18next dayjs \
|
|
59
|
+
expo-file-system expo-sharing expo-document-picker \
|
|
60
|
+
@react-native-community/datetimepicker
|
|
44
61
|
```
|
|
45
62
|
|
|
63
|
+
> **Expo native modules:** `expo-file-system`, `expo-sharing`, `expo-document-picker`, and `@react-native-community/datetimepicker` include native code. After installing them, rebuild your dev client — e.g. `npx expo run:ios` or `npx expo run:android`. A Metro reload alone is not enough.
|
|
64
|
+
|
|
65
|
+
> **Note:** `react-native-svg` must be linked for native builds. Follow the [react-native-svg setup guide](https://github.com/software-mansion/react-native-svg#installation).
|
|
66
|
+
|
|
46
67
|
## Backend Server Setup
|
|
47
68
|
|
|
48
69
|
The SDK never talks to Redacto with your CMS API key directly — your backend acts as a token broker. Obtain your **CMS-API-Key** from the Redacto Dashboard, store it in your backend's environment, and expose two endpoints to your mobile app:
|
|
@@ -172,7 +193,7 @@ The Privacy Center is a separate entry point (`@redacto.io/consent-sdk-react-nat
|
|
|
172
193
|
|
|
173
194
|
### Certified UI
|
|
174
195
|
|
|
175
|
-
`RedactoPrivacyCenter` renders the full Privacy Center experience with built-in navigation, auth, theming, and
|
|
196
|
+
`RedactoPrivacyCenter` renders the full Privacy Center experience with built-in navigation, auth, theming, i18n, and an internal `QueryClientProvider`. You do **not** need to wrap it in your own React Query provider.
|
|
176
197
|
|
|
177
198
|
```tsx
|
|
178
199
|
import { RedactoPrivacyCenter } from "@redacto.io/consent-sdk-react-native/privacy-center";
|
|
@@ -220,7 +241,17 @@ If you want to compose your own shell, import the screen-level building blocks i
|
|
|
220
241
|
| `BottomTabBar` | Bottom tab navigation |
|
|
221
242
|
| `Footer` | Footer block |
|
|
222
243
|
|
|
223
|
-
These rely on the context providers (`AuthProvider`, `BaseUrlProvider`, `NavigationProvider`, `ThemeProvider`) — wrap them yourself if you compose the pages directly.
|
|
244
|
+
These rely on the context providers (`AuthProvider`, `BaseUrlProvider`, `NavigationProvider`, `ThemeProvider`, and `QueryClientProvider` for React Query hooks) — wrap them yourself if you compose the pages directly.
|
|
245
|
+
|
|
246
|
+
### Receipt downloads
|
|
247
|
+
|
|
248
|
+
The **My Receipt** screen downloads PDFs via `expo-file-system` and opens the native share sheet via `expo-sharing`. Both are listed in the [Privacy Center peer dependencies](#privacy-center-redactoioconsent-sdk-react-nativeprivacy-center) above.
|
|
249
|
+
|
|
250
|
+
On Expo SDK 52+, the SDK uses the `expo-file-system/legacy` entry automatically; older Expo versions fall back to the main `expo-file-system` export.
|
|
251
|
+
|
|
252
|
+
### Document uploads
|
|
253
|
+
|
|
254
|
+
Case messaging and privacy request forms use `expo-document-picker` for supporting-document uploads. Install it as shown in the Privacy Center peer dependency list above.
|
|
224
255
|
|
|
225
256
|
### UI Primitives
|
|
226
257
|
|