Skip to content

docs: document getSecureCredentials error code 21 - #112

Merged
riderx merged 2 commits into
mainfrom
cursor/document-getsecurecredentials-error-21-bdd9
Aug 14, 2026
Merged

docs: document getSecureCredentials error code 21#112
riderx merged 2 commits into
mainfrom
cursor/document-getsecurecredentials-error-21-bdd9

Conversation

@riderx

@riderx riderx commented Aug 13, 2026

Copy link
Copy Markdown
Member

What

  • Document error code 21 (NO_PROTECTED_CREDENTIALS_FOUND) for getSecureCredentials() when no biometric-protected credentials exist for the requested server
  • Add BiometricAuthError.NO_PROTECTED_CREDENTIALS_FOUND to the TypeScript enum so consumers can reference the code in app logic
  • Expand README Biometric Auth Errors table and getSecureCredentials() API docs with platform-specific rejection messages

Fixes #108

Why

  • Callers of getSecureCredentials() can receive rejection code 21 when credentials were never stored with biometric protection, were deleted, or were invalidated (for example after biometric enrollment changes)
  • This behavior is stable and expected, but was undocumented — making it hard for TypeScript consumers to handle intentionally

How

  • Added code 21 to the manual README error table with Android/iOS message differences:
    • Android: No protected credentials found
    • iOS: No protected credentials found for server
  • Added NO_PROTECTED_CREDENTIALS_FOUND = 21 to BiometricAuthError in src/definitions.ts
  • Documented the rejection in getSecureCredentials() JSDoc and regenerated API docs via bun run docgen

Testing

  • bun run build
  • bun run lint

Not Tested

  • No runtime changes; native behavior unchanged. No new unit tests added (repo does not currently test plugin error codes this way).
Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added a biometric authentication error for cases where no protected credentials or data are available.
    • Added platform-specific error messaging and guidance for handling missing secure credentials.
    • Clarified that secure credential retrieval rejects with the new error when no protected data exists.
    • Added the new error code to the public biometric authentication error reference.
  • Documentation

    • Expanded authentication and secure credential retrieval documentation, including behavior and secure recovery guidance.

Document NO_PROTECTED_CREDENTIALS_FOUND (21) in README and BiometricAuthError
enum. Covers platform-specific rejection messages for missing protected
credentials on getSecureCredentials.

Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4829045e-5c71-49b0-8007-216ba5876e64

📥 Commits

Reviewing files that changed from the base of the PR and between 5c285fc and 97e002c.

📒 Files selected for processing (2)
  • README.md
  • src/definitions.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

📝 Walkthrough

Walkthrough

The plugin now documents biometric error code 21 for missing protected credentials or data. The public error enum includes NO_PROTECTED_CREDENTIALS_FOUND = 21, with platform-specific messages and guidance for getSecureCredentials() handling.

Changes

Secure retrieval error contract

Layer / File(s) Summary
Error contract
src/definitions.ts
Added NO_PROTECTED_CREDENTIALS_FOUND = 21 and documented its rejection payloads, triggering conditions, platform messages, and availability.
Secure retrieval documentation
README.md, src/definitions.ts
Documented error code 21 for getSecureCredentials() and getSecureData(), including storage scenarios and isCredentialsSaved() limitations.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Mergeability Score: ⚪ Minimal · up to 97e00

This localized documentation and enum update does not introduce an actionable merge-blocking risk; it is merge-ready after normal checks and review.

Possibly related PRs

Suggested reviewers: cursoragent

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: documenting error code 21 for getSecureCredentials.
Linked Issues check ✅ Passed The changes document error code 21, its iOS and Android messages, triggering scenarios, and getSecureCredentials behavior as requested in issue #108.
Out of Scope Changes check ✅ Passed The README and enum updates directly support issue #108, and no unrelated runtime changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@github-actions

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-112 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.

@riderx
riderx marked this pull request as ready for review August 13, 2026 12:55

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread README.md Outdated
Comment thread src/definitions.ts
- Note that isCredentialsSaved/isDataSaved cover unprotected storage too
- Document getSecureData() alongside getSecureCredentials() for error 21

Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
@riderx
riderx merged commit 0036a71 into main Aug 14, 2026
10 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.

docs: document error code 21 No Credentials found for server on iOS and Android

2 participants