Home > @cerbos/core > Client > getSchema
Fetch a schema by ID.
Signature:
getSchema(id: string, options?: RequestOptions): Promise<Schema | undefined>;
Parameter |
Type |
Description |
---|---|---|
id |
string | |
options |
(Optional) |
Returns:
Promise<Schema | undefined>
Requires
-
the client to be configured with Options.adminCredentials, and
-
the Cerbos policy decision point server to be configured with the admin API enabled.
const schema = await cerbos.getSchema("document.json");