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

@structured-id/ids

v0.12.0

Published

StructuredID identifiers: one checked type per identifier kind, the sid.v1.ids wire messages and validated conversions between them.

Readme

@structured-id/ids

StructuredID identifiers for TypeScript: one class per identifier kind (AuthorizationOperationId, BindingId, CredentialId, DeviceId, DirectoryUserId, ImportedPasswordUpgradeId, MachineUserId, MagicLinkId, OpaqueLoginId, OtpSessionId, PasswordOperationId, PrincipalId, ProfileEmailId, ProfileId, ProfilePhoneId, ProvisioningConnectorId, ProvisioningCredentialId, ResetSessionId, ResourceId, SessionId, StepUpChallengeId), the sid.v1.ids wire messages and checked conversions between them.

Each identifier is exactly 16 bytes of an RFC 9562 UUIDv7 in network byte order. A value of one of these classes is always valid: it is built only through validation, which refuses other lengths, the nil and max UUIDs, other variants and other versions, naming the reason. Values of different kinds are different types, even with equal bytes. A valid identifier proves only its shape, not whom it belongs to or what it may do.

Use

npm install @structured-id/ids
import { BindingId, IdError, required, optional, wire } from "@structured-id/ids";

// Wire to domain: a decoded message is an untrusted DTO until converted.
const message = wire.BindingId.fromBinary(bytes);
const id = required(BindingId, message); // throws MissingIdError or IdError

// An optional field keeps absence apart from an invalid value.
const maybe = optional(BindingId, undefined); // undefined

// Domain to wire: the same 16 bytes.
const encoded = wire.BindingId.toBinary(id.toWire());

// Text is for display; the wire carries bytes.
console.log(id.toString()); // 019290a4-7b3c-7d2e-8f00-112233445566
BindingId.parse("019290a4-7b3c-7d2e-8f00-112233445566");

wire holds the generated messages with their binary and standard ProtoJSON codecs (toJson / fromJson): bytes are base64 there, as the ProtoJSON mapping defines.

Messages of your own that carry an identifier import @structured-id/ids/schema/sid/v1/ids/ids.proto (PROTO_PATH under an include root) and use this package's wire types for those fields instead of generating a second copy.

Corpus

sid/v1/ids/ids.corpus.json in the proto definitions holds every case of the identifier contract for each kind. This package's tests run that file unchanged, as the Rust crates sid-ids and sid-ids-proto do.

Verify

From the typescript/ directory of the SDK repository, with its proto submodule checked out:

yarn install
yarn test
ci/check-package.sh

License

Apache License, version 2.0. See LICENSE and NOTICE.