# @digitalbazaar/zcap-context

> Authorization Capability (ZCAP) JSON-LD context for JavaScript.

Latest version **2.0.1** (published 2024-11-14) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @digitalbazaar/zcap-context
pnpm add @digitalbazaar/zcap-context
yarn add @digitalbazaar/zcap-context
bun add @digitalbazaar/zcap-context
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2024-11-14 |
| First published | 2022-01-11 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Digital Bazaar, Inc. |
| Maintainers | dlongley, msporny, davidlehn, mattcollier, gannan |

## Links

- npm: https://www.npmjs.com/package/@digitalbazaar/zcap-context
- Repository: https://github.com/digitalbazaar/zcap-context
- Homepage: https://github.com/digitalbazaar/zcap-context#readme
- Issues: https://github.com/digitalbazaar/zcap-context/issues
- npm.io page: https://npm.io/package/@digitalbazaar/zcap-context

## Recent versions

- 2.0.1 (latest) — 2024-11-14
- 2.0.0 — 2022-01-11

## README

# Authorization Capabilities (zCap) Context Repository _(@digitalbazaar/zcap-context)_

[![Build status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/zcap-context/main.yml)](https://github.com/digitalbazaar/zcap-context/actions/workflow/main.yml)
[![NPM Version](https://img.shields.io/npm/v/@digitalbazaar/zcap-context.svg)](https://npm.im/@digitalbazaar/zcap-context)

> An Authorization Capability (zCap) JSON-LD context for JavaScript.

## Table of Contents

- [Background](#background)
- [Install](#install)
- [Usage](#usage)
- [Developing](#developing)
- [Commercial Support](#commercial-support)
- [License](#license)

## Background

See also (related specs):

* [Authorization Capabilities for Linked Data v0.3](https://w3c-ccg.github.io/zcap-spec/)

## Install

Requires Node.js 12+

To install via NPM:

```
npm install @digitalbazaar/zcap-context
```

## Usage

```js
const zcap = require('@digitalbazaar/zcap-context');

zcap.CONTEXT_URL
// 'https://w3id.org/zcap/v1'

// Codec term map value for CBOR-LD
zcap.constants.CBORLD_VALUE
// 0x1A

// get context data for a specific context
zcap.CONTEXT
// full context object
```

This package can be used with bundlers, such as [webpack][], in browser
applications.

## API

The library exports the following properties:
- `CONTEXT_URL`
- `CONTEXT`
- `constants`: A Object that maps constants to well-known context URLs. The
  main constant `CONTEXT_URL` may be updated from time to time to the
  latest context location.
- `contexts`: A `Map` that maps URLs to full context data.
- `appContextMap`: For use with `cborld` library.

## Developing

WARNING: The `.jsonld` in `contexts/` is auto-generated by the `npm run build` script,
each time you run the test suite.

DO NOT edit it directly (or your changes will be quickly overwritten).
Instead, make all context changes to `js/context.js`.

## Commercial Support

Commercial support for this library is available upon request from
Digital Bazaar: support@digitalbazaar.com

## License

- BSD 3-Clause © Digital Bazaar
- See the [LICENSE](./LICENSE) file for details.

[webpack]: https://webpack.js.org/

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