@redacto.io/consent-sdk-react-native 3.0.1-beta.0 → 4.0.0-beta.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 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
- | Peer | Required for | Notes |
25
- | -------------------------- | --------------------------- | ------------------------------------------------------ |
26
- | `react` | All | `^18 \|\| ^19` |
27
- | `react-native` | All | `>=0.72` |
28
- | `react-native-svg` | All | `>=13` |
29
- | `expo-audio` | Notice TTS playback | Optional. Required to enable text-to-speech audio |
30
- | `@tanstack/react-query` | Privacy Center | Optional. Required for `/privacy-center` imports |
31
- | `i18next`, `react-i18next` | Privacy Center | Optional. Required for `/privacy-center` imports |
32
- | `dayjs` | Privacy Center | Optional. Required for `/privacy-center` imports |
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 @tanstack/react-query i18next react-i18next dayjs
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
- To enable TTS audio in the consent notice, install `expo-audio`:
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 expo-audio
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`. Install both peers when using Privacy Center:
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`.