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

@mintplayer/ng-spark-auth

v22.20.0

Published

Angular authentication library for MintPlayer.Spark

Readme

@mintplayer/ng-spark-auth

The Angular half of MintPlayer.Spark.Authorization: sign-in (email or user name, two-factor, external providers, passkeys), registration, password reset, the account pages (withAccount()), route guards and the HTTP interceptor that carries the session and the antiforgery token to /spark/auth.

It builds on @mintplayer/ng-spark, which must be installed too.

Install

npm install @mintplayer/ng-spark-auth @mintplayer/ng-spark @mintplayer/ng-bootstrap

The major version follows Angular's: 22.x targets Angular 22. When the server references MintPlayer.Spark.Authorization, the build warns with SPARK030 if the SPA's package.json does not declare this package (the generated spark-auth.setup.ts imports it).

Setup

// app.config.ts
import { provideHttpClient } from '@angular/common/http';
import { provideSparkAuth, withSparkAuth } from '@mintplayer/ng-spark-auth';

export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes),
    provideHttpClient(...withSparkAuth()),   // interceptor + XSRF-TOKEN / X-XSRF-TOKEN
    provideSparkAuth(),                      // optional: { apiBasePath, loginUrl, defaultRedirectUrl }
  ],
};

// app.routes.ts
import { sparkAuthRoutes, withLocalLogin, withRegistration, withAccount,
         withExternalLogin, githubProvider } from '@mintplayer/ng-spark-auth/routes';
import { sparkAuthGuard } from '@mintplayer/ng-spark-auth/guards';
import { sparkRoutes } from '@mintplayer/ng-spark/routes';

export const routes: Routes = [
  ...sparkAuthRoutes(
    withLocalLogin(),                        // login, two-factor, forgot/reset password
    withRegistration(),                      // only with SparkLocalCredentials.Full on the server
    withExternalLogin(githubProvider()),     // sign-in page with a button per provider
    withAccount(),                           // confirm-email + the account pages
  ),
  { path: 'orders', canActivate: [sparkAuthGuard], loadComponent: () => import('./orders.component') },
  ...sparkRoutes(),
];

Mount only the features the server maps: see the route × mode table in guide-authentication-schemes.md. The server-generated spark-auth.setup.ts wires the same calls for you (Authorization README § Angular Frontend Setup).

withAccount()

Mounts the account pages; each is also a standalone component from /account (confirm-email from /confirm-email). The passkeys path is no component: it forwards to the generic passkeys page.

| Page | Default path | Component | |---|---|---| | Confirm email (public; the mail link target) | confirm-email | SparkConfirmEmailComponent | | Overview | account | SparkAccountOverviewComponent | | Profile — user name, email change (only with the server's SparkEmailChange.Enabled), mail language, app fields | account/profile | SparkAccountProfileComponent | | Change / set password | account/password | SparkChangePasswordComponent | | Two-factor — authenticator (server-rendered QR), recovery codes | account/two-factor | SparkTwoFactorSetupComponent | | Connected logins | account/logins | SparkExternalLoginsComponent | | Passkeys — forwards to /po/passkeys/me, the Authorization library's Passkeys page (list, add, rename, remove) | account/passkeys | — | | Personal data export + account deletion | account/personal-data | SparkPersonalDataComponent |

withAccount({ exclude: ['externalLogins', 'passkeys'] })   // drop pages the server does not support
withAccount({ canActivate: [myGuard] })                     // default: [sparkAuthGuard]

The overview (/account) shows who is signed in and links each mounted page. Pages behind a server switch are also checked against GET /spark/auth/capabilities: password and two-factor appear only when LocalCredentials is not Disabled, passkeys only when the server reports passkeys and the browser supports WebAuthn.

<spark-auth-bar> renders Account and Logout side by side in a <bs-button-group> when withAccount() is mounted (the bar reads the mounted path from the router configuration, so a custom account path is followed), and Logout alone otherwise. It no longer shows the user name or a passkey button; both live on the account page.

confirm-email must stay at the server's Spark:Auth:Links:ConfirmEmailPath (default /confirm-email). App-specific profile fields are declared with provideSparkAccountProfileFields(...) (/models) and validated on the server by an ISparkProfileContributor<TUser>.

Entry points

| Entry point | What it provides | |---|---| | @mintplayer/ng-spark-auth | provideSparkAuth(config?), withSparkAuth() | | /routes | sparkAuthRoutes(...), withLocalLogin, withRegistration, withExternalLogin, withPasskeys, withAccount; provider presets githubProvider, googleProvider, microsoftProvider, facebookProvider, twitterProvider, linkedInProvider, externalProvider(scheme) | | /guards | sparkAuthGuard — lets a signed-in user through, otherwise redirects to sign-in with returnUrl; waits for the session check on a hard reload. sparkAuthenticatedGuard is the same guard | | /interceptors | sparkAuthInterceptor (included by withSparkAuth()) | | /core | SparkAuthService (current user signal, checkAuth(), sign-in/out), SparkAuthTranslationService | | /models | SPARK_AUTH_CONFIG, SPARK_AUTH_ROUTE_PATHS, SPARK_EXTERNAL_PROVIDERS, SPARK_ACCOUNT_PROFILE_FIELDS, provideSparkAccountProfileFields(...) and the wire types | | /login, /two-factor, /forgot-password, /reset-password, /register, /sign-in | The individual pages the route features mount | | /account, /confirm-email | The account pages above | | /auth-bar | <spark-auth-bar> — sign-in / user menu for a top bar | | /pipes | TranslateKeyPipe |

More