Skip to main content
Deprecated version. We recommend upgrading to 4.x (latest). Follow the migration guides: 1.x to 2.x · 2.x to 3.x · 3.x to 4.x.
Version: 1.x (deprecated)

Install the 1.x package

Pin the last release of the major series when maintaining a legacy application:

bash
npm install @rbac/rbac@1.1.0

The 1.1.0 npm package exposes a JavaScript bundle through its main entry point. Use CommonJS to match the published package:

js
const RBAC = require('@rbac/rbac');

const auth = RBAC()({
  visitor: { can: ['posts:read'] },
  author: { inherits: ['visitor'], can: ['posts:create'] }
});

auth.can('author', 'posts:read').then(console.log); // true

The factory accepts an optional configuration object. The published 1.x README documents enableLogger and logger for logging decisions. No declaration entry point is published for TypeScript consumers.

This site preserves the historical API; it does not imply that 1.x is supported on modern Node.js versions. See migrating from 1.x for an upgrade path.