# donny-auth

> A client library for authenticating with the donny-auth system

Latest version **1.6.1** (published 2022-10-11) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install donny-auth
pnpm add donny-auth
yarn add donny-auth
bun add donny-auth
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.1 |
| Published | 2022-10-11 |
| First published | 2017-10-25 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 88.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Fabien O'Carroll |
| Maintainers | brandwatch, spmason, chrisskilton |

## Links

- npm: https://www.npmjs.com/package/donny-auth
- npm.io page: https://npm.io/package/donny-auth

## Dependencies (3)

- [url-parse](https://npm.io/package/url-parse.md) ^1.5.10
- [es6-promise](https://npm.io/package/es6-promise.md) ^4.2.8
- [@brandwatch/frame-rpc](https://npm.io/package/@brandwatch/frame-rpc.md) ^2.0.1

## Recent versions

- 1.6.1 (latest) — 2022-10-11
- 1.6.0 — 2022-10-11
- 1.5.7 — 2021-02-24
- 1.5.6 — 2018-07-06
- 1.5.5 — 2018-06-20
- 1.5.4 — 2018-06-20
- 1.5.2 — 2018-06-07
- 1.5.1 — 2018-06-01
- 1.5.0 — 2018-05-24
- 1.4.0 — 2018-05-21
- 1.3.0 — 2018-04-11
- 1.2.0 — 2018-04-04
- 1.1.3 — 2018-01-15
- 1.1.2 — 2018-01-12
- 1.1.1 — 2018-01-12
- … 4 more at https://npm.io/package/donny-auth/versions

## README

# donny-auth

A client library for authenticating with the donny-auth system

### install

```
yarn add donny-auth
```

### usage

```javascript
const TokenStore = require('donny-auth')

// the source needs to be an html page
const store = new TokenStore('https://auth-store')

store.getToken({
    aud: 'audience'
}).then(function (token) {
    if (!token) {
        // redirect to `store.loginUrl`
    }
    // do stuff with token
}, function (err) {
    // probably means you're not allowed to use donny-auth on this domain
})

// if you have an API2 token
store.upgradeToken({
    aud: 'audience',
    api2_token: 'your-api2-token'
}).then(function (token) {
    if (!token) {
        // redirect to `store.loginUrl`
    }
    // do stuff with token
}, function (err) {
    // probably means you're not allowed to use donny-auth on this domain
})
```

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