open-index/open-npm huggingface dataset:
npm package: @open-rights-exchange/practice-library
Description: This project is intended to be used by Aikon employees to understand the automated NPM publish process.
Latest version: 0.0.13

# A practice library to help experience NPM publish via Circle CI

This project is intended to be used by Aikon employees to understand the automated NPM publish process. 


Full instructions can be found [here](https://www.notion.so/aikon/Deploying-an-NPM-Package-485643f6c0b942c984ebfcd2b2ff55f3#efe162ba2c614fed91cb7112e3ebe713 ).
npm package: @open-rights-exchange/server
Description: Server library for ORE Protocol
Author: Open Rights Exchange
Latest version: 1.0.0

# About

A library for protecting an API with the [Open Rights Exchange protocol](https://github.com/Open-Rights-Exchange) 

# Usage

## Server
There are 2 ways to use this library. Both of the methods require verifier public key in the following format in the env file

```
VERIFIER_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\nMFkw....==\n-----END PUBLIC KEY-----"
```

### As an express middleware
With the verifier public key in the env file, supply an Express-style HTTP handler that services your API. Only valid requests will be served

```javascript
const { oreRequestValidator } = require('@open-rights-exchange/server')

app.use(oreRequestValidator())

```

### As a javascript function from the library
With the verifier public key in the env file, use the checkOreAccessToken function of the library

```javascript
const { oreRequestValidator } = require('@open-rights-exchange/server')

const isValidOreAcessToken = await checkOreAccessToken(req.headers['ore-access-token'], req)
```

# Publish NPM Package

Once published, package name will be:  @open-rights-exchange/server@{version}