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

@omgjs/labkit-server-auth

v0.1.1

Published

Server-side auth helpers for Labkit access tokens, guards, sessions, lifecycle events, and refresh transport.

Downloads

20

Readme

@omgjs/labkit-server-auth

@omgjs/labkit-server-auth contains server-side auth framework helpers. It owns the reusable auth concepts, while applications still own product API shape and security-sensitive adapters.

The package is auth-system oriented rather than persistence-provider oriented: it exposes storage interfaces and orchestration, then adapter packages such as @omgjs/labkit-server-auth-typeorm provide concrete repositories.

Owns

  • Public and role metadata decorators.
  • GraphQL authentication and roles guards.
  • Identity provider capabilities, registry, and provider factory helpers.
  • Local identity provider flow with app-supplied password hashing.
  • Access-token claim and principal mapping helpers.
  • Access-token verifier adapters.
  • Refresh-token generation, hashing, expiry, state, rotation, and revocation helpers.
  • Refresh-token cookie/body transport helpers and Nest provider factory.
  • Refresh-session orchestration over app-supplied persistence repositories.
  • Auth lifecycle event contracts and dispatcher helpers.
  • GraphQL auth integration helpers and Nest module factories.

Does Not Own

  • Password hashing implementation.
  • JWT signing secret and concrete token service configuration.
  • TypeORM entities or migrations.
  • GraphQL DTO classes and resolver field names.
  • Lifecycle side effects such as notifications, audit sinks, or risk checks.
  • Application route/module layout.

Typical Server Wiring

import {
  createIdentityProviderRegistryConfigProvider,
  createServerAuthLocalIdentityProviderProvider,
  createServerAuthRefreshTokenTransportProvider,
} from "@omgjs/labkit-server-auth";
import { ServerAuthTypeormModule } from "@omgjs/labkit-server-auth-typeorm";

@Module({
  imports: [ServerAuthTypeormModule],
  providers: [
    createIdentityProviderRegistryConfigProvider(IdentityConfigService),
    createServerAuthLocalIdentityProviderProvider({
      configReaderToken: IdentityConfigService,
      passwordHasherToken: PasswordService,
    }),
    createServerAuthRefreshTokenTransportProvider({
      configReaderToken: IdentityConfigService,
    }),
  ],
})
export class IdentityModule {}

For GraphQL setup, prefer the named access-token helper when your app follows the Labkit access-token service shape:

createServerAuthAccessTokenGraphqlModule({
  imports: [IdentityModule],
  accessTokenServiceToken: AccessTokenService,
  configReaderToken: ConfigService,
});

Use createServerAuthGraphqlModule when an app needs a custom factory and more direct control over the GraphQL integration.

Extension Model

Applications extend behavior by supplying adapters:

  • ServerAuthPasswordHasher for password hashing and verification.
  • ServerAuthAccessTokenService or verifier functions for JWT behavior.
  • Repository interfaces for users, identity accounts, roles, refresh sessions, and transactions.
  • Lifecycle event handlers for logging, notifications, auditing, or custom provider side effects.

This keeps Labkit opinionated about auth flow while leaving persistence, cryptographic configuration, and product events app-owned.

Release Channel

This package is published on npm as part of the Labkit release train. Patch releases may include documentation-only clarifications, so consumers can update within the same minor line without expecting runtime API changes.

Package Format

This is a server-only CommonJS package.