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

@accesscontroll/sdk

v0.0.5

Published

AccessControl PEP SDK — shared PDP URL + per-app applicationId

Readme

@accesscontrol/sdk

Node PEP: calls a shared PDP for decisions and the PAP API for user sync.

Decisions:  App → POST /v1/decide → ALLOW / DENY
User sync:  App → POST /api/sdk/users/register|remove → PAP PortalUsers

Usage

import { create } from "@accesscontrol/sdk";

const ac = create({
  pdpUrl: process.env.AC_PDP_URL || "http://127.0.0.1:8181",
  papUrl: process.env.AC_PAP_URL || "http://127.0.0.1:8081",
  applicationId: process.env.AC_APPLICATION_ID,
  applicationSecret: process.env.AC_APPLICATION_SECRET,
});

// Authorization check (PDP) — pass role keys, not GUIDs
const { allowed } = await ac.check({
  user: { roles: ["user"], attributes: { family: "relative" } },
  resource: "shareddocs",
  action: "getfiles",
});

// Resource-set conditions may need resource attributes
await ac.check({
  user: { roles: ["user"], attributes: { family: "relative" } },
  resource: { key: "internal_files", attributes: { tag: "internal" } },
  action: "getfiles",
});

// UI permission map — role matrix, or matched user-set when attributes match
const { permissions } = await ac.getPermissions({
  roles: ["user"],
  attributes: { family: "relative" },
});

// Sync user on portal signup (PAP) — role key → group membership
await ac.registerUser({
  name: "Jane Doe",
  email: "[email protected]",
  externalId: "portal-user-uuid",
  role: "user",
  attributeValues: { family: "relative" },
});

// Remove user on portal delete (PAP)
await ac.removeUser({ email: "[email protected]" });

Environment

| Variable | Purpose | |----------|---------| | AC_PDP_URL | Decision service base URL | | AC_PAP_URL | Policy admin API base URL | | AC_APPLICATION_ID | Application UUID (from PAP URL) | | AC_APPLICATION_SECRET | App secret from PAP credentials page |

Methods

| Method | Target | Description | |--------|--------|-------------| | check | PDP | Allow/deny decision | | assert | PDP | Throws if denied | | checkMany | PDP | Batch decisions | | getPermissions | PDP | Grant map for UI | | decide | PDP | Raw decide response | | status | PDP | Bundle sync status | | register | PDP | Register app for polling | | resolveRolesByEmail | PAP | Look up group → role keys by email | | registerUser | PAP | Create or update portal user (idempotent by email) | | removeUser | PAP | Delete user by id, email, or externalId |

ABAC notes

  • User sets and resource sets are dynamic (condition when trees). There is no “add user to set.”
  • Send user.attributes on each check / getPermissions. When attributes match a user-set, the PDP uses that set’s matrix only; otherwise the role matrix.
  • PAP Custom Attribute Values are for admin testing / optional sync — the PDP does not read them at decide time unless your app forwards them as attributes.

registerUser

Creates a user in the RBAC system when a user is created in your portal. If the email already exists for the application, updates the record instead.

Pass role (PAP role key, e.g. "user"). PAP finds the group linked to that role and sets exclusive membership (one group per user). Do not pass group IDs from portal apps.

removeUser

Removes a user from the RBAC system when deleted in your portal. Provide one of: id, email, or externalId.