Skip to content

Commit abd5d4e

Browse files
committed
Revamp README with improved structure and tips
Enhanced the README with new section icons, improved table of contents, and added helpful tips and notes for users. Updated section headers for clarity, included usage tips, and provided additional guidance for simulators, Expo, and development workflows.
1 parent f7d80fd commit abd5d4e

1 file changed

Lines changed: 56 additions & 30 deletions

File tree

README.md

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,40 @@
66

77
Modern secure storage for React Native, powered by Nitro Modules. Version 6 ships a new headless API surface, stronger security defaults, and a fully revamped example app.
88

9+
> [!TIP]
10+
> Need the TL;DR? Jump to [🚀 Highlights](#-highlights) and [⚙️ Installation](#-installation) to get productive in under five minutes.
11+
912
> [!WARNING]
1013
> Version 6 drops Windows support. The module now targets iOS and Android only.
1114
1215
## Table of contents
1316

14-
- [Highlights](#highlights)
15-
- [Platform support](#platform-support)
16-
- [Installation](#installation)
17-
- [Quick start](#quick-start)
18-
- [API reference](#api-reference)
19-
- [Access control & metadata](#access-control--metadata)
20-
- [Simulators and emulators](#simulators-and-emulators)
21-
- [Performance benchmarks](#performance-benchmarks)
22-
- [Example application](#example-application)
23-
- [Development](#development)
24-
- [Troubleshooting](#troubleshooting)
25-
- [Contributing](#contributing)
26-
- [License](#license)
27-
28-
## Highlights
17+
- [🚀 Highlights](#-highlights)
18+
- [🧭 Platform support](#-platform-support)
19+
- [⚙️ Installation](#-installation)
20+
- [⚡️ Quick start](#-quick-start)
21+
- [📚 API reference](#-api-reference)
22+
- [🔐 Access control & metadata](#-access-control--metadata)
23+
- [🧪 Simulators and emulators](#-simulators-and-emulators)
24+
- [📈 Performance benchmarks](#-performance-benchmarks)
25+
- [🎮 Example application](#-example-application)
26+
- [🛠️ Development](#-development)
27+
- [🩺 Troubleshooting](#-troubleshooting)
28+
- [🤝 Contributing](#-contributing)
29+
- [📄 License](#-license)
30+
31+
## 🚀 Highlights
2932

3033
- Headless Nitro hybrid object with a simple Promise-based API (`setItem`, `getItem`, `hasItem`, `getAllItems`, `clearService`).
3134
- Automatic security negotiation: prefers Secure Enclave (iOS) or StrongBox/biometric-protected keys (Android) with graceful fallbacks.
3235
- Unified metadata reporting (security level, backend, access control, timestamp) for every stored secret.
3336
- Friendly example app showcasing prompts, metadata inspection, and per-platform capability detection.
3437
- First-class TypeScript definitions and tree-shakeable distribution via `react-native-builder-bob`.
3538

36-
## Platform support
39+
> [!NOTE]
40+
> All APIs are fully typed. Hover over any option in your editor to explore the metadata surface without leaving VS Code.
41+
42+
## 🧭 Platform support
3743

3844
| Platform | Minimum OS | Notes |
3945
| --- | --- | --- |
@@ -46,7 +52,10 @@ Modern secure storage for React Native, powered by Nitro Modules. Version 6 ship
4652
- Node.js `18` or newer.
4753
- `react-native-nitro-modules` `>=0.30.0`.
4854

49-
## Installation
55+
> [!TIP]
56+
> Pair this module with [`react-native-quick-crypto`](https://github.com/mCodex/react-native-quick-crypto) when you need high-performance hashing alongside secure storage.
57+
58+
## ⚙️ Installation
5059

5160
```bash
5261
# with npm
@@ -61,7 +70,7 @@ pnpm add react-native-sensitive-info react-native-nitro-modules
6170

6271
No manual linking is required. Nitro handles platform registration via autolinking.
6372

64-
### iOS setup
73+
### 🍏 iOS setup
6574

6675
- Install pods from the root of your project:
6776

@@ -76,7 +85,7 @@ No manual linking is required. Nitro handles platform registration via autolinki
7685
<string>Face ID is used to unlock secrets stored in the secure enclave.</string>
7786
```
7887

79-
### Android setup
88+
### 🤖 Android setup
8089

8190
- Ensure the following permissions are present in your `AndroidManifest.xml`:
8291

@@ -87,7 +96,10 @@ No manual linking is required. Nitro handles platform registration via autolinki
8796

8897
- If you rely on hardware-backed keystores, verify the device/emulator supports the biometrics you request.
8998

90-
## Quick start
99+
> [!TIP]
100+
> Use `includeValue: false` during reads when you only care about metadata—this keeps plaintext out of memory and speeds up list views.
101+
102+
## ⚡️ Quick start
91103

92104
```tsx
93105
import React, { useEffect } from 'react'
@@ -123,7 +135,7 @@ export function SecureTokenExample() {
123135
void SensitiveInfo.clearService({ service: 'auth' })
124136
```
125137

126-
## API reference
138+
## 📚 API reference
127139

128140
All functions live at the top level export and return Promises.
129141

@@ -137,7 +149,7 @@ All functions live at the top level export and return Promises.
137149
| `clearService` | `(options?) => Promise<void>` | Removes every secret within a service namespace. |
138150
| `getSupportedSecurityLevels` | `() => Promise<SecurityAvailability>` | Returns a snapshot of platform capabilities (secure enclave, biometrics, etc.). |
139151

140-
### Options shared by all operations
152+
### 🧩 Options shared by all operations
141153

142154
- `service` (default: bundle identifier or `default`) — logical namespace for secrets.
143155
- `accessControl` (default: `secureEnclaveBiometry`) — preferred policy; the native layer chooses the strongest supported fallback.
@@ -148,7 +160,7 @@ All functions live at the top level export and return Promises.
148160

149161
See `src/views/sensitive-info.nitro.ts` for full TypeScript definitions.
150162

151-
## Access control & metadata
163+
## 🔐 Access control & metadata
152164

153165
`MutationResult` and `SensitiveInfoItem.metadata` surface how a value was stored:
154166

@@ -159,17 +171,28 @@ See `src/views/sensitive-info.nitro.ts` for full TypeScript definitions.
159171

160172
Use `getSupportedSecurityLevels()` to tailor UX before prompting users. For example, disable Secure Enclave options on simulators.
161173

162-
## Simulators and emulators
174+
> [!TIP]
175+
> Need to demo biometrics on a simulator? Use Xcode’s “Features → Face ID” and Android Studio’s “Fingerprints” toggles to simulate successful scans.
176+
177+
## 🧪 Simulators and emulators
163178

164179
- iOS simulators do not offer Secure Enclave hardware. Biometric prompts usually fall back to a passcode dialog.
165180
- Android emulators rarely provide StrongBox. Depending on the system image, biometric APIs may be stubbed.
166181
- The example app displays these limitations prominently under “Simulators & emulators”.
167182

183+
> [!IMPORTANT]
184+
> Simulators are great for flows, but only physical hardware validates secure hardware policies such as StrongBox and Secure Enclave. Run your final regression tests on devices before shipping.
185+
168186
Always validate security behavior on the physical devices you ship to customers.
169187

170-
## Example application
188+
## 🎮 Example application
189+
190+
Explore the full feature set with the bundled example app. It showcases capability detection, metadata inspection, and error surface normalization for every API call.
171191

172-
## Performance benchmarks
192+
> [!TIP]
193+
> Prefer Expo? The same Nitro module works inside bare Expo projects—just install via `expo install` and run the commands below from `example/`.
194+
195+
## 📈 Performance benchmarks
173196

174197
The Nitro rewrite in v6 removes the classic React Native bridge bottleneck that previous releases (v5 and earlier) relied on.
175198

@@ -202,7 +225,10 @@ yarn android
202225

203226
The example includes required permissions and the `NSFaceIDUsageDescription` string out of the box (see `example/android/app/src/main/AndroidManifest.xml` and `example/ios/SensitiveInfoExample/Info.plist`).
204227

205-
## Development
228+
> [!TIP]
229+
> Run `yarn codegen --watch` in one terminal and your platform build in another to regenerate bindings automatically during native development.
230+
231+
## 🛠️ Development
206232

207233
```bash
208234
# Install dependencies
@@ -220,17 +246,17 @@ yarn build
220246

221247
The project uses Nitrogen for code generation and `react-native-builder-bob` for packaging CommonJS/ESM bundles.
222248

223-
## Troubleshooting
249+
## 🩺 Troubleshooting
224250

225251
- **Biometric prompt never appears** — verify the device supports the requested access control. Fallback to `devicePasscode` where appropriate.
226252
- **`authentication failed` errors on simulator** — expected when Secure Enclave or biometrics are not available. Test on hardware.
227253
- **Undefined symbol on iOS** — ensure `pod install` was run after upgrading to v6.
228254
- **Windows build errors** — Windows is no longer supported. Pin to v5 if you must target that platform.
229255

230-
## Contributing
256+
## 🤝 Contributing
231257

232258
PRs and issue reports are welcome. Please open an issue before introducing breaking API changes so we can discuss the best upgrade path.
233259

234-
## License
260+
## 📄 License
235261

236262
MIT © [Mateus Andrade](https://github.com/mateusandrade)

0 commit comments

Comments
 (0)