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

@ackplus/nest-auth

v2.7.0

Published

Authentication & authorization for NestJS — JWT/cookie sessions, refresh-token rotation, RBAC, multi-tenancy, MFA, OAuth/social login, passwordless, API keys, and a built-in admin console.

Readme

@ackplus/nest-auth

npm version npm downloads license

Full-featured authentication module for NestJS. Sessions, MFA, OAuth, passwordless, multi-tenancy, RBAC, audit logging, and an embedded admin console — all type-safe end to end.

📚 Full documentation: ack-solutions.github.io/nest-auth


Why

Modern auth has a long checklist: email + password, OAuth, MFA, refresh-token rotation, RBAC, multi-tenancy, audit logs, an admin console. Most teams glue together five libraries (and own the integration risk) or buy a hosted vendor (and lose data ownership). @ackplus/nest-auth picks a third path: a single, modular library you install in your own NestJS app, backed by your own database.

Install

pnpm add @ackplus/nest-auth @ackplus/nest-auth-contracts

Required peer dependencies:

pnpm add @nestjs/common @nestjs/core @nestjs/typeorm @nestjs/swagger \
  @nestjs/event-emitter @nestjs/platform-express \
  typeorm class-validator class-transformer reflect-metadata rxjs

Optional, only if you enable the matching feature:

| Feature | Add | | --- | --- | | Cookie-mode sessions | cookie-parser | | Redis sessions | ioredis | | Google OAuth | google-auth-library | | Facebook OAuth | fb | | Apple OAuth | apple-auth | | Rate limiting | @nestjs/throttler |

Full install guide →

What's included

| Capability | Notes | | --- | --- | | 9 sign-in methods | Email + password · phone + password · passwordless OTP · magic link · Google · Facebook · Apple · GitHub · API keys + custom OAuth providers | | MFA | TOTP · email OTP · SMS OTP · recovery codes · trusted-device tokens | | Sessions | Database (default), Redis, or in-memory · auto-refresh · refresh-token rotation · password-hash-prefix invalidation | | Multi-tenancy | disabled / shared / isolated modes · tenant-aware decorators · per-request context | | RBAC | Roles + permissions per guard namespace (web, api, mobile) · external IDP friendly | | Embedded admin console | Built-in React UI for users, roles, permissions, tenants, API keys | | Hooks & events | Every lifecycle moment is overridable; full EventEmitter2 integration | | Audit logging | Structured event hook for compliance | | OpenAPI | Auto-generated @nestjs/swagger spec for every endpoint |

Minimal example

import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { EventEmitterModule } from '@nestjs/event-emitter';
import { NestAuthModule, NestAuthEntities } from '@ackplus/nest-auth';

@Module({
  imports: [
    EventEmitterModule.forRoot(),
    TypeOrmModule.forRoot({
      type: 'postgres',
      url: process.env.DATABASE_URL,
      entities: [...NestAuthEntities],
      synchronize: process.env.NODE_ENV === 'development',
    }),
    TypeOrmModule.forFeature([...NestAuthEntities]),

    NestAuthModule.forRoot({
      appName: 'My App',
      session: { jwt: { secret: process.env.JWT_SECRET! } },
      // emailAuth: { enabled: true },        // default
      // google: { clientId, clientSecret },  // opt-in OAuth
      // mfa: { enabled: true, required: true },
      // tenant: { enabled: true, mode: TenantModeEnum.SHARED },
    }),
  ],
})
export class AppModule {}

That's it — you immediately get POST /auth/signup, POST /auth/login, /auth/refresh-token, password-reset, MFA, OAuth callbacks, and the rest of the API. Wire EventEmitterModule.forRoot(), cookie-parser, and the AuthExceptionFilter from the setup checklist and ship.

Documentation

| Section | What's there | | --- | --- | | Getting Started | Install, database setup (3 paths), env vars, quickstart for backend / React / Next.js / vanilla | | Core Concepts | Sessions, user model, multi-tenancy, RBAC, MFA, events, audit | | Authentication | One page per sign-in method | | Backend Reference | Module config, entities, decorators, guards, services, hooks, events, error codes, admin console | | Production | Email/SMS wiring, JWT customization, scaling, CORS & security, testing | | Recipes | 20 copy-paste solutions — referral codes, custom OAuth, tenant switcher, etc. | | API Reference | Auto-generated REST + TypeScript types | | FAQ & Troubleshooting | Error codes → likely cause → fix |

Companion packages

| Package | Use when | | --- | --- | | @ackplus/nest-auth-client | Vanilla JS / Vue / Angular / Svelte / React Native client | | @ackplus/nest-auth-react | React provider, hooks, guards, and Next.js App Router helpers | | @ackplus/nest-auth-contracts | Shared TS types — consumed by all three |

All four packages release together with the same version number. Pin them all to the same version.

Links

License

MIT