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

@ikonintegration/idmclient

v5.3.3

Published

IDM browser & nodejs API client

Downloads

1,708

Readme

IDM-client Node.js Package

IDM browser & nodejs API client

Overall

  • npm npm npm (tag) Libraries.io dependency status for latest release, scoped npm package
  • GitHub commit activity
  • GitHub last commit

Opts

{
//General Configs
    apiEndpoint: 'https://api.auth-dev.AA-AA.ca',
    cookiesEndpoint: 'https://auth-dev.AA-AA.ca',
    
	  //disable client logs to console
    disableLogs?: false, 
    
    //if false it will add 10 minutes gap to JWT expiration to make sure we renew it before actually using it.
    jwtAPIMode?: false, 

    //auto enrol role, can be an array of roles. After login, client will auto enroll user into specified roles (if not present on logged JWT) and will return login response only after enrollement.
    autoEnrollRole?: 'AAA', 

    //enable sso code to redirect URIs (on CB URL impersonate feature)
    enableSSOCodeOnRedirects: false,

    //disable impersonate feature (can be enabled on the sender and receiver)
    disableImpersonatingApp: true,
    
//External auth mode
    externalAuth: true, //should use external authentication (redirect)
    externalAuthDomain?: 'auth-dev.AA-AA.ca', 
    externalAuthPath?: '/login',
    externalValidatePath?: '/validate',
    externalRegistrationPath?: '/register',
    externalProfilePath?: '/profile',
    
//Facilitators
    //Roles mapping
    roles?: { //Optional roles
      USER: 'AA-AA',
    },
    
	//Partitions mapping
    partitions?: { //Optional partitions mapping
      PROFESSIONAL: 'AA',
    },
  }

Configure Cookies Hub on the website

Create separated build process

- `mkdir cookiesHub && cd cookiesHub && npm init -y && npm install --save-dev webpack webpack-cli babel-loader @babel/core @babel/preset-env @babel/runtime @babel/plugin-transform-runtime @babel/plugin-proposal-decorators @babel/plugin-proposal-class-properties && npm i -S cross-storage`
- Add into `cookiesHub/package.json`
  ```
    "scripts": {
        "clean": "rm ../public/hub/index.js",
        "build-dev": "webpack --mode development",
        "build": "webpack --mode production"
      },
  ```

Setup Hub build

  • Add into cookiesHub/babel.config.js
module.exports = function (api) {
  api.cache(false);
  const presets = [
      [ "@babel/preset-typescript"],
      [
          "@babel/preset-env",
          {
              "corejs": { "version": 3 },
              "useBuiltIns": "usage",
              "targets": { "edge": "17", "firefox": "60", "chrome": "67", "safari": "11.1", "ie": "11" }
          }
      ]
  ];
  const plugins = [
      ["@babel/plugin-proposal-decorators",{"decoratorsBeforeExport":true}],
      ["@babel/plugin-proposal-class-properties"],
      ["@babel/transform-runtime"]
  ];
  return { presets, plugins };
};
  • Add into cookiesHub/webpack.config.js
const webpack = require('webpack');
const path = require('path');
const config = {
  entry: './index.js',
  output: {
    path: path.resolve(__dirname, '../public/hub'),
    filename: 'index.js'
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        use: 'babel-loader',
        exclude: /node_modules/
      }
    ]
  }
};

module.exports = config;

Create hub source

  • Create index.html at public/hub/index.html with the following content:
	<!DOCTYPE html>
	<html lang="en"><head> </head> <body> <script src="./index.js"> </script> </body> </html>
  • Create index.js at cookiesHub/index.js with the following contents :
  import "core-js/stable";
  //Config
  const config = require('../src/app/config/config');
  //Hub
  const CrossStorageHub = require('cross-storage').CrossStorageHub;
  const DefaultCookiesHubPermissioning = ['get', 'set', 'del'];
  /* Private helper */
  function _transformDomainToHubFormat(domainsList) {
    return domainsList.map((domain) => {
      if (domain.includes('*')) return `\.${domain}$`;
      else return `:\/\/(www\.)?${domain}$`;
    }).map((regex) => {
      return { origin: new RegExp(regex), allow: DefaultCookiesHubPermissioning };
    });
  }
  //Open hub
  const allowedDomains = _transformDomainToHubFormat(Object.keys(config.ThemeDomainsMapping));
  CrossStorageHub.init(allowedDomains);

Modify your build

  • Add cd cookiesHub && npm i && npm run build as a npm script. (build-hub)
  • Add npm run build-hub to the start of your build instructions. (Example package.json:scripts:build)
  • Also add npm run build-hub to start of you start script to allow local usage.
  • This will generate the /public/hub/index.js at build time, so include it on .gitignore
  • Add the following to your buildspec.yml file
    • aws s3 cp --acl public-read --cache-control="max-age=0, no-cache, no-store, must-revalidate" ./hub/index.html s3://${DEPLOY_BUCKET}/hub
    • aws s3 cp --acl public-read --cache-control="max-age=0, no-cache, no-store, must-revalidate" ./hub/index.js s3://${DEPLOY_BUCKET}/hub
    • Add /hub/* to your cloud front invalidation on buildpsec.yml