# fastify-authing

> [![TypeScript](https://badges.frapsoft.com/typescript/code/typescript.png?v=101)](https://github.com/ellerbrock/typescript-badges/) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)

Latest version **1.0.1** (published 2019-06-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install fastify-authing
pnpm add fastify-authing
yarn add fastify-authing
bun add fastify-authing
```

## 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.0.1 |
| Published | 2019-06-24 |
| First published | 2019-06-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 74.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | RoyLin |
| Maintainers | x-roylin |

## Links

- npm: https://www.npmjs.com/package/fastify-authing
- Repository: https://github.com/ZhiXiao-Lin/fastify-authing
- Homepage: https://github.com/ZhiXiao-Lin/fastify-authing#readme
- Issues: https://github.com/ZhiXiao-Lin/fastify-authing/issues
- npm.io page: https://npm.io/package/fastify-authing

## Dependencies (2)

- [authing-js-sdk](https://npm.io/package/authing-js-sdk.md) ^2.3.0
- [fastify-plugin](https://npm.io/package/fastify-plugin.md) ^1.6.0

## Recent versions

- 1.0.1 (latest) — 2019-06-24

## README

[![TypeScript](https://badges.frapsoft.com/typescript/code/typescript.png?v=101)](https://github.com/ellerbrock/typescript-badges/)
[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)
 
# fastify-authing
Authing plugin for fastify

# Usage

```
$ npm install fastify-authing --save
```

```
import * as Fastify from 'fastify';
import fastifyAuthing from 'fastify-authing';

const fastify = Fastify({
    logger: true
});

fastify.register(fastifyAuthing, {
    clientId: 'your_client_id',
    secret: 'your_app_secret'
});

fastify.get('/', async (request, reply) => {
    // @ts-ignore
    const user = await fastify.authing.login({
        email: 'test@testmail.com',
        password: 'testpassword'
    });
    return user;
});

const start = async () => {
    try {

        const address = await fastify.listen(3000);
        fastify.log.info(`server listening on ${address}`)

    } catch (err) {

        fastify.log.error(err);
        process.exit(1);

    }
};

start();

```

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