Skip to content

Latest commit

 

History

History
80 lines (39 loc) · 1.38 KB

embedded.embedded._constructor__1.md

File metadata and controls

80 lines (39 loc) · 1.38 KB

Home > @cerbos/embedded > Embedded > (constructor)

Embedded.(constructor)

Create a client for interacting with an embedded Cerbos policy decision point (PDP), using the default Loader to load the embedded PDP bundle.

Signature:

constructor(source: Source, options?: Options);

Parameters

Parameter

Type

Description

source

Source

WebAssembly binary code of an embedded PDP bundle, or a URL or HTTP response from which to stream it.

options

Options

(Optional) additional settings.

Remarks

This is equivalent to new Embedded(new Loader(source, options)).

Bundle download URLs are available in the "Embedded" section of the "Decision points" page of your Cerbos Hub workspace.

Example

Fetch an embedded PDP bundle via HTTP in a supported browser or Node.js 18.1+:

const cerbos = new Embedded("https://lite.cerbos.cloud/bundle?workspace=...&label=...");