# anvil-connect-sdk

> Nodejs SDK for Anvil Connect

Latest version **0.1.11** (published 2015-04-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install anvil-connect-sdk
pnpm add anvil-connect-sdk
yarn add anvil-connect-sdk
bun add anvil-connect-sdk
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.11 |
| Published | 2015-04-08 |
| First published | 2014-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Known vulnerabilities | 0 (+10 in 5 direct dependencies) |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Christian Smith |
| Maintainers | christiansmith |
| Keywords | OpenID, OpenID Connect, OAuth, OAuth 2.0, Anvil, Anvil Connect, Authentication, Authorization |

## Links

- npm: https://www.npmjs.com/package/anvil-connect-sdk
- Repository: https://github.com/christiansmith/anvil-connect-nodejs
- Issues: https://github.com/christiansmith/anvil-connect-nodejs/issues
- npm.io page: https://npm.io/package/anvil-connect-sdk

## Dependencies (9)

- [jwa](https://npm.io/package/jwa.md) 0.0.2
- [async](https://npm.io/package/async.md) ~0.9.0
- [lodash](https://npm.io/package/lodash.md) ~2.4.1
- [uri-js](https://npm.io/package/uri-js.md) ~1.4.2
- [request](https://npm.io/package/request.md) ~2.34.0
- [base64url](https://npm.io/package/base64url.md) 0.0.6
- [superagent](https://npm.io/package/superagent.md) ~0.18.0
- [form-urlencoded](https://npm.io/package/form-urlencoded.md) 0.0.6
- [anvil-connect-jwt](https://npm.io/package/anvil-connect-jwt.md) ^0.1.2

## 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

- 0.1.11 (latest) — 2015-04-08
- 0.1.10 — 2014-12-17
- 0.1.9 — 2014-12-17
- 0.1.8 — 2014-10-25
- 0.1.7 — 2014-10-25
- 0.1.6 — 2014-10-20
- 0.1.5 — 2014-08-08
- 0.1.4 — 2014-08-07
- 0.1.3 — 2014-08-07
- 0.1.2 — 2014-07-16
- 0.1.1 — 2014-06-18
- 0.1.0 — 2014-06-17

## README

# Node SDK for Anvil Connect

**[Anvil Connect](https://github.com/christiansmith/anvil-connect)** aims to be a scalable, full-featured, ready-to-run [**OpenID Connect**](http://openid.net/connect/) + [**OAuth 2.0**](http://tools.ietf.org/html/rfc6749) **Provider**. This package is a SDK for Nodejs client developers.


### Install

```bash
$ npm install anvil-connect-sdk --save
```

### Usage

Configuration example:

```javascript
var anvil = require('anvil-connect-sdk');

anvil.configure({
  provider: {
    uri: 'https://your.authorization.server',
    key: '/path/to/public.key.pem'
  },
  client: {
    id: 'uuid',
    token: 'client.jwt.access.token'
  },
  params: {
    redirectUri: 'https://your.client.tld/callback'
  }
});
```


### Protecting Services

Anvil Connect SDK includes Connect/Express/Restify compatible middleware for authenticating access tokens issued by Anvil Connect and enforcing authorization based on OAuth 2.0 scope.

This middleware can be used as route specific middleware...

```javascript
var authorize = anvil.verify({ scope: 'research' });

server.post('/protected', authorize, function (req, res, next) {
  // handle the request
});
```

...or to protect the entire server:

```javascript
server.use(anvil.verify({ scope: 'research' }));
```

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