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

secken-api

v2.0.6

Published

Secken API SDK for Nodejs

Downloads

18

Readme

Secken SDK for Javascript

NPM version Build Status Downloads

Install

npm install secken-api

Usage

require && config

var Secken = require("secken-api");

var sk = new Secken({
    app_id: "",
    app_key: "",
    auth_id: ""
});

After initialization, Secken-api can help you to develop you project. Most of Secken-api's functions will return a promise object which using q, then you can use the primose object embed into you project.

Get Bind Qrcode Image Url

sk.getBind({
    auth_type: 2,
    callback: "http://www.callback/path"
})
.then(function(result) {
    // Success
    var qrcodeURL = result.qrcode_url;
    console.log("this is qrcode:", qrcodeURL);
    // do some things

    return sk.getResult(result.event_id);
}, function(result) {
    // Failed
    var errorCode = result.status;

    // do some things

    return sk.breakQ();
}).then(success, failed, notify);

Get Auth Qrcode Image Url

sk.getAuth({
    auth_type: 3,
    callback: "http://www.callback/path"
})
.then(function(result) {
    // Success
    var qrcodeURL = result.qrcode_url;
    console.log("this is qrcode:", qrcodeURL);
    // do some things

    return sk.getResult(result.event_id);
}, function(result) {
    // Failed
    var errorCode = result.status;

    // do some things

    return sk.breakQ();
}).then(success, failed, notify);

Realtime Auth

sk.realtimeAuth({
    action_type: 1,
    uid: " user id ",
}).then(function(data) {
    // Success

    // do some things

    return sk.getResult(data.event_id);
}, function(data) {
    return sk.breakQ();
}).then(success, failed, notify);

Get Result

sk.getResult(event_id, time)
.then(function(data) {
    // Success
    console.log(data);

    // do some things
}, function(data) {
    // Failed

});

This function will repeat getting result, the default delay time is 1000 ms, you can use parameter time to set the delay time, and you can use the primose's notify function to get each response. If you pass false as the value of time, it will run only once.

Offline Auth

sk.offlineAuth({
    dynamic_code: " code ",
    uid: " user id ",
}).then(function(data) {
    // Success

    // do some things

}, function(data) {});

Get Auth Page Url

var url = sk.authPage( " callback url " );

Get Signature

getSignature(params [,ignore]), pass an object type value for params and an array type value for ignore. You can use this function to get the signature string of a params object.

var signature = sk.getSignature(params, ['user_ip', 'username']);

Change log

2.0.4

  • use ES6
  • change init params' key
  • add request() function
  • update request to 2.67.0

Secken Team

Secken