# node-gsdata-sdk

> A nodejs-based gsdata SDK for access public wechat account information. See more information from original api website: http://www.gsdata.cn.

Latest version **1.0.1** (published 2016-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-gsdata-sdk
pnpm add node-gsdata-sdk
yarn add node-gsdata-sdk
bun add node-gsdata-sdk
```

## 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 | 2016-05-15 |
| First published | 2016-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Eric Shi |
| Maintainers | longwosion |
| Keywords | weixin, wechat, gsdata, gsdata.cn, api |

## Links

- npm: https://www.npmjs.com/package/node-gsdata-sdk
- Repository: https://github.com/longwosion/node-gsdata-sdk
- Homepage: https://github.com/longwosion/node-gsdata-sdk#readme
- Issues: https://github.com/longwosion/node-gsdata-sdk/issues
- npm.io page: https://npm.io/package/node-gsdata-sdk

## Dependencies (6)

- [co](https://npm.io/package/co.md) ^4.6.0
- [md5](https://npm.io/package/md5.md) ^2.1.0
- [urllib](https://npm.io/package/urllib.md) ^2.8.0
- [co-urllib](https://npm.io/package/co-urllib.md) ^0.2.3
- [js-base64](https://npm.io/package/js-base64.md) ^2.1.9
- [fast-stable-stringify](https://npm.io/package/fast-stable-stringify.md) ^0.1.1

## Recent versions

- 1.0.1 (latest) — 2016-05-15
- 1.0.0 — 2016-05-15

## README

## node-gsdata-sdk

![MIT](https://img.shields.io/npm/l/express.svg) 
[![Build Status](https://travis-ci.org/longwosion/node-gsdata-sdk.svg?branch=master)](https://travis-ci.org/longwosion/node-gsdata-sdk)

### Introduction

[node-gsdata-sdk](http://github.com/longwosion/node-gsdata-sdk) is a unoffical [gsdata](http://open.gsdata.cn) sdk for nodejs.

### Install

```bash
$ npm install node-gsdata-sdk
```

### Usage

```node
var Gsdata = require('node-gsdata-sdk');

// create new api client
var client = new Gsdata("YOUR_API_ID", "YOUR_APP_SECRET");

// get user information
client.getSysUserInfo('longwosion@gmail.com').then(function(data) {
    var user = data.returnData;
    console.log(user.uid)
})

// call other api
//   - 1st parameter is api-path
//   - 2nd parameter is extra parameters object (ignore appId and appKey)
client.callApi('/api/wx/wxapi/wx_content', {
    'url': 'http://mp.weixin.qq.com/s?__biz=MzAxOTEyMDI1MQ==&mid=400950548&idx=3&sn=cca852f541f93c53633a4e0069230313&3rd=MzA3MDU4NTYzMw==&scene=6#rd'
}).then(function(data) {
    console.log(data)
})
```

You could also use `co` to avoid callback style.

```node
var co = require('co');
var Gsdata = require('node-gsdata-sdk');

// create new api client
var client = new Gsdata("YOUR_API_ID", "YOUR_APP_SECRET");

co(function *(){
    // get user information
    var data = yield client.getSysUserInfo('longwosion@gmail.com');
    console.log(data.returnData.uid);

    // call other api
    //   - 1st parameter is api-path
    //   - 2nd parameter is extra parameters object (ignore appId and appKey)
    var info = yield client.callApi('/api/wx/wxapi/wx_content', {
        'url': 'http://mp.weixin.qq.com/s?__biz=MzAxOTEyMDI1MQ==&mid=400950548&idx=3&sn=cca852f541f93c53633a4e0069230313&3rd=MzA3MDU4NTYzMw==&scene=6#rd'
    });
    console.log(info);
})


});

```

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