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

@beamarco/auth-verify

v0.1.4

Published

Verify Beamar Auth JWTs in backend services - framework-agnostic JWT verification via JWKS

Readme

@beamarco/auth-verify

Verify Beamar Auth JWTs in backend services. Framework-agnostic — works with Express, Hono, NestJS, Fastify, etc.

Install

npm install @beamarco/auth-verify

Usage

Verify JWT and check scope

import {
  verifyBeamarJwt,
  hasScope,
  extractBearerFromRequest,
} from '@beamarco/auth-verify'

// In your middleware or route handler
const token = extractBearerFromRequest(req)
const res = await verifyBeamarJwt({
  token,
  jwksUrls: [process.env.BEAMAR_AUTH_JWKS_URL],
  issuer: process.env.BEAMAR_AUTH_JWT_ISSUER,
  audience: process.env.BEAMAR_AUTH_JWT_AUDIENCE,
})

if (!res.ok) {
  return res.status(401).json({ error: res.error })
}

if (!hasScope(res.payload, ['screening:admin'])) {
  return res.status(403).json({ error: 'Missing required permission' })
}

// Proceed — res.payload contains the JWT claims
const userId = res.payload.sub

Environment variables

| Variable | Description | |----------|-------------| | BEAMAR_AUTH_JWKS_URL | Per-application JWKS URL (e.g. https://auth.s.beamar.co/auth/jwks/{appId}). Get from developers portal. | | BEAMAR_AUTH_JWT_ISSUER | Optional issuer validation | | BEAMAR_AUTH_JWT_AUDIENCE | Optional audience validation |

Beamar token conventions

  • System-admin tokens: scope: "admin:*" — treated as super-admin (has all scopes)
  • App tokens: permissions: ["screening:admin", ...] — resource-specific permissions
  • Wildcard: * in scopes means all permissions

Extract token from headers

import { extractBearerToken, extractBearerFromRequest } from '@beamarco/auth-verify'

// From raw header value
const token = extractBearerToken(req.headers.authorization)

// From Request-like object (works with fetch Request, Express req, Hono c.req, etc.)
const token = extractBearerFromRequest(req)

API

verifyBeamarJwt(opts)

Try multiple JWKS URLs in order. Returns first successful verification.

const res = await verifyBeamarJwt({
  token: string | null | undefined,
  jwksUrls: (string | undefined)[],
  issuer?: string,
  audience?: string,
})
// res: { ok: true, payload } | { ok: false, error }

verifyJwt(opts)

Verify using a single JWKS URL.

const res = await verifyJwt({
  token,
  jwksUrl,
  issuer?: string,
  audience?: string,
})

hasScope(payload, requiredScopes, options?)

Check if the verified payload has the required scope(s).

const allowed = hasScope(payload, ['screening:admin'])
// options: { permissionsClaim?: 'permissions', scopeClaim?: 'scope' }

License

MIT