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

@enbox/dwn-sdk-js

v0.1.2

Published

A reference implementation of https://identity.foundation/decentralized-web-node/spec/

Readme

Decentralized Web Node (DWN) SDK

Research Preview — Enbox is under active development. APIs may change without notice.

Coverage

A TypeScript implementation of Decentralized Web Nodes — protocol-driven personal datastores that users control.

Overview

This package is the core DWN engine used by the rest of the Enbox stack. It handles message processing, protocol authorization, record storage, and encryption. Most applications should use @enbox/api rather than this package directly.

Installation

bun add @enbox/dwn-sdk-js

Usage

import { Dwn, DataStream, Jws, RecordsWrite } from '@enbox/dwn-sdk-js';
import { DataStoreLevel, MessageStoreLevel, StateIndexLevel } from '@enbox/dwn-sdk-js';

const messageStore = new MessageStoreLevel();
const dataStore = new DataStoreLevel();
const stateIndex = new StateIndexLevel();
const dwn = await Dwn.create({ messageStore, dataStore, stateIndex });

// Create and process a RecordsWrite message
const data = new TextEncoder().encode('Hello, World!');
const recordsWrite = await RecordsWrite.create({
  data,
  dataFormat  : 'application/json',
  published   : true,
  schema      : 'example/post',
  signer      : Jws.createSigner(persona),
});

const dataStream = DataStream.fromBytes(data);
const result = await dwn.processMessage(persona.did, recordsWrite.message, { dataStream });
console.log(result.status); // { code: 202, detail: 'Accepted' }

await dwn.close();

Custom Tenant Gating

By default all DIDs are allowed as tenants. Provide a custom TenantGate to restrict access:

import { ActiveTenantCheckResult, Dwn, TenantGate } from '@enbox/dwn-sdk-js';

class CustomTenantGate implements TenantGate {
  public async isActiveTenant(did: string): Promise<ActiveTenantCheckResult> {
    // custom logic
  }
}

const dwn = await Dwn.create({ messageStore, dataStore, stateIndex, tenantGate: new CustomTenantGate() });

Custom Signer

Use PrivateKeySigner if you have a key available, or implement the Signer interface to integrate with an external signing service, HSM, etc.:

import type { Signer } from '@enbox/dwn-sdk-js';

class CustomSigner implements Signer {
  public keyId = 'did:example:alice#key1';
  public algorithm = 'EdDSA';
  public async sign(content: Uint8Array): Promise<Uint8Array> {
    // custom signing logic
  }
}

Architecture

The diagram is a conceptual view; actual component names in source may differ.

Development

# Build
bun run build

# Test
bun run test:node

# Test with grep filter (from this package directory)
GREP="ProtocolsConfigure" bun run test:node-grep

# Lint
bun run lint

License

Apache-2.0