Package Exports
- iam-client-lib
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (iam-client-lib) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Identity and Access Management (IAM) Client Library
TypeScript library to be used within decentralized applications for authentication and authorization using DIDs (Decentralized Identifiers) and VCs (Verifiable Credentials)

Live Demos
React Demo /
Angular Demo /
Vue Demo
Documentation
Getting Started
For development purposes, please follow below steps to integrate the library with your dApps.
Prerequisites
iam-client-lib is written in TypeScript. Make sure to have Node.js (>= v10) installed.
Create a folder named iam-client-lib and clone this GIT project.
Installing Dependencies
Using npm to install dependencies:
$ npm installCompile & Build
To generate bundled JS files and types, use the following command. Generated files are located in the dist folder.
$ npm run buildLink as node_module
If your dApp is using node_modules for dependencies, call the following command from your dApp's main folder.
Make sure that your dApp preserves symbolic links (symlink) as below command creates one inside your node_modules folder.
$ npm link ../path/to/iam-client-lib/The iam-client-lib folder must now exist in your node_modules folder.
Add library as a dependency
You can add this library as a dependency
$ npm i https://github.com/energywebfoundation/iam-client-lib.git#branch_nameSample Import (TypeScript)
import { IAM, CacheServerClient } from 'iam-client-lib';
export class Sample {
private _iam: IAM;
constructor() {
// create default cache server client (optional)
const cacheClient = new CacheServerClient({ url: 'http://cache-server.com'})
// create IAM instance with provided rpc URL
this._iam = new IAM({
rpcUrl: 'https://volta-rpc.energyweb.org/',
chainId: 73799,
cacheClient // optional
});
}
async initializeIAM() {
// this will show connection modal and authenticate
const { did, connected } = await this._iam.initializeConnection();
// after successfully authentication you can retrieve the signer
const signer = this._iam.getSigner();
}
Active Maintainers
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
License
This project is licensed under the GNU General Public License v3.0 or later - see the LICENSE file for details
FAQ
Frequently asked questions and their answers will be collected here.