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

@octane-xplat/secure-storage

v0.17.1

Published

Keychain/Keystore-backed secure storage for Octane xplat — matching web + NativeScript implementations

Readme

@octane-xplat/secure-storage

pnpm add @octane-xplat/secure-storage

Store session tokens without displaying their contents. iOS and macOS use Keychain, Android uses the Keystore-backed plugin, and Linux uses the desktop host's Secret Service adapter. Plain browsers report supported: false.

import { secureStorage } from '@octane-xplat/secure-storage'

// Call with a token issued by your app's backend; never log its value.
async function saveSession(token: string) {
	if ((await secureStorage.ensure()) !== 'granted' || !secureStorage.impl) return null
	const store = secureStorage.impl
	if (!(await store.set('session-token', token))) return null
	return await store.get('session-token')
}

The shared capability contract: supported reports whether an implementation exists on this target — branch on it rather than catching — ensure() resolves the permission/availability state, and impl is an async string key-value store (get / set / remove).

if ((await secureStorage.ensure()) === 'granted') {
	await secureStorage.impl!.remove('session-token')
}

For non-secret preferences, use storage from @octane-xplat/platform instead.

Guide: Using device features; per-target availability: platform notes.

macOS AppKit

Install the leaf as an app runtime dependency. Use the CLI-owned pnpm xplat dev macos or pnpm xplat build --targets macos workflow; it compiles the bundled Foundation/Security sources and loads their metadata before your JavaScript. See native prerequisites. No new UI dependency, host adapter, or runtime permission request is needed. A custom host without the native leaf reports unsupported.

Keychain generic-password items use a service namespace owned by this leaf. Packaged apps are scoped by bundle identifier; keep that identifier stable across releases. CLI development hosts are scoped by the app's working directory. Moving that directory changes the development namespace, and development entries are separate from packaged entries. Items stay on this Mac and do not use iCloud synchronization. remove() deletes only the named item in that namespace.

ensure() reports that the native implementation exists; it does not unlock the Keychain or guarantee the next operation succeeds. No authentication prompt is opened by the leaf. A missing key returns null; a failed read rejects with Keychain read failed, without keys, values, or native exception text. Writing the same key overwrites its value, and empty strings are preserved. Writes return false when Keychain access fails. Removal returns true for an already missing key and false for access failures. Handle these results in your sign-in flow rather than falling back to preferences or browser storage.

From the repository root, pnpm --filter @octane-xplat/secure-storage test:macos checks the adapter and sanitized failures. test:packed checks package types; test:macos-runtime compiles a packed leaf and exercises real Keychain operations in an isolated host, including persistence across launches, bundle identity isolation, and a Vite build of its public import. That fixture creates random payloads in memory, prints only status markers, and removes its test items. It does not test UI input or locked-Keychain/signing policies.