# credential-status

> credential status aggregator for did-jwt

Latest version **3.0.4** (published 2024-03-26) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install credential-status
pnpm add credential-status
yarn add credential-status
bun add credential-status
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.4 |
| Published | 2024-03-26 |
| First published | 2019-10-31 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 64.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Mircea Nistor |
| Maintainers | simonas-notcat, mirceanis, uport-automation-bot |
| Keywords | Verifiable Credential, W3C, status check, revocation, credentialStatus, JWT |

## Links

- npm: https://www.npmjs.com/package/credential-status
- Repository: https://github.com/uport-project/credential-status
- Homepage: https://github.com/uport-project/credential-status#readme
- Issues: https://github.com/uport-project/credential-status/issues
- npm.io page: https://npm.io/package/credential-status

## Dependencies (2)

- [did-jwt](https://npm.io/package/did-jwt.md) ^8.0.0
- [did-resolver](https://npm.io/package/did-resolver.md) ^4.1.0

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 3.0.4 (latest) — 2024-03-26
- 3.0.3 — 2024-03-20
- 3.0.2 — 2024-03-14
- 3.0.1 — 2024-02-28
- 3.0.0 — 2024-01-26
- 2.0.6 — 2023-08-09
- 2.0.5 — 2022-08-10
- 2.0.4 — 2022-08-02
- 2.0.3 — 2022-06-08
- 2.0.2 — 2022-05-12
- 2.0.1 — 2022-05-11
- 2.0.0 — 2022-02-16
- 1.2.4 — 2022-01-19
- 1.2.3 — 2022-01-19
- 1.2.2 — 2021-01-20
- … 6 more at https://npm.io/package/credential-status/versions

## README

# credential-status

[![codecov](https://codecov.io/gh/uport-project/credential-status/branch/develop/graph/badge.svg)](https://codecov.io/gh/uport-project/credential-status)

A status method aggregator for verifiable credentials.

## Usage

Given a JWT credential that embeds a `status` property, it should call the appropriate status checking method and return
its result. This library is meant to be used with `did-jwt`, as a status method aggregator called during the
verification step.

Example:

A JWT with a status field in the payload.vc field:

```json
{
  "credentialStatus": {
    "id": "mainnet:0xStatusRegistryAddress",
    "type": "EthrStatusRegistry2019"
  },
  "iss": "did:ethr:0x...",
  "vc": {
    //...
  }
  //...
}
```

```ts
import { EthrStatusRegistry } from 'ethr-status-registry'
import { Status } from 'credential-status'
//...other JWT verification inits

const status = new Status({
  ...new EthrStatusRegistry(config).asStatusMethod,
})

const verificationResult = await didJWT.verifyJWT(token, resolver)
const didDoc = verificationResult.doc

const result = await status.checkStatus(token, didDoc)
// result: { "revokedAt": "0x5348684" }

```

The individual methods used to check for the status need to implement a `checkStatus` method and are expected to use the
provided issuer DID document to help generate a result.

### Results

There is no standard format for the result of a status check. It is up to the method implementer to provide their own,
and ultimately up to verifiers of credentials to determine which methods they support or accept.

## Known methods

The only known implementation of a credential-status method is
the [ethr-status-registry](https://github.com/uport-project/ethr-status-registry) which uses an ethereum smart contract
to register revocations of credentials.

If you implement your own status check, feel free to submit a link to it here.

---
_Source: https://npm.io/package/credential-status · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
