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

gt3-sdk

v2.0.0

Published

Node SDK for Geetest 3.0 captcha

Downloads

1,032

Readme

此处为极验 3.0 验证码的 Node SDK,如需要极验 2.0 验证码的SDK,请到 gt-node-sdk

Install 安装

npm install gt3-sdk --save

运行DEMO

cd Project
git clone https://github.com/GeeTeam/gt3-node-sdk.git
cd gt3-node-sdk
npm install
npm start
// 最后请打开浏览器访问localhost:9977
// 了解sdk的使用方式请查阅demo目录下的app.js文件

使用说明

sdk 提供 Geetest 构造函数,实例化时需要传入一个配置对象。为了更好的理解,请参照demo理解以下内容。

配置对象的字段如下:

  • geetest_id:验证公钥,必须
  • geetest_key:验证私钥,必须
  • protocol:与极验服务器交互时使用的协议,默认为 http://可选
  • api_server:针对私有化用户提供对默认的 api.geetest.com 进行修改,普通用户无需关注此选项,可选

geetest_idgeetest_key 申请地址:account.geetest.com

申请后,初始化 Geetest

var Geetest = require('gt3-sdk');

var captcha = new Geetest({
    geetest_id: 'xxx', // 将xxx替换为您申请的 id
    geetest_key: 'xxx' // 将xxx替换为您申请的 key
});

上述 Geetest 的实例 captcha 提供两个方法:

register(data, callback)

data 给用户传入客户端的类型和ip地址(如果无法知道ip地址则填写'unknown')。如果不想传 data,则传入 null

类型有以下几种:

'web': pc浏览器 'h5': 手机浏览器,包括webview 'native': 原生APP 'unknown': 未知

validate(fallback, result, callback)

fallback 表示当前session是否宕机。

更新历史:CHANGELOG