Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dx-ctu-client-sdk

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dx-ctu-client-sdk

dingxiang ctu client sdk

  • 0.1.3
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

dx-ctu-client-sdk

顶象风控SDK

使用方式

npm install dx-ctu-client-sdk --save
const ClientSDK = require('dx-ctu-client-sdk')

const sdk = new ClientSDK('服务url', '您的appId', '您的appSecret')

sdk.checkRisk({
  "data": {
    "phone_number": "17800000000",
    "user_id": "12345326232",
    "ip": "125.121.232.219",
    "const_id": "N4RG6TtsY6ILK5ePY6HVtjj12pu5Yi5wnjnbaUI41"
  },
  "eventCode": "test_event_1",
  "flag": "test1"
}).then((resp) => {
  const level = resp.result.riskLevel

  if (level === 'ACCEPT') {
    // 业务代码,当前请求没有风险
  } else if (level === 'REVIEW') {
    // 业务代码,当前请求有一定风险,建议复审
  } else if (level === 'REJECT') {
    // 业务代码,当前请求有风险,建议拒绝
  }
})

设置超时时间

checkRisk第二个参数为超时时间,默认为2000(2秒)

FAQs

Package last updated on 15 Mar 2018

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc