Socket
Book a DemoInstallSign in
Socket

geetest-proxy

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geetest-proxy

subscribable Geetest-js-sdk wrapper

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

geetest-proxy

subscribable Geetest-js-sdk wrapper

开始

npm i --save geetest-proxy

使用

var geetest = require('geetest-proxy');
var captcha = geetest(document.getElementById('#captcha'), {
  gt: GEETEST_ID
});
captcha.on('success', function (value) {
  fetch('/validate', {
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(value)
  }).then(function (response) {
    ...
  });
});

API

geetest(container, config)

  • container, 放置验证码的 DOM 容器节点
  • config, 传递给 Geetest 的配置项,可参考官方文档
    • config.gt, Geetest ID,为必填项

geetest(container, config) 方法将返回一个 EventEmitter 实例,后续的校验事件将通过该实例发布。

事件

  • 标准事件
    • success
    • fail
    • abuse
    • forbidden
  • 扩展事件
    • MESSAGE, 完整的事件信息,主要用于调试

标准事件都将接受到一个可传递给后台校验的数据包,即

{
    geetest_challenge: '',
    geetest_validate: '',
    geetest_seccode: ''
}

License

the MIT License

Keywords

geetest

FAQs

Package last updated on 06 Nov 2015

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.