Skip to content

feat: add generic key/value secure data API (closes #46) - #101

Merged
riderx merged 2 commits into
mainfrom
fix/issue-46-generic-secure-storage
Jul 4, 2026
Merged

feat: add generic key/value secure data API (closes #46)#101
riderx merged 2 commits into
mainfrom
fix/issue-46-generic-secure-storage

Conversation

@riderx

@riderx riderx commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds setData, getData, getSecureData, deleteData, and isDataSaved for arbitrary encrypted string payloads
  • Keeps existing credential helpers (setCredentials, etc.) fully backward compatible
  • Reuses the same Android Keystore / iOS Keychain backends; biometric-protected values use accessControl + getSecureData()

Usage

// Store a PIN or any string (serialize objects with JSON.stringify)
await NativeBiometric.setData({ key: 'user-pin', value: '1234' });

// Read back (no biometric prompt)
const { value } = await NativeBiometric.getData({ key: 'user-pin' });

// Biometric-protected storage
await NativeBiometric.setData({
  key: 'session-token',
  value: token,
  accessControl: AccessControl.BIOMETRY_ANY,
});
const { value: secureToken } = await NativeBiometric.getSecureData({
  key: 'session-token',
  reason: 'Unlock your session',
});

Closes #46

Test plan

  • bun run verify (iOS Swift build, Android Gradle test+lint, web bundle)
  • Manual: store/read/delete a PIN via setData/getData on device
  • Manual: store/read protected value via setData + getSecureData with biometrics

Made with Cursor

Introduces setData, getData, getSecureData, deleteData, and isDataSaved so arbitrary encrypted payloads (e.g. PIN codes) no longer need to be modeled as server credentials.

Closes #46

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 380360ff-269f-4a60-b4cb-58330b3b9102

📥 Commits

Reviewing files that changed from the base of the PR and between 0624da7 and 3060c81.

📒 Files selected for processing (6)
  • README.md
  • android/src/main/java/ee/forgr/biometric/AuthActivity.java
  • android/src/main/java/ee/forgr/biometric/NativeBiometric.java
  • ios/Sources/NativeBiometricPlugin/NativeBiometricPlugin.swift
  • src/definitions.ts
  • src/web.ts

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Beta npm build

Maintainers can publish this PR to npm for fast testing.

Comment /publish-beta after the PR checks are green.

The workflow will:

  • publish a prerelease package on the beta tag
  • add a pinned pr-101 dist-tag for this exact PR build
  • update this comment with the install command

Security note: beta publish is only enabled for branches inside this repository.

Co-authored-by: Cursor <cursoragent@cursor.com>
@riderx
riderx marked this pull request as ready for review July 3, 2026 13:33
@riderx

riderx commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@riderx
riderx merged commit 6cf21e4 into main Jul 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow more generic way for securely storing data

1 participant