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

lukk-core

v0.8.0

Published

Framework-agnostic client core for lukk (Laravel JWT auth): contract types, auth client, WebAuthn helpers.

Readme

lukk-core

Framework-agnostic client core for lukk — the first-party JWT auth package for Laravel. Powers lukk-nuxt and future framework bindings; usable directly in any TypeScript app.

npm i lukk-core

Pre-1.0. lukk-core is 0.x (versioned in lockstep with lukk-nuxt); the public API may change between minor versions per SemVer §4. Pin an exact version and read the UPGRADE guide before upgrading.

What's inside

  • Contract types mirroring lukk's HTTP API — TokenPair, TwoFactorChallenge, PasskeyLoginOptions, … (kept in lockstep with lukk via conformance tests).
  • createLukkClient(hooks) — an auth client that attaches the Bearer token, refreshes once on a 401 (concurrent 401s share a single refresh), and exposes a typed method for every lukk endpoint.
  • WebAuthn helpersbase64url ↔ ArrayBuffer plus credential (de)serialization for navigator.credentials.

Usage

import { createLukkClient, isTwoFactorChallenge } from 'lukk-core'

let accessToken: string | null = null

const lukk = createLukkClient({
  baseURL: 'https://api.example.com/auth',
  getAccessToken: () => accessToken,
  onTokens: pair => { accessToken = pair.access_token },
  refresh: () => lukk.refreshTokens(), // direct mode: relies on the __Host- refresh cookie
})

const result = await lukk.login({ email, password })
if (isTwoFactorChallenge(result)) {
  // show the 2FA input, then:
  await lukk.twoFactorChallenge({ challenge_token: result.challenge_token, code })
}

The hooks are the only thing a binding wires up — where tokens live (memory, a sealed cookie, a server session) is the binding's call; the core just speaks to lukk.

Security model

  • The access token is an opaque bearer to the core — it is never decoded or verified client-side. All JWT validation (signature, pinned alg, iss/aud/exp/nbf) is lukk's, server-side. The core only carries the token in Authorization: Bearer … (RFC 6750), never in a URL/query.
  • Credentials are origin-scoped: the bearer, the X-Lukk-Confirmation header, and credentials: 'include' are attached only to a same-origin-as-baseURL target — never to an absolute, cross-origin URL.
  • Refresh is single-flighted, so a burst of 401s never replays a rotated refresh token into lukk's reuse detection. See the Architecture & security model.

Documentation

See Using lukk-core for the full hook reference, every method, error handling, and the WebAuthn helpers.

License

MIT