Skip to content

Latest commit

 

History

History
82 lines (41 loc) · 1.17 KB

http.http._constructor_.md

File metadata and controls

82 lines (41 loc) · 1.17 KB

Home > @cerbos/http > HTTP > (constructor)

HTTP.(constructor)

Create a client for interacting with the Cerbos policy decision point (PDP) server over HTTP.

Signature:

constructor(baseUrl: string, options?: Options);

Parameters

Parameter

Type

Description

baseUrl

string

base Cerbos PDP server URL (the Cerbos REST API must be available at ${baseUrl}/api/).

options

Options

(Optional) additional client settings.

Example 1

Connect via HTTP:

const cerbos = new HTTP("http://localhost:3592");

Example 2

Connect to the hosted demo PDP to experiment in the playground:

const cerbos = new HTTP("https://demo-pdp.cerbos.cloud", { playgroundInstance: "gE623b0180QlsG5a4QIN6UOZ6f3iSFW2" });