5.0.9 • Published 11 months ago

@crayond_dev/idm-client-sdk v5.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

IDMClient

Description

IDMClient is an npm package that provides a client SDK for working with the IDM (Identity Management) service. It allows you to interact with the service and use it.

Installation

To install IDMClient, you can use npm or yarn:

npm install @crayond_dev/idm-client-sdk

# or

yarn add @crayond_dev/idm-client-sdk

Usage

Importing IDMClient

import IDMClient from "@crayond_dev/idm-client-sdk";

# or

import { IDMClient } from "@crayond_dev/idm-client-sdk";

Creating an Instance

To create an instance of IDMClient,

const params = {
  apiKey: "<YOUR_API_KEY>", // Replace with your API key
};

const idmClient = new IDMClient(params);

Get configured Roles

The IDMClient class exposes a method called getRoles, which allows you to fetch the roles configured.

idmClient.getRoles()
  .then((roles) => {
    # Your Code here
  })
  .catch((error) => {
    console.error(error);
  });

Initialize IDM client

The IDMClient class exposes a method called initialize, which fetches the permission from the service and stores in the storage option provided. Default storage will be localStorage. Supported storage types - LocalStorage, SessionStorage, AsynStorage.

idmClient.initialize("<Role_ID>")
  .then((response) => {
    # Your Code here
  })
  .catch((error) => {
    console.error(error);
  });

validate access

The IDMClient class exposes a method called validate, which validates the access for the given repoId and access type.

idmClient.validate(["<REPO_ID>", "<REPO_ID>", ...], ["create", "read", "update", "delete"])
  .then((response) => {
    # Your Code here
  })
  .catch((error) => {
    console.error(error);
  });
5.0.6

1 year ago

5.0.5

1 year ago

5.0.4

1 year ago

5.0.3

1 year ago

5.1.0

1 year ago

5.0.9

11 months ago

5.0.8

11 months ago

5.0.7

11 months ago

5.0.2

1 year ago

5.0.1

1 year ago

5.0.0

1 year ago

4.1.0

2 years ago

4.0.0

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

1.1.0

2 years ago

1.0.7

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago