eunomia-sdk-typescript
v0.3.4
Published
Eunomia SDK for TypeScript
Downloads
4
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-typescript package via npm:
npm install eunomia-sdk-typescriptUsage
Create an instance of the EunomiaClient class to interact with the Eunomia server.
import { EunomiaClient, EntityType } from "eunomia-sdk-typescript";
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.
