Skip to content

segmentik/sdk-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Segmentik SDK for Node.js

This library is for backend use only. Make sure you have a secretKey:

  1. Register and login to the dashboard
  2. Navigate on the sidebar to "Secret Keys"

Getting started

npm i @segmentik/sdk-node

Usage:

import { SegmentikNodeSDK } from '@segmentik/sdk-node';

const client = new SegmentikNodeSDK({
  secretKey: 'YOUR_SECRET_KEY'
});

API:

getDetectionResult()

Responds with a full detection result by detectionId.

const result = await client.getDetectionResult(detectionId);

Arguments

detectionId: string

Returns

A full detection result:

{
  "time": "2023-11-13T13:55:18.149Z",
  "visitor": {
    "id":  "KUBE8O1qUhWSaOjkW3",
    "confidence":  100
  },
  "bot": {
    "result": "notDetected"
  },
  "incognito": false,
  "ip": {
    "proxy": false,
    "type": "Business",
    "country": "US",
    "region": "California",
    "city": "Mountain View",
    "location": {
      "lat": 37.422,
      "lon": -122.084
    },
    "ISP": "Partner Communications Ltd.",
    "address": "66.249.73.12"
  },
  "automationTool": {
    "detected": false
  },
  "spoofing": {
    "detected": false
  },
  "behavior": {
    "score": 0
  },
  "duration": 0,
  "page": "https://domain.com/page1.html",
  "sdkVersion": "0.1.6",
  "device": {
    "browser": {
      "name": "Chrome",
      "version": "119.0.0.0"
    },
    "os": {
      "name": "Mac OS",
      "version": "10.15.7"
    },
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
  }
}

About

Node.js SDK

Resources

Stars

Watchers

Forks

Packages

No packages published