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

@ssis/ssisauth

v2.0.1

Published

OAuth 2.1 Authorization Code + PKCE client library for SSIS

Readme

ssisauth

OAuth 2.1 Authorization Code + PKCE-klientbibliotek för SSIS.

Installation

npm install @ssis/ssisauth

Snabbstart

import { ssisauth } from "@ssis/ssisauth";

const auth = ssisauth({
  secrets: {
    clientId: "ditt-client-id",
    clientSecret: "din-client-secret", // valfritt för publika klienter (stable version)
  },
  scopes: ["openid", "profile", "email"],
  // issuer är som standard https://authentication-git-authentication.apps.okd.ssis.nu (beta)
});

// Anropas en gång vid sidladdning — hanterar OAuth-återanropet automatiskt
await auth.initialize();

// Omdirigera användaren till inloggningssidan
auth.signin();

// Läs den aktiva sessionen (null om inte inloggad)
const session = auth.useSession;
console.log(session?.user?.email);

// Logga ut användaren (rensar sessionen och omdirigerar till utloggningsendpunkten)
auth.logout();

API

ssisauth(config)

Skapar en autentiseringsinstans.

| Alternativ | Typ | Obligatorisk | Standard | |---|---|---|---| | secrets.clientId | string | ✅ | — | | secrets.clientSecret | string | ❌ | — | | scopes | string[] | ❌ | ["openid", "profile", "email"] | | issuer | string | ❌ | SSIS issuer-URL | | redirectUri | string | ❌ | aktuell sid-URL | | discover | boolean | ❌ | true — hämtar endpunkter automatiskt via OIDC-konfigurationen | | verifyTokens | boolean | ❌ | false — kryptografisk verifiering av id_token via JWKS |

auth.initialize(): Promise<void>

Måste anropas vid sidladdning. Identifierar ett OAuth-återanrop (?code=…&state=…), byter koden mot tokens, sparar sessionen och rensar URL:en.

auth.signin(options?): void

Genererar PKCE-parametrar och omdirigerar till auktoriseringsendpunkten.

| Alternativ | Typ | Standard | |---|---|---| | options.redirectUri | string | aktuell sid-URL |

auth.useSession

Getter — returnerar den aktuella Session från localStorage, eller null om användaren inte är inloggad eller om sessionen har gått ut.

interface Session {
  accessToken: string;
  idToken?: string;
  refreshToken?: string;
  tokenType: string;
  expiresAt: number;   // epoch ms
  scope?: string;
  user?: UserInfo;
}

auth.logout(options?): void

Rensar den lokala sessionen och omdirigerar till utloggningsendpunkten.

| Alternativ | Typ | Standard | |---|---|---| | options.redirectTo | string | window.location.origin |

auth.getUser(): Promise<UserInfo | null>

Returnerar användaren från den sparade sessionen. Om sessionen saknar cachad användarinfo hämtas den från /userinfo-endpunkten.

auth.getOpenIDConfiguration(): Promise<OIDCConfiguration>

Hämtar och cachar OpenID Connect-konfigurationsdokumentet från /.well-known/openid-configuration. Returnerar all leverantörsmetadata inklusive stödda scopes, algoritmer och endpunkt-URL:er.

auth.getJWKS(): Promise<JWKSet>

Hämtar och cachar leverantörens publika nycklar från JWKS-endpunkten (/api/auth/jwks). Nycklarna används för verifiering av id_token.

auth.verifyToken(token: string): Promise<JWTClaims>

Verifierar kryptografiskt en JWT (RS256) med hjälp av leverantörens JWKS-nycklar. Validerar signaturen, utgångstid (exp), giltighetstid från (nbf), issuer och audience.

const claims = await auth.verifyToken(session.idToken!);
console.log(claims.sub, claims.email);

Utveckling

npm install
npm run build       # kompilera till dist/
npm run test        # kör tester i bevakningsläge
npm run test:run    # kör tester en gång
npm run typecheck   # typkontroll utan att emittera filer

OAuth-endpunkter (standard-issuer)

| Endpunkt | URL | |---|---| | Auktorisering | /api/auth/oauth2/authorize | | Token | /api/auth/oauth2/token | | Användarinfo | /api/auth/oauth2/userinfo | | Utloggning | /api/auth/oauth2/logout | | JWKS | /api/auth/jwks | | OpenID-konfiguration | /.well-known/openid-configuration |