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

@ldclabs/ic-auth

v0.5.0

Published

TypeScript client SDK for IC-Auth identities, deterministic CBOR signing, and compact envelope types.

Readme

@ldclabs/ic-auth

License Test NPM version

IC-Auth is a web authentication system based on Internet Computer identities.

@ldclabs/ic-auth is the TypeScript client SDK for IC-Auth. It provides compact envelope and delegation types, deterministic CBOR encoding, SHA3-256 message digests, Base64URL helpers, and signing helpers built on @icp-sdk/core identities.

Installation

Install the package using your favorite package manager:

npm install @ldclabs/ic-auth

or

yarn add @ldclabs/ic-auth

The package expects these peer dependencies in the host project:

"peerDependencies": {
  "@icp-sdk/core": ">=5.0.0",
  "@noble/hashes": "^1.8.0",
  "cborg": ">=4.5.0"
}

What It Exports

  • deterministicEncode, decode, encode, and rfc8949EncodeOptions from cborg.
  • Delegation, SignedDelegation, SignedEnvelope, and compact p/s/h/d wire forms.
  • Conversion helpers such as toSignedEnvelope, toSignedEnvelopeCompact, toDelegationCompact, and deep-link sign-in type converters.
  • toDelegationIdentity, signArbitrary, signMessage, digestMessage, and Base64URL helpers.
  • DelegationIdentity, Ed25519KeyIdentity, and Ed25519PublicKey re-exported from @icp-sdk/core/identity.

Sign a Message

import {
  Ed25519KeyIdentity,
  bytesToBase64Url,
  deterministicEncode,
  signMessage,
  toDelegationIdentity
} from '@ldclabs/ic-auth'

async function main() {
  const baseIdentity = Ed25519KeyIdentity.generate()
  const identity = toDelegationIdentity(baseIdentity)

  const message = new Map<any, any>([
    ['challenge', 'login-123'],
    ['origin', 'https://example.com']
  ])

  const envelope = await signMessage(identity, message)
  const token = bytesToBase64Url(deterministicEncode(envelope))

  // Send `token` as an `Authorization: ICP ${token}` value, or send the
  // compact envelope bytes to an IC-Auth verifier.
  console.log(token)
}

main()

signMessage hashes the deterministic CBOR encoding of the supplied value with SHA3-256 and signs that digest. Use signArbitrary when you already have the digest bytes.

Convert Wire Types

import { toSignedEnvelope, toSignedEnvelopeCompact } from '@ldclabs/ic-auth'

const full = toSignedEnvelope({
  p: new Uint8Array([1, 2, 3]),
  s: new Uint8Array([4, 5, 6])
})

const compact = toSignedEnvelopeCompact(full)

The compact forms match the Rust serde names used by ic_auth_types and ic_auth_verifier.

Related Packages

License

Copyright © 2024-2026 LDC Labs.

Licensed under the MIT License. See LICENSE for details.