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

@primedx/plugin-access-tokens-node

v0.2.0

Published

Backstage node library for access token permissions and service token verification.

Readme

@primedx/plugin-access-tokens-node

Shared Backstage node library for service token auth and permission wiring.

This package is the backend-facing companion to the access tokens plugin. Most adopters use it to register the external auth handler that accepts raw service tokens and to import the permission definitions used by a Backstage permission policy.

When To Use This Package

Install this package when you need either of these integration points:

  • register serviceAccessTokenHandlerModule in your backend so raw service tokens are accepted by Backstage auth
  • import the service token permission definitions into your permission policy

You will typically install it together with @primedx/plugin-access-tokens-backend.

Install

Add the package to your Backstage backend workspace:

yarn --cwd packages/backend add @primedx/plugin-access-tokens-node

Minimum Working Setup

Register the auth handler module in your backend:

// packages/backend/src/index.ts
import { createBackend } from '@backstage/backend-defaults';
import { serviceAccessTokenHandlerModule } from '@primedx/plugin-access-tokens-node';

const backend = createBackend();

backend.add(serviceAccessTokenHandlerModule);

In the normal plugin installation flow you register this module alongside accessTokensPlugin from @primedx/plugin-access-tokens-backend.

Permission Exports

Use these permission definitions in your Backstage permission policy:

  • serviceAccessTokensReadPermission
  • serviceAccessTokensWritePermission
  • serviceAccessTokensRevokePermission

This package also exports:

  • serviceAccessTokensReadPermission as a deprecated compatibility alias that maps to read-only behavior

New policies should use the granular read, write, and revoke permissions directly.

Main Public Exports

The primary externally useful exports are:

  • serviceAccessTokenHandlerModule
  • serviceAccessTokensReadPermission
  • serviceAccessTokensWritePermission
  • serviceAccessTokensRevokePermission
  • serviceAccessTokensPermissions

This package also exposes lower-level helpers such as verifyToken, createTokenCache, createServiceTokenAuthDatabase, createServiceTokenHandler, and createScopeResolver.

Those helpers are useful for advanced integration and testing, but most adopters should not need them for the default install path.

What This Package Does Not Include

This package does not provide the REST API routes or persistence plugin entry point by itself. For that, install @primedx/plugin-access-tokens-backend.

It also does not provide the admin UI. For that, install @primedx/plugin-access-tokens in your Backstage app package.

Learn More