JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 78
  • Score
    100M100P100Q68543F
  • License MIT

Promise-wrapped Sift Science lib for yielding

Package Exports

  • yield-siftscience

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yield-siftscience) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Yield Sift Science

A promise-wrapped helper lib for yielding Sift Science API calls

Installation

Using npm:

$ npm install yield-siftscience

Usage

Require with API Keys:

var siftscience = require('yield-siftscience')('YOUR_SIFT_SCIENCE_REST_API_KEY');

Send Event:

var result = yield siftscience.event.create_account({
  '$session_id': 'abcdefghijklmnopqrstuvwxyz',
  '$user_id': '12345',
  '$user_email': 'example@email.com'
});
console.log(result);

Send Label:

var result = yield siftscience.label('user_id', {
  '$is_bad': true,
  '$reasons': [ '$spam', '$chargeback' ],
  '$description': 'Because they are spamming and abusing our system'
});
console.log(result);

Get Score:

var score = yield siftscience.score('user_id');
console.log(score);

Sift Science Documentation

siftscience.com/docs