npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@beige/rongcloud-sdk

v3.0.10

Published

The Server SDK of RongCloud, Fork By hebeiliujh

Downloads

15

Readme

Server SDK

文档迁移至: http://www.rongcloud.cn/docs/server_sdk_api/

v3.0.8后 新增发送手机验证码、校验手机验证码功能,

初始化

1、安装 Node.js 4.0+

2、安装 rongcloud-sdk

npm install @beige/rongcloud-sdk

使用

请前往 开发者后台 创建应用 -> 获取 Appkey、Secret

以注册用户为例

Promise 方式

//替换成您自己的 Appkey
var appkey = '8luwapucoil';
// 替换成您自己的 Secret
var secret = 'y0iyjl4h3LWz';

var RongSDK = require('rongcloud-sdk')({
    appkey: appkey,
    secret: secret
});

// API 文档: http://www.rongcloud.cn/docs/server/sdk/user/user.html#register
var User = RongSDK.User;
var user = {
	id: 'ujadk90ha',
	name: 'Maritn',
	portrait: 'http://7xogjk.com1.z0.glb.clouddn.com/IuDkFprSQ1493563384017406982'
};
User.register(user).then(result => {
	console.log(result);
}, error => {
	console.log(error);
});

// API 文档: https://www.rongcloud.cn/docs/sms_service.html
// 在官网新版SDK中完善的功能,尚未加入图片验证码的功能。
var Sms = RongSDK.Sms;
var sendData = {
	region: '86',
	phone: '153xxxxxxxx',
	template_id: 'dsfdsfdfdsfsd'
};
// 发送手机验证码
Sms.sendCode(sendData).then(result => {
	console.log(result);
}, error => {
	console.log(error);
});

var verifyData = {
	session_id: '2312312', // 发送验证码时得到的sessionId
	code: '3122'
};
// 校验验证码
Sms.verifyCode(verifyData).then(result => {
	console.log(result);
}, error => {
	console.log(error);
});

Co 方式

//替换成您自己的 Appkey
var appkey = '8luwapucoil';
// 替换成您自己的 Secret
var secret = 'y0iyjl4h3LWz';

var RongSDK = require('rongcloud-sdk')({
    appkey: appkey,
    secret: secret
});
var co = require('co');

// API 文档: http://www.rongcloud.cn/docs/server/sdk/user/user.html#register
var User = RongSDK.User;
co(function* (){
  var user = {
  	id: 'ujadk90ha',
  	name: 'Maritn',
  	portrait: 'http://7xogjk.com1.z0.glb.clouddn.com/IuDkFprSQ1493563384017406982'
  };
  var result = yield User.register(user)
  console.log(result);
}).catch(error => {
  console.log(error);
});

文档

API 文档

API 示例

单元测试

1、下载或克隆 server-sdk-nodejs

2、进入项目 cd server-sdk-nodejs

3、安装依赖 npm install

4、运行单元测试 npm test

声明

3.0.0 版本 SDK API 不再向老版本兼容,老版本 SDK 可用但不再维护