@redacto.io/consent-sdk-react-native 3.0.1-beta.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 +40 -19
- package/package.json +5 -1
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:
|
|
@@ -224,14 +245,14 @@ These rely on the context providers (`AuthProvider`, `BaseUrlProvider`, `Navigat
|
|
|
224
245
|
|
|
225
246
|
### Receipt downloads
|
|
226
247
|
|
|
227
|
-
The **My Receipt** screen downloads PDFs via `expo-file-system` and opens the native share sheet via `expo-sharing`.
|
|
228
|
-
|
|
229
|
-
```sh
|
|
230
|
-
pnpm add expo-file-system expo-sharing
|
|
231
|
-
```
|
|
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.
|
|
232
249
|
|
|
233
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.
|
|
234
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.
|
|
255
|
+
|
|
235
256
|
### UI Primitives
|
|
236
257
|
|
|
237
258
|
For building custom screens that match Privacy Center styling, the package exports themed primitives: `PCButton`, `PCInput`, `PCSelect`, `PCModal`, `PCCheckbox`, `PCLoader`, `PCEmpty`, `PCBadge`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redacto.io/consent-sdk-react-native",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "React Native SDK for integrating Redacto consent notices and privacy center in mobile apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"consent",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"react-native": ">=0.72",
|
|
45
45
|
"react-native-svg": ">=13",
|
|
46
46
|
"expo-audio": ">=0.4.0",
|
|
47
|
+
"expo-document-picker": ">=11.0.0",
|
|
47
48
|
"expo-file-system": ">=16.0.0",
|
|
48
49
|
"expo-sharing": ">=11.0.0",
|
|
49
50
|
"@react-native-community/datetimepicker": ">=7.0.0",
|
|
@@ -56,6 +57,9 @@
|
|
|
56
57
|
"expo-audio": {
|
|
57
58
|
"optional": true
|
|
58
59
|
},
|
|
60
|
+
"expo-document-picker": {
|
|
61
|
+
"optional": true
|
|
62
|
+
},
|
|
59
63
|
"expo-file-system": {
|
|
60
64
|
"optional": true
|
|
61
65
|
},
|