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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@did.coop/wallet-attached-storage

v0.4.0

Published

A Typescript/Javascript isomorphic library template, for use in the browser, Node.js, and React Native.

Readme

Wallet Attached Storage Client (@did.coop/wallet-attached-storage)

Build status NPM Version

A Wallet Attached Storage Javascript/TypeScript client for Node, browser and React Native.

Table of Contents

Background

See in progress spec: https://wallet.storage/spec

App Identity and Key Management

To use Wallet Attached Storage (to provision data spaces, to create collections, and to read and write resources), the application or service using this client will need its own cryptographically provable identity (in the form of a DID).

At minimum, this means that the app or service using this client will need to create and manage its own public-private key pair. The challenges and security considerations of cryptographic key management are beyond the scope of this usage document, but roughly:

  • For in browser client-only Single Page Applications (SPAs), the app's identity is ephemeral -- essentially a key pair will be generated for each new user session, and stored in the browser.

  • For traditional server side web applications, it is recommended that the app's DID and key pairs are managed securely, on the server side, preferably using an HSM (Hardware Security Module).

  • For mobile apps, key pairs may be generated during setup, and can take advantage of the mobile operating system's keychain and encrypted app storage.

Security

TBD

Install

  • Node.js 18+ is recommended.

NPM

To install via NPM:

npm install @did.coop/wallet-attached-storage

Development

To install locally (for development):

git clone https://github.com/did-coop/wallet-attached-storage.git
cd wallet-attached-storage
npm install

Usage

This client assumes:

  • a remote Wallet Attached Storage server is available
  • the app is able to create and store a public-private key pair, see the App Identity and Key Management section for more details.

Example key pair generation (for an in-browser SPA), for persistence in local storage.

import { Ed25519Signer } from '@did.coop/did-key-ed25519'

const appDidSigner = await Ed25519Signer.generate()

Example storing and loading:

// Serialize to JSON for storage
const exportedKeyPair = appDidSigner.toJSON()
localStorage.setItem('app-DID', JSON.stringify(exportedKeyPair))

// Load from storage and turn back into a DID Signer
const loadedKeyPair = localStorage.getItem('app-DID')
const appDidSigner = Ed25519Signer.fromJSON(loadedKeyPair)

Create a Wallet Attached Storage Client, connect it to a remote url:

import { WalletStorage } from '@did.coop/wallet-attached-storage'

const url = 'https://data.pub' // load this from config

let storage
try {
  storage = WalletStorage.connect({ url, signer: appDidSigner })
} catch (e) {
  console.error('Error connecting:', e)
  throw e
}

Now you can read and write resources to and from collections:

// Create a reference to the Credentials collection (note that no API calls are
//   made yet)
const credentials = storage.collection('credentials')

// Iterate through the collection, fetch the resources
for await (const resource of credentials) {
  const response = await resource.get()
  const vc = await response.json()
  console.log(JSON.stringify(vc, null, 2))
}

// Upload a VC
await credentials.resource().put(
  new Blob(JSON.stringify(vc), { type: 'application/vc' })
)

// Upload Evidence / Documents
await storage.collection('documents')
  .resource().put(getDocumentBlob())

Contribute

PRs accepted.

If editing the Readme, please conform to the standard-readme specification.

License

MIT License © 2025 DID.coop.