Socket
Book a DemoInstallSign in
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

latest
npmnpm
Version
0.1.4
Version published
Maintainers
1
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 08 Jun 2023

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