NPM package for the OBv3 (Open Badges version 3) JSON-LD context.
npm install @digitalcredentials/open-badges-context

> NPM package for the OBv3 (Open Badges version 3) JSON-LD context.
- Background
- Install
- Usage
- Developing
- License
For use with JSON-LD document loaders (such as
the DCC security-document-loader
or DigitalBazaar's jsonld-document-loader).
Requires Node.js 14+
To install via NPM:
```
npm install @digitalcredentials/open-badges-context
`js
import obCtx from '@digitalcredentials/open-badges-context';
// or
const obCtx = require('@digitalcredentials/open-badges-context');
obCtx.CONTEXT_URL_V3
// 'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json' <-- Latest URL
// get context data for a specific context
obCtx.contexts.get(obCtx.CONTEXT_URL_V3)
// full context object
`
This package can be used with bundlers, such as webpack,
in browser applications.
The library exports the following properties:
- Various OBv3 @context URLs, such as:CONTEXT_URL_V3
, CONTEXT_URL_V3_0_0, CONTEXT_URL_V3_0_3 etc.contexts
- : A Map that maps URLs to full context data.
See index.js for full list of exports.
When adding a new @context, do all of the following:
1. Add the new context file to js/contextsjs/index.js
2. Update rollup.config.js
3. Update with the new exportscontext.spec.js` with the new exports
4. Update
5. Update README / Usage section.