Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@crayond_dev/idm-client-sdk

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crayond_dev/idm-client-sdk

## Description

  • 5.0.9
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
19
decreased by-34.48%
Maintainers
0
Weekly downloads
 
Created
Source

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);
  });

FAQs

Package last updated on 23 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc