Socket
Socket
Sign inDemoInstall

gt3-sdk

Package Overview
Dependencies
47
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gt3-sdk

Node SDK for Geetest 3.0 captcha


Version published
Weekly downloads
237
increased by60.14%
Maintainers
1
Install size
3.81 MB
Created
Weekly downloads
 

Changelog

Source

2.0.0

  1. 允许用户转入新的数据
  2. 将fallback的记录放在了用户那边

Readme

Source

此处为极验 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

Keywords

FAQs

Last updated on 30 Mar 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc