# kiss-fetch-auth

> Extension to FetchAPI, appends Authorization header in the fetch pipeline

Latest version **0.0.4** (published 2020-09-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install kiss-fetch-auth
pnpm add kiss-fetch-auth
yarn add kiss-fetch-auth
bun add kiss-fetch-auth
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2020-09-17 |
| First published | 2020-09-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Gary Ranson |
| Maintainers | granson |

## Links

- npm: https://www.npmjs.com/package/kiss-fetch-auth
- Repository: https://github.com/peracto/kiss-fetch-auth
- npm.io page: https://npm.io/package/kiss-fetch-auth

## Recent versions

- 0.0.4 (latest) — 2020-09-17
- 0.0.3 — 2020-09-17
- 0.0.2 — 2020-09-16
- 0.0.1 — 2020-09-16

## README

# KISS-FETCH-AUTH

When fetching resources that require Authentication ...

```js
import fetchAuthFactory from "kiss-fetch-auth"

const getAuthentication = () => {
    // As we are returning a promise, it can be as complex as required.
    return Promise.resolve('Bearer abcdefg')
}

const fetchAuth = fetchAuthFactory({
    auth: getAuthentication
})

// We can now use fetchAuth anywhere that we would have used FetchAPI.

const response = await fetchAuth('http://example.com/api/getSomething')
```

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