# @digitalbazaar/security-context

> Compact isomorphic clone of ccg security-context.

Latest version **1.0.1** (published 2023-06-13) · BSD-3-Clause license · 0 weekly downloads

## Install

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

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-06-13 |
| First published | 2021-04-24 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 24.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Digital Bazaar, Inc. |
| Maintainers | dlongley, msporny, davidlehn, mattcollier, gannan |

## Links

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

## Recent versions

- 1.0.1 (latest) — 2023-06-13
- 1.0.0 — 2021-04-24

## README

# Linked Data Security Context Repository _(@digitalbazaar/security-context)_

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

> Compact isomorphic clone of CCG's security-context.

## Table of Contents

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

## Background

This is a copy of the [Linked Data Security Vocabulary](https://github.com/w3c-ccg/security-vocab)
context, with a refactored export to make it easier to use in the browser and
in React Native.

## Install

Requires Node.js 12+

To install via NPM:

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

## Usage

```js
import secCtx from '@digitalbazaar/security-context';
// or
const secCtx = require('@digitalbazaar/security-context');
const {contexts, constants} = secCtx;

secCtx.CONTEXT_URL
// 'https://w3id.org/security/v2'
secCtx.SECURITY_CONTEXT_V1_URL
// 'https://w3id.org/security/v1'
secCtx.SECURITY_CONTEXT_V2_URL
// 'https://w3id.org/security/v2'

// get context data for a specific context
secCtx.contexts.get(secCtx.SECURITY_CONTEXT_V2_URL)
// security/v2 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` and `CONTEXT` (it's recommended that context repositories only export one 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.

## 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/security-context · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
