@segmentik/sdk-client
v1.0.33
Published
Segmentik Javascript SDK for frontend applications
Downloads
32
Maintainers
Readme
Segmentik SDK for Javascript
This library can be implemented only in the frontend, it is not for server use. Make sure you have an API key before integrating:
- Register and login to the dashboard
- Navigate on the sidebar to "Integration"
- Copy the API Key
Getting started
npm i @segmentik/sdk-client
Usage:
import Segmentik from '@segmentik/sdk-client';
const sg = Segmentik.load({
apiKey: 'API-KEY-HERE'
});
sg.then(session => session.detect())
.then(data => console.log(data.detectionId, data.visitorId));
Alternatively, you can install from a CDN.
The SDK responds with detectionId
and visitorId
:
detectionId
- An identifier used for querying in the backend to get the full detection details (bot detection, spoof detection etc.)visitorId
- A unique and persistent identifier for the user
Requirements
- Node.js > 14