1.0.1 • Published 2 years ago

sabil-identity v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Sabil Identity

This is the official Sabil package for identifying & fingerprinting devices for JavaScript.

Contents:

Quick start

Installation

Using a package manager

yarn add sabil-identity # or npm install sabil-identity

Note the common js version can be found in /common.cjs. Depending on your project environment, you might need to transpile the library.

Using HTML script tags

You can also include the library via a script tag in your HTML files like so:

<script
  type="module"
  src="https://unpkg.com/sabil-identity@latest/index.js"
  defer
/>

:::tip Usage via HTML script tag When using HTML script tags, Sabil will be injected into the window. Follow the rest of the guide but replace identify with window.identify. :::

Usage

First import the script (only if you installed using a package manager)

import { identify } from "sabil-identity";

Call the identify function to identify the current device. You must pass the client_id.

const { identity, confidence } = await identify({
  client_id: `your_app_client_id`,
});

That's it 🎉. Sabil will now catalog this device as an Identity. You can now use the identity field that was returned in any future attach call using the sabil-js package.

Why this library?

This library exists because the existing solutions for fingerprinting all focus on browser fingerprinting, not device fingerprinting. This library tries to fill the gap and provide access to Sabil's device fingerprinting technologies.

This library is a separate library from the sabil-js for two reasons:

  1. The primary functionality of this library is different from the sabil-js library.
  2. To keep library sizes small and efficient and separate concerns.

:::warn This library is still in BETA. It is only intended for customers of Sabil who work closely with the authoring team. If you are interested, please contact us first @ tech@sabil.io :::