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

@haventec/user-management-sdk

v1.0.0

Published

Your backend service can use this SDK to manage users and devices in the Haventec Identity Platform.

Downloads

2

Readme

Haventec User Management Node.js SDK

Your backend service can use this SDK to manage users and devices in the Haventec Identity Platform.

This project contains a demo app explained in the section "Demo application" on this README file.

Prerequisites

  • Run the native-ux-adapter-sdk to activate or login the user.
    • Refer to the README.md file in native-ux-adapter-nodejs-sdk to understand how to activate a user by calling the 'activateUserOrDevice' method or how to log in a user by calling the 'loginPinDevice' method.
    • Fetch 'iamUserJwt' and 'deviceUuid' from the response of the above method and mention those against iam.user.jwt and haventec.device.uuid respectively in the 'config.properties' file.

Requirements

  • Node.js

  • Typescript (tsc) : version 4.1.5

Type the following command to install tsc as a dev dependency.

npm install --save-dev [email protected]

Installation

Install user-management-sdk dependency by following below command.

npm install @haventec/[email protected]

Usage

Instantiate the class "HaventecManagement" with your environment variables at your platform by adding it in config.properties:

Note: Please refer to the keycloak documentation: https://docs.haventec.com/docs/authenticate/v1.2/integrations/keycloak-iam to understand how to create the realm, idp and idp alias.

  • iam.realm: The name of your company Realm at the Haventec IAM e.g.: xyzCorp
  • iam.admin.client: The Haventec IAM client in the iam.realm with 'Access Type' : confidential
  • iam.admin.client.secret: The Haventec IAM client secret is the value beside the 'Secret' label on the 'Credentials' tab of the iam.admin.client
  • iam.idp.alias: The identity provider alias at the Haventec IAM e.g.: oidc
  • iam.base.url: The URL of the Identity Access Management (IAM). Demo Haventec IAM is found at:
    • https://iam.demo.haventec.com/auth and production is at:
    • https://iam.haventec.com/auth
  • iam.user.jwt The IAM JWT of the user once the user is successfully activated or logged-in, as explained in the 'Prerequisites' section on this README file.
  • haventec.app.client.id: The client ID of the application in Haventec Console. e.g.: 13f9d956-9bcc-447f-b7c1-7719cb53901d
  • haventec.app.apikey: The API Key of the application in Haventec Console. e.g.: 9dc54gg8-abc5-4abc-a1bc-d6d7abc42cb
  • haventec.authenticate.url: The URL of the Haventec Authenticate Demo is found at:
    • https://api-demo.haventec.com/ and production is at:
    • https://api.haventec.com/
  • haventec.device.uuid The device uuid of the activated or logged-in user, as explained in the 'Prerequisites' section on this README file. e.g.: 250f7812-4258-4c11-98dc-96258a215368

and then you can start using any of the methods within the SDK:

  • lockDevice: Lock a device

    accessToken : string;
    deviceUuid : string;
  • unlockDevice: UnLock a device

    accessToken : string;
    deviceUuid : string;
  • updateDevice: Update a device

    accessToken : string;
    deviceUuid : string;
    deviceName : string;
  • deleteDevice: Delete a device

    accessToken : string;
    deviceUuid : string;
  • getUserDetails: Get user details

    accessToken : string;
    deviceUuid : string;

    UserDetailsResponse

    userUuid: string;
    username: string;
    email: string;
    active: boolean;
    locked: boolean;
    dateCreated: number;
    lastLogin: number;
    mobileNumber: string;
    forbidAddingDevices: boolean;
  • getDevices: Get all devices for a user

    accessToken : string;

    UserDevicesResponse

    devices: Array<DeviceResponse>;

Demo application

The demo application guides you manage user and device to demonstrate the different user flows.

  1. Access the demo folder and create a personal config.properties file based on the template:
cd demo
cp config.properties.template config.properties
  1. Fill in the environment variables described on the previous section.

  2. Run the demo

npm run demo1

License

This code is available under the MIT license. A copy of the license can be found in the LICENSE file included with the distribution.