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

sacap

v0.1.0

Published

Delegate account-level Storacha UCAN capabilities (like plan/get) to server agents

Readme

sacap

Storacha Account Capabilities — delegate account-level Storacha capabilities to server agents.

The Storacha CLI's delegation create command only supports space-scoped delegations (did:key:...). Some capabilities like plan/get are scoped to your account (did:mailto:...) and can't be delegated through the CLI. This tool handles that.

Install

npm install -g sacap

Prerequisites

  • Storacha CLI installed and logged in (storacha login)
  • Email verification completed

Usage

sacap <capability> <server-agent-did> <account-email> [--expiry <days>]

Examples

# delegate plan/get to a server agent
sacap plan/get did:key:z6Mk... [email protected]

# delegate all plan capabilities with a 30-day expiry
sacap "plan/*" did:key:z6Mk... [email protected] --expiry 30

The output is a base64-encoded delegation string. Set it as an environment variable on your server.

Loading the proof on your server

import * as Proof from "@storacha/client/proof"

const planProof = await Proof.parse(process.env.STORACHA_PLAN_PROOF)
await client.addProof(planProof)

Common pitfalls

Wrong agent DID

The server-agent-did argument must be the DID of the agent that will use the delegation — not the CLI agent, not any other key. If the audience DID doesn't match, addProof will silently accept the delegation but the agent won't be able to use it.

If your server agent is created from a key in an environment variable (e.g. STORACHA_KEY. see: bring your own delegations), get its DID like this:

import { Signer } from "@storacha/client/principal/ed25519"

const signer = Signer.parse(process.env.STORACHA_KEY)
console.log(signer.did()) // this is the DID you pass to sacap

Your local dev key and production key are likely different. Make sure you're delegating to the right one.

Encoding format

It outputs a base64 identity CID — the same format as storacha delegation create --base64. Raw Buffer.from(bytes).toString('base64') won't work with Proof.parse().

How it works

  1. Reads the local Storacha CLI agent store
  2. Finds account-level proofs (the root ucan:* delegation from did:mailto:... + the attestation from the upload-service)
  3. Creates a new UCAN delegation via @ucanto/core with the full proof chain
  4. Exports as a base64 identity CID

License

MIT