@explorins/pers-sdk-react-native 1.5.30 → 1.5.31
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 +9 -0
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/providers/PersSDKProvider.js +1 -2
- package/dist/providers/react-native-auth-provider.d.ts.map +1 -1
- package/dist/providers/react-native-auth-provider.js +4 -0
- package/package.json +1 -1
- package/src/providers/PersSDKProvider.tsx +3 -3
- package/src/providers/react-native-auth-provider.ts +5 -0
package/README.md
CHANGED
|
@@ -398,6 +398,15 @@ The `PersSDKProvider` accepts a `config` object allowing you to customize behavi
|
|
|
398
398
|
</PersSDKProvider>
|
|
399
399
|
```
|
|
400
400
|
|
|
401
|
+
### Storage Fallback Strategy
|
|
402
|
+
|
|
403
|
+
The SDK implements a robust **Hybrid Storage Strategy**:
|
|
404
|
+
1. **Primary**: Attempts to use **Android Keystore / iOS Keychain** (via `react-native-keychain`) for maximum security.
|
|
405
|
+
2. **Fallback**: If hardware storage is unavailable or fails, it automatically falls back to **AsyncStorage**.
|
|
406
|
+
3. **Web**: Uses `localStorage` automatically.
|
|
407
|
+
|
|
408
|
+
This ensures your app works reliably across all devices while prioritizing security where available.
|
|
409
|
+
|
|
401
410
|
### Custom Authentication Provider
|
|
402
411
|
|
|
403
412
|
The SDK automatically uses `ReactNativeSecureStorage` for React Native (iOS/Android) and `LocalStorageTokenStorage` for Web. You can customize this if needed:
|
package/dist/index.js
CHANGED
|
@@ -32225,6 +32225,10 @@ function createReactNativeAuthProvider(projectKey, config = {}) {
|
|
|
32225
32225
|
enabled: dpop.enabled ?? true,
|
|
32226
32226
|
cryptoProvider: dpop.cryptoProvider
|
|
32227
32227
|
} : undefined;
|
|
32228
|
+
// DEBUG LOGGING
|
|
32229
|
+
if (debug) {
|
|
32230
|
+
console.log('[ReactNativeAuthProvider] Creating provider with DPoP config:', JSON.stringify(dpopConfig));
|
|
32231
|
+
}
|
|
32228
32232
|
// Return DefaultAuthProvider configured with platform-appropriate storage
|
|
32229
32233
|
return new DefaultAuthProvider({
|
|
32230
32234
|
authType,
|
|
@@ -32554,8 +32558,7 @@ const PersSDKProvider = ({ children, config }) => {
|
|
|
32554
32558
|
try {
|
|
32555
32559
|
// Create HTTP client
|
|
32556
32560
|
const httpClient = new ReactNativeHttpClient();
|
|
32557
|
-
|
|
32558
|
-
const dpopConfig = config.dpop || {};
|
|
32561
|
+
const dpopConfig = config.dpop ?? {};
|
|
32559
32562
|
const isDpopEnabled = dpopConfig.enabled ?? true;
|
|
32560
32563
|
// Prepare DPoP settings for Auth Provider
|
|
32561
32564
|
const dpopSettings = {
|