npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@34fame/rijs

v0.2.2

Published

RapidIdentity Javascript SDK

Downloads

49

Readme

RapidIdentity JavaScript SDK

Open Source SDK to simplify building custom applications for RapidIdentity.

RapidIdentity is an Identity and Access Management platform by Identity Automation.

Use this SDK to simplify the process of creating custom integrations. Both cloud and on-premises deployments are supported.

Getting started

Pre-requisites

You must have RapidIdentity deployed and accessible to clients via https.

Installation

This SDK can be installed in client or server (node.js) using npm or yarn.

npm install @34fame/ridjs

Node.js

Import the SDK in Node.js.

const rijs = require('@34fame/rijs')

Client Framework

Import the SDK in vanilla JavaScript or framework.

import rijs from '@34fame/rijs'

Usage

Config

Every call requires a configuration object. This lets the SDK know where to find your instance.

const config = {
   host: 'acme.rapididentity.com', // Only include host or ip address
   port: 443, // default: 443
   token: '<access_token>', // Provided by `login` endpoint
}

Login

Initiate user session with the login endpoint. It will return an access token that will be required in all future calls.

import rijs from '@34fame/rijs'

const login = async (username, password) => {
   try {
      const token = rijs.login(config, username, password)
      if (!token) return false
      config.token = token
      // other token handler code
      return token
   } catch (err) {
      console.error('login error', err)
      return false
   }
}

Logout

Closes user session.

import rijs from '@34fame/rijs'

const logout = async () => {
   try {
      await rijs.logout(config)
      return true
   } catch (err) {
      console.error('logout error', err)
      return false
   }
}

License

Retrieve the active RapidIdentity license.

rijs.license(config)

User Profile

Retrieve the authenticated user's profile. This is an abbreviated list of attributes to identify the user

rijs.userProfile(config)

User Data

Retrieve the authenticated user's data. This includes an aggregate of all attribute values from all authorized delegations. The id value can be retrieved from the userProfile() function.

rijs.userData(config, id)

User Roles

Retrieve the authenticated user's RapidIdentity roles.

rijs.userRoles(config)

User Applications

Retrieve the authenticated user's RapidIdentity application objects.

rijs.userApplications(config)

Users

Retrieve list of users visible to the authenticated user.

rijs.users(config)

Generic API Call

You can call any RapidIdentity API endpoint with callApi. This way you can continue to use this SDK for everything. You just need to know the endpoints method, url, and data requirements, most of which can be found in in your instances API documentation (https://host/api/rest/api-docs)

// Get user applications
rijs.callApi({
   config,
   method: 'get',
   url: '/apps/v2/my/applications',
})

// Create a user (sponsorship)
rijs.callApi({
   config,
   method: 'post',
   url: '/sponsorship/sponsoredAccounts',
   data: {
      givenName: 'Robert',
      surname: 'Johnson',
      email: '[email protected]',
      sponsorDN: '<sponsorDn>',
   },
})

Licensing

The code in this project is licensed under MIT license.