npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@portal-hq/passkey-prf-storage

v6.0.1

Published

Portal's Passkey PRF storage adapter

Readme

@portal-hq/passkey-prf-storage

Portal's Passkey PRF storage adapter.

Backs up a wallet with a secret derived from a passkey through the WebAuthn PRF extension. The secret is recomputed by the user's passkey provider each time it is needed, so nothing is stored: not by this adapter, and not by Portal.

This is a separate backup method from @portal-hq/passkey-storage, and the two can be enrolled side by side.

Installation

yarn add @portal-hq/passkey-prf-storage [email protected] react-native-get-random-values

Setup

  • iOS 18 or later, or Android 9 (API 28) or later with a passkey provider that evaluates PRF. Google Password Manager does. Android has no way to ask a provider ahead of time, so the first backup is what confirms it.
  • react-native-passkey 3.6.2 exactly. mera's React Native client is written against 3.6.2 and declares it as an exact peer, so this adapter pins it too until mera widens its range.
  • A bundler that follows package exports. Metro does by default from React Native 0.79; on earlier versions set resolver.unstable_enablePackageExports.
  • crypto.getRandomValues. Hermes does not provide it, so import react-native-get-random-values at the top of your app's entry point.
  • Your app associated with the relying party domain, the same way it is for any passkey: webcredentials:<domain> with an apple-app-site-association file on iOS, and an assetlinks.json file on Android.

The relying party cannot change once a user has enrolled. The secret depends on it, so a backup made under one domain cannot be recovered under another. Choose it once, and use the same value on every platform a user may recover from.

Usage

import Portal, { BackupMethods } from '@portal-hq/core'
import PasskeyPrfStorage from '@portal-hq/passkey-prf-storage'

const portal = new Portal({
  apiKey,
  backup: {
    [BackupMethods.PasskeyPrf]: new PasskeyPrfStorage({
      relyingParty: 'yourdomain.com',
    }),
  },
})

const cipherText = await portal.backupWallet(BackupMethods.PasskeyPrf)
await portal.recoverWallet(cipherText, BackupMethods.PasskeyPrf)

The first backup creates the passkey and shows one system prompt (two on some Android providers). Every later backup and recovery reuses that passkey with a single prompt. A client has one PRF passkey; the adapter never replaces it, and delete() rejects, as it does in @portal-hq/passkey-storage.

Naming the passkey

The passkey provider shows the passkey's name in its prompt and in the user's password manager. It defaults to <custodian name> Backup (PRF). Set a default for every backup with the adapter's user option, or name the passkey for one backup:

await portal.backupWallet(BackupMethods.PasskeyPrf, undefined, {
  passkeyPrfStorage: {
    user: { name: '[email protected]', displayName: 'Jane, Acme wallet backup' },
  },
})

The name is only used when that backup creates the passkey. A client that already has one reuses it, and a passkey's name cannot be changed afterwards. Since the passkey cannot be replaced, a name the user recognizes makes it less likely they delete it while tidying their password manager.

Errors

Failures are raised as PortalPasskeyPrfError from @portal-hq/utils. Check for one with PortalPasskeyPrfError.is(error) and branch on error.reason:

| Reason | Meaning | | -------------------------- | ------------------------------------------------------------------------------------------------------------------- | | PRF_NOT_SUPPORTED | The device or passkey provider cannot evaluate PRF. | | PRF_CREDENTIAL_NOT_FOUND | No passkey is enrolled for this client, so there is nothing to recover. | | PRF_RP_ID_MISMATCH | The passkey was enrolled under a different relying party. | | PRF_DECRYPT_FAILED | The backup could not be decrypted with the secret from the passkey (usually a ciphertext from another method). | | PRF_USER_CANCELLED | The user dismissed the passkey prompt, or it timed out. | | PRF_PASSKEY_UNAVAILABLE | The platform reported that it has no passkey to offer (Android), or a passkey other than the enrolled one answered. | | PRF_CEREMONY_FAILED | The passkey prompt failed for another reason; see cause. |

When the enrolled passkey is on another device, the system prompt itself offers to use it from there (QR code / nearby device). iOS reports a missing passkey as a dismissed prompt, so PRF_USER_CANCELLED can also mean the passkey is gone. Word the message for PRF_USER_CANCELLED to cover that case too, for example "Try again, or use the passkey from the device that has it."