Cerbos JavaScript SDK
    Preparing search index...

    Module @cerbos/grpc - v0.24.1

    @cerbos/grpc

    npm

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

    • Cerbos 0.16+
    • Node.js 20+
    $ npm install @cerbos/grpc
    
    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.

    This package is ESM-only, but may be required from CommonJS modules in Node.js versions 20.19.5+, 22.15+, and 24+.

    Enumerations

    Compression

    Classes

    GRPC

    Interfaces

    ChannelOptions
    Options