# onebuck

> utility for connecting to tencent products

Latest version **1.0.7** (published 2020-06-15) · ISC license · 0 weekly downloads

## Install

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

## 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.7 |
| Published | 2020-06-15 |
| First published | 2019-08-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 17.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Guuours |
| Maintainers | guuours |
| Keywords | tencent, wechat, qq |

## Links

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

## Dependencies (2)

- [xml](https://npm.io/package/xml.md) ^1.0.1
- [request](https://npm.io/package/request.md) ^2.88.0

## Recent versions

- 1.0.7 (latest) — 2020-06-15
- 1.0.6 — 2020-06-15
- 1.0.5 — 2020-06-15
- 1.0.4 — 2020-06-15
- 1.0.3 — 2020-05-20
- 1.0.2 — 2020-05-12
- 1.0.1 — 2020-05-12
- 1.0.0 — 2020-05-11
- 0.0.9 — 2019-08-26
- 0.0.8 — 2019-08-23
- 0.0.5 — 2019-08-22

## README

A toolkit that provides some methods to help you to integrate you app to tencent products such as qq, wechat, etc.
# use with async
```js
var onebuck = require('./index');
var mp = onebuck.mp('yourappid', 'yourappsecret');

var run = async (func) => {
    func();
}

run(async () => {
    try {
        // get at
        var at = await mp.getAccessToken();
        console.log(at);
        // get user list
        var ul = await mp.getUserList(at);
        console.log(ul.data.openid.length);
        // get user info
        var u = await mp.getUserInfo(at, ul.data.openid[0]);
        console.log(u.nickname);
        // get template list
        var tl = await mp.getTemplates(at);
        // send message
        var msgId = await mp.sendMessage(at, 'openid', 'templateid',
            {
                msg: {
                    value: new Date().toString()
                }
            });
        // get js ticket
        var ticket = await mp.getJsTicket(at);
        console.log(ticket);
        var signature = mp.getJsSignature(ticket, 'redirecturl');
        console.log(signature);
    }
    catch (err) {
        console.log(err.code);
        console.log(err.message);
    }
});
```

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