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

@luckystack/login

v0.16.1

Published

Authentication for LuckyStack: credentials + OAuth (Google/GitHub/Facebook/Discord/Microsoft/custom), Redis-backed sessions, single-session enforcement, password reset, 2FA, lifecycle hooks, and pluggable user/session adapters. Pairs with @luckystack/core

Downloads

1,647

Readme

@luckystack/login

Authentication and session lifecycle for LuckyStack, with credential, OAuth and adapter-backed identity options. Install with npm install @luckystack/login socket.io; add optional @prisma/client for the default user adapter and @luckystack/email for framework-managed email flows. Register user/session adapters before handling logins. Consult package.json, src/register.ts and src/userAdapter.ts for integration requirements.

Before switching an existing app to unified provider accounts: reconcile duplicate emails and dependent rows; enforce email uniqueness in the database (application checks cannot close the registration race); ensure a custom user adapter implements cross-provider email lookup; then enable the strategy. Changing cookie policy requires a CSRF/origin review. OAuth redirects must pass trusted-origin validation. Password-reset responses must not reveal whether an account exists; never expose tokens or hashes in sessions. See design context, session safety, redirect trust and account strategy.

Existing-project OAuth account binding (0.16)

  1. Add a nullable providerAccountId to the user store with an index on (provider, providerAccountId); for the default Prisma adapter providerAccountId String? and @@index([provider, providerAccountId]). Keep the index non-unique where the store rejects repeated nulls in a unique index (MongoDB, including through Prisma or MikroORM); on SQL a unique index is fine, as in the drizzle starter. Review/apply the database change with authorization and regenerate the client. Until the column exists, OAuth logins with the default adapter fail; credentials logins keep working.
  2. A custom adapter implements findByProviderAccountId and persists providerAccountId from create and update (src/userAdapter.ts). Without it the framework warns once and keeps email matching.
  3. Existing accounts bind on their next login when the provider verified the email; an unbound account whose provider email is unverified (multi-tenant Microsoft) is refused. See ADR 0086.

Existing-project email-code / 2FA adoption

  1. Obtain feature approval before opting into auth.emailCodeLogin: true and/or auth.twoFactor: 'optional'. Register a real email sender for email-code login and any email fallback; console delivery is not sufficient.
  2. Before 2FA enrollment, add persistence for twoFactorEnabled (initially false), nullable totpSecret and nullable recoveryCodes to the user store. For the default Prisma adapter the fields are Boolean @default(false), String? and Json? respectively. Review/apply the database change with authorization and regenerate the client; custom adapters must support these fields in src/userAdapter.ts.
  3. Set a high-entropy secret TOTP_ENCRYPTION_KEY before enrollment. Without it new TOTP secrets are stored unencrypted. Keep it outside Git/logs. During rotation retain previous values in TOTP_ENCRYPTION_LEGACY_KEYS (a JSON array of strings) until old records are migrated; deleting them early can lock users out. See src/twoFactor.ts for the installed keyring contract.
  4. Run npx luckystack update --app, review/merge UI .new sidecars without overwriting consumer edits, then verify enrollment, login, recovery and rotation in an authorized environment. Schema and real secrets remain manually owned.