Cerbos JavaScript SDK
    Preparing search index...

    Class StoresClient

    A client for interacting with policy stores in Cerbos Hub.

    Index

    Constructors

    Methods

    • Replace files in a policy store.

      Parameters

      Returns Promise<ReplaceFilesResponse>

      This is a "put" operation; files that aren't included in the request will be removed from the store.

      Upload individual files:

      const { newStoreVersion } = await stores.replaceFiles({
      storeId: "MWPKEMFX3CK1",
      contents: {
      files: [
      {
      path: "policy.yaml",
      contents: await readFile("path/to/policy.yaml"),
      },
      ],
      },
      });

      Upload zipped files:

      const { newStoreVersion } = await stores.replaceFiles({
      storeId: "MWPKEMFX3CK1",
      contents: {
      zipped: await readFile("path/to/policies.zip"),
      },
      });