# authkey

> simple app key issue and verification

Latest version **1.4.0** (published 2018-03-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install authkey
pnpm add authkey
yarn add authkey
bun add authkey
```

## 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.4.0 |
| Published | 2018-03-08 |
| First published | 2018-02-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 12 |
| Unpacked size | 13.9 KB |
| Known vulnerabilities | 0 (+15 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Adam Boro |
| Maintainers | adekbadek |
| Keywords | authorization, keygen, key |

## Links

- npm: https://www.npmjs.com/package/authkey
- Repository: https://github.com/adekbadek/authkey
- Homepage: https://github.com/adekbadek/authkey#readme
- Issues: https://github.com/adekbadek/authkey/issues
- npm.io page: https://npm.io/package/authkey

## Dependencies (12)

- [cors](https://npm.io/package/cors.md) ^2.8.4
- [jest](https://npm.io/package/jest.md) ^22.4.2
- [lowdb](https://npm.io/package/lowdb.md) ^1.0.0
- [dotenv](https://npm.io/package/dotenv.md) ^5.0.0
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.205.0
- [express](https://npm.io/package/express.md) ^4.16.2
- [coveralls](https://npm.io/package/coveralls.md) ^3.0.0
- [lodash-id](https://npm.io/package/lodash-id.md) ^0.14.0
- [supertest](https://npm.io/package/supertest.md) ^3.0.0
- [nodemailer](https://npm.io/package/nodemailer.md) ^4.6.0
- [uid-generator](https://npm.io/package/uid-generator.md) ^1.0.0
- [email-validator](https://npm.io/package/email-validator.md) ^1.1.1

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

- 1.4.0 (latest) — 2018-03-08
- 1.3.0 — 2018-03-04
- 1.2.0 — 2018-03-03
- 1.1.0 — 2018-02-25
- 1.0.0 — 2018-02-25

## README

# authkey
> self-hosted, bare-bones licensing API

Basically a very limited version of what [keygen.sh](https://keygen.sh/) does.

[![npm](https://img.shields.io/npm/v/authkey.svg)](https://www.npmjs.com/package/authkey)
[![Build Status](https://travis-ci.org/adekbadek/authkey.svg?branch=master)](https://travis-ci.org/adekbadek/authkey)
[![Coverage Status](https://coveralls.io/repos/github/adekbadek/authkey/badge.svg?branch=master)](https://coveralls.io/github/adekbadek/authkey?branch=master)[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Quick start

1. configure [Amazon SES](https://aws.amazon.com/ses/) or get some gmail creds

1. install

  ```shell
  npm i authkey
  ```

1. use

  ```javascript
  const authkey = require('authkey')

  authkey({
    from: 'superthing@things.com'
    productName: 'SuperThing',
    mailerConfig: {
      // see below for other services
      type: 'gmail',
      credentials: {
        user: process.env.GMAIL_USER,
        pass: process.env.GMAIL_PASS,
      }
    },
  }).listen()
  ```

### `mailerConfig` options

| service (`type`) | required `credentials` |
| :------------- | :------------- |
| `amazonSES` | `accessKeyId`, `secretAccessKey`, `region` |
| `gmail` | `user`, `pass` |


## API Reference

| verb | endpoint       | what it does     |
| :------------- | :------------- | :------------- |
| `POST` | `/request/:address` | creates a new auth key for the given address and sends an email with the auth key |
| `POST` | `/verify/:authkey` | verifies the given auth key |

## Database

a JSON file handled with [lowdb](https://github.com/typicode/lowdb)

## Versioning

[SemVer](http://semver.org/) is used (with help of [semantic-release](https://github.com/semantic-release/semantic-release)).

## Contributing

```shell
git clone https://github.com/adekbadek/authkey.git
cd authkey/
npm i
npm t
```

Will install the dependencies and run tests in watch mode.

### Tests

with [Jest](https://facebook.github.io/jest/)

```shell
npm t
```

### Style guide

using [Standard](https://standardjs.com/)

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