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

@tokamakdev/plugin-secure-storage

v0.1.0-beta.63

Published

Secret storage that stays on the device, for Tokamak applications.

Downloads

2,475

Readme

@tokamakdev/plugin-secure-storage

Secret storage that stays on the device, for Tokamak applications.

Add it to your project's dependencies:

npm install @tokamakdev/plugin-secure-storage
import { secureStorage } from "@tokamakdev/plugin-secure-storage";

await secureStorage.set("identity/encryption", base64Value, {
  // Required: "whenUnlocked" or "afterFirstUnlock".
  readable: "whenUnlocked",
  // Reads need no authentication when omitted.
  authentication: "biometricsOrPasscode",
});

// string | null
const value = await secureStorage.get("identity/encryption", {
  prompt: "Confirm it's you to link a new device",
});

await secureStorage.delete("identity/encryption");

// string[], sorted
const names = await secureStorage.keys();

await secureStorage.clear();

Values are strings; encode binary values before storing them. Only the app can read them, and they are never synced to other devices.

By default a backup restores a value only to the device that stored it. Set thisDeviceOnly: false to let a backup restore it to a new device, where the platform supports that.

authentication binds a value to the device's secure hardware, so it cannot be decrypted until the device owner authenticates:

| authentication | Reads accept | After a biometric enrolment change | |---|---|---| | biometricsOrPasscode | Face ID, Touch ID or fingerprint; passcode, PIN, pattern or password | Readable | | biometrics | Face ID, Touch ID or fingerprint | Readable | | currentBiometrics | Face ID, Touch ID or fingerprint enrolled when the value was stored | Permanently unreadable |

prompt is the reason shown in the system authentication prompt. Without it, the platform's default prompt is shown.

Errors

| Name | When | |---|---| | NotSupportedError | The platform, build or device cannot enforce the options | | InvalidStateError | The requested authentication is not set up on the device | | NotAllowedError | The user cancelled or failed authentication, or the device is locked | | NotReadableError | A stored value can no longer be decrypted | | TypeError | An argument is missing or has an unsupported value | | OperationError | The platform reported another failure |

get resolves null when the name has no stored value.

Platforms

  • iOS: Keychain items, which survive deleting and reinstalling the app. They are included in encrypted backups; thisDeviceOnly values restore only to the same device.
  • macOS: the data protection keychain, which requires a team-signed build (macos.team-id). Ad-hoc signed builds throw NotSupportedError.
  • Android: values are encrypted with a per-value Android Keystore key and stored in the app's no-backup directory. They are deleted on uninstall. Keystore keys never leave the device, so thisDeviceOnly: false throws NotSupportedError.
  • Web and Windows: no implementation; calls throw NotSupportedError.

Removing the device passcode or screen lock makes values stored with authentication permanently unreadable on Android.