0.5.0-beta • Published 2 years ago

@cerbos/lite v0.5.0-beta

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

@cerbos/lite

npm

Client library for interacting with WebAssembly Cerbos policy bundles from server-side Node.js and browser-based applications.

Prerequisites

  • Node.js 18+

Installation

$ npm install @cerbos/lite

Example usage

import { Lite } from "@cerbos/lite";

const cerbos = new Lite(fetch("/policies.wasm"));

await cerbos.isAllowed({
  principal: {
    id: "user@example.com",
    roles: ["USER"],
    attr: { tier: "PREMIUM" },
  },
  resource: {
    kind: "document",
    id: "1",
    attr: { owner: "user@example.com" },
  },
  action: "view",
}); // => true

For more details, see the Lite class documentation.

Further reading

Get help

0.5.0-beta

2 years ago

0.4.0-beta

2 years ago

0.3.1-alpha

2 years ago

0.4.1-beta

2 years ago

0.3.0-alpha

2 years ago

0.2.2-alpha

2 years ago

0.2.1-alpha

2 years ago

0.2.0-alpha

2 years ago

0.1.1-alpha

3 years ago

0.1.0-alpha

3 years ago