# IAM Libraries

## Identity Access and Management (IAM) Client Library

A [TypeScript](https://www.typescriptlang.org/) library that provides high-level functions related to the identity and access management (IAM) for all users, assets, organizations and applications that are anchored on the Energy Web Chain. This includes:

* Management of [Switchboard](broken://pages/-Mdw3Vke0uRCbFguK6gD#switchboard) namespaces
* [DID](/legacy-documentation/foundational-concepts/self-sovereign-identity-introduction.md#decentralized-identifiers-dids)/[DID Document](/legacy-documentation/foundational-concepts/self-sovereign-identity-introduction.md#did-documents) management
* Creation and governance of organizations, applications and their associated roles. Once created, these are persisted on the [IAM Cache Server](#identity-access-and-management-iam-cache-server)
* Claim requests, verification and issuance for role permissioning. Once created, claims are persisted on the [IAM Cache Server](#identity-access-and-management-iam-cache-server)
* [Staking ](/legacy-documentation/community-resources/using-the-energy-web-chain/staking.md#staking-overview)functionality

### Documentation Resources

* [GitHub Repository](https://github.com/energywebfoundation/iam-client-lib)
* [ReadTheDocs](https://energy-web-foundation-iam-client-lib.readthedocs-hosted.com/)
* [API](https://energy-web-foundation-iam-client-lib.readthedocs-hosted.com/api/globals/)

### Dependencies and Dependents

| EW-DOS Dependencies                                                         | EW-DOS Dependents                                              |
| --------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [DID Library](#did-library)                                                 | [Decentralized Service Bus](#decentralized-service-bus)        |
| [SSI Hub](#identity-access-and-management-iam-cache-server)                 | [Switchboard](broken://pages/-Mdw3Vke0uRCbFguK6gD#switchboard) |
| [IAM Smart Contracts](https://github.com/energywebfoundation/iam-contracts) |                                                                |

## DID Library

A class-based [TypeScript ](https://www.typescriptlang.org/)library that provides an abstraction layer to manage and interact with [DIDs ](/legacy-documentation/foundational-concepts/self-sovereign-identity-introduction.md#decentralized-identities-dids)and [Verifiable Credentials](/legacy-documentation/foundational-concepts/self-sovereign-identity-introduction.md#verifiable-credentials-vcs) on the [Energy Web Chain](/legacy-documentation/ew-dos-technology-components-2023/trust-layer-energy-web-chain.md#blockchain-consensus).

The DID Library enables users to adopt and/or implement different [DID methods](https://www.w3.org/TR/did-core/#dfn-did-methods), which promotes interoperability with other methods of decentralized identifiers. The DID library currently implements the [ERC1056 standard](https://eips.ethereum.org/EIPS/eip-1056) for creating and updating identities on the blockchain.

The DID library interacts with the Energy Web Chain using the [ethers.js library](https://docs.ethers.io/v5/).

### Documentation Resources

* [GitHub repository](https://github.com/energywebfoundation/iam-client-lib) (includes documentation)

### Dependencies and Dependents

| EW-DOS Dependencies                                                                                         | EW-DOS Dependents                                                                                                        |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [Energy Web Chain](/legacy-documentation/ew-dos-technology-components-2023/trust-layer-energy-web-chain.md) | [IAM client librar](#identity-access-and-management-cache-server)[y](#identity-access-and-management-iam-client-library) |

#### See an overview of all Identity and Access Management (IAM) components in EW-DOS [here](/legacy-documentation/foundational-concepts/self-sovereign-identity-introduction.md#ew-dos-identity-and-access-management-stack)

### Other Resources

* ["EW’s DID Library is open-source" on](https://medium.com/energy-web-insights/ewfs-did-library-is-open-source-1f355c95503e) [Medium](https://medium.com/energy-web-insights/ewfs-did-library-is-open-source-1f355c95503e)
* ["ERC1056 ❤ ERC780 — an open identity and claims protocol for Ethereum" on ](https://medium.com/uport/erc1056-erc780-an-open-identity-and-claims-protocol-for-ethereum-aef7207bc744)[Medium](https://medium.com/uport/erc1056-erc780-an-open-identity-and-claims-protocol-for-ethereum-aef7207bc744)
* [Ethereum Improvement Proposals](https://eips.ethereum.org/EIPS/eip-1056):[ EIP-1056: Ethereum Lightweight Identity](https://eips.ethereum.org/EIPS/eip-1056)

## Passport-DID-Auth

A backend class-based [TypeScript](https://www.typescriptlang.org/) library that allows other JavaScript/TypeScript applications to easily add authentication and authorization based on [Switchboard](broken://pages/-Mdw3Vke0uRCbFguK6gD#switchboard) roles to their applications. This allows any application to use Switchboard's decentralized approach to identity and access management.

### Documentation Resources

* [GitHub repository](https://github.com/energywebfoundation/passport-did-auth)

### Dependencies and Dependents

<table><thead><tr><th width="696">EW-DOS Dependencies</th><th>EW-DOS Dependents</th></tr></thead><tbody><tr><td><a href="#did-library">DID Library</a></td><td><a href="#identity-access-and-management-cache-server">IAM client librar</a><a href="#identity-access-and-management-iam-client-library">y</a></td></tr><tr><td><a href="#identity-access-and-management-iam-cache-server">SSI Hub</a></td><td></td></tr></tbody></table>

### Other Resources

* You can refer to the [Identity and Access Management (IAM) Client Examples ](https://github.com/energywebfoundation/iam-client-examples)application to see an example of Passport-DID-Auth integration into an application

## EW Credentials Library

A multi-package library for CRUD operations specific to Energy Web Verifiable Credentials. The repository is a module-based library built with [Lerna](https://github.com/lerna/lerna).

<table><thead><tr><th width="398">Package</th><th>Description</th></tr></thead><tbody><tr><td><a href="https://github.com/energywebfoundation/ew-credentials/blob/develop/packages/vc-verification"><code>@energyweb/vc-verification</code></a></td><td>Code to verify role based verifiable credential.</td></tr><tr><td><a href="https://github.com/energywebfoundation/ew-credentials/blob/develop/packages/credential-governance"><code>@energyweb/credential-governance</code></a></td><td>Smart contract and client code specific to EnergyWeb IAM roles.</td></tr><tr><td><a href="https://github.com/energywebfoundation/ew-credentials/blob/develop/packages/onchain-claims"><code>@energyweb/onchain-claims</code></a></td><td>exposes code to support role/claim lifecycle.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.energyweb.org/legacy-documentation/ew-dos-technology-components-2023/identity-and-access-management-iam/iam-libraries.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
