Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eunomia-sdk

whataboutyou-ai8Apache-2.00.3.9TypeScript support: included

Eunomia SDK for TypeScript

eunomia, sdk, typescript

readme

Eunomia SDK for TypeScript

This package allows you to integrate Eunomia inside your TypeScript application, providing a client to interact with the Eunomia server.

Installation

Install the eunomia-sdk package via npm:

npm install eunomia-sdk

Usage

Create an instance of the EunomiaClient class to interact with the Eunomia server.

import { EunomiaClient, EntityType } from "eunomia-sdk";

const client = new EunomiaClient();

You can then call any server endpoint through the client. For example, you can check the permissions of a principal to perform an action on a resource:

async function check() {
  const response = await client.check({
    principalAttributes: { role: "admin" },
    resourceAttributes: { type: "confidential" },
  });

  console.log(`Is allowed: ${response.allowed}`);
}

Documentation

For detailed usage, check out the SDK's documentation.