Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@cerbos/grpc

cerbos34.2kApache-2.00.22.0TypeScript support: included

Client library for interacting with the Cerbos policy decision point service over gRPC from server-side Node.js applications

Cerbos, authorization, access control, roles, permissions, policy, security, role-based access control, RBAC, attribute-based access control, ABAC, policy decision point, PDP, gRPC, server-side

readme

@cerbos/grpc

npm

Client library for interacting with the Cerbos policy decision point service over gRPC from server-side Node.js applications.

Prerequisites

  • Cerbos 0.16+
  • Node.js 20+

Installation

$ npm install @cerbos/grpc

Example usage

import { GRPC } from "@cerbos/grpc";

const cerbos = new GRPC("localhost:3593", { tls: false });

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 GRPC class documentation.

Further reading

Get help