Cerbos JavaScript SDK
    Preparing search index...

    Interface Options

    Options for creating a new GRPC client.

    interface Options {
        adminCredentials?: AdminCredentials;
        channelOptions?: ChannelOptions;
        compression?: Compression;
        headers?: HeadersInit | (() => Awaitable<HeadersInit>);
        onValidationError?: "throw" | ValidationFailedCallback;
        playgroundInstance?: string;
        tls: boolean | SecureContext;
        userAgent?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    adminCredentials?: AdminCredentials

    Credentials for the admin API.

    undefined

    channelOptions?: ChannelOptions

    Advanced settings to configure the underlying gRPC client.

    {}

    compression?: Compression

    Compress messages exchanged between the client and policy decision point server.

    Requires the Cerbos policy decision point server to be at least v0.19.

    Compression.NONE

    headers?: HeadersInit | (() => Awaitable<HeadersInit>)

    Headers to add to every request to the policy decision point.

    Headers can be included in the policy decision point's audit logs by setting the includeMetadataKeys or excludeMetadataKeys fields in the audit configuration block.

    The User-Agent header is set using Options.userAgent.

    undefined

    onValidationError?: "throw" | ValidationFailedCallback

    Action to take when input fails schema validation.

    Possible values are

    undefined

    playgroundInstance?: string

    Identifier of the playground instance to use when prototyping against the hosted demo policy decision point.

    undefined

    tls: boolean | SecureContext

    Encrypt the gRPC connection with TLS.

    Possible values are

    • false - communicate via plaintext;

    • true - encrypt the connection with TLS, verifying the server identity with the default set of well-known root certificate authorities; or

    • the result of calling tls.createSecureContext, to configure custom root certificate authorities or client certificates for mutual TLS.

    userAgent?: string

    Custom user agent to prepend to the built-in value.

    undefined