# egg-wxtoken

> Fetch wechat access token & js tikect from central server.

Latest version **1.0.1** (published 2017-08-05) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install egg-wxtoken
pnpm add egg-wxtoken
yarn add egg-wxtoken
bun add egg-wxtoken
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-08-05 |
| First published | 2017-08-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.6.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | brick |
| Maintainers | brickyang |
| Keywords | egg, eggPlugin, egg-plugin, wechat |

## Links

- npm: https://www.npmjs.com/package/egg-wxtoken
- Repository: https://github.com/brickyang/egg-wxtoken
- Homepage: https://github.com/brickyang/egg-wxtoken#readme
- Issues: https://github.com/brickyang/egg-wxtoken/issues
- npm.io page: https://npm.io/package/egg-wxtoken

## Dependencies (1)

- [koa-jwt](https://npm.io/package/koa-jwt.md) ^3.2.2

## Recent versions

- 1.0.1 (latest) — 2017-08-05

## README

# egg-wxtoken

Extends the  `ctx` object. Used to fetch the wechat access token and js ticket from the wxtoken server.

It will manage cache in local until the token is expired.

`egg-jwt` is required to pass the authorization of wxtoken server.

## Installation

`npm link` is recommanded.

```bash
$ git clone git@github.com:brickyang/egg-wxtoken.git
$ cd path/to/project
$ npm link path/to/egg-wxtoken
```

## Usage

```js
// {app_root}/config/plugin.js
exports.wxtoken = {
  enable: true,
  package: 'egg-wxtoken',
};
```

## Configuration

```js
// {app_root}/config/config.default.js
exports.wxtoken = {
  host: 'http://localhost:8000'
};

exports.jwt = {
  signatures: {
    wxtoken: {
      secret: 'secret of wxtoken server',
      aud: 'wxtoken',
    }
  }
}
```

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