Oriskami node.js bindings
This library helps interact with Oriskami's API, a risk management intelligence to detect and manage transactions having a risk. Oriskami works by:
- fusioning your transaction data with external data providers;
- applying filters like whitelists, blacklists, rules, or risk scores trained with machine learning; and
- triggering notifications when a risk is detected (e-mail, slack, signed webhooks, etc.).
For a quick start see below, otherwise here are few links:
Quick Start: Five steps
- Install the binding:
npm install --save oriskami
- Setup your access token:
var Oriskami = oriskami = "YOUR_API_ACCESS_TOKEN" "API_VERSION"
- Bootstrap your account with historical data (
EventPast
; not analyzed):
oriskamiEventPast
- Label events for which the risk (
is_loss
) has materialized:
oriskamiEventLabel
- Send live
Events
:
oriskamievents
Then you will get notified when a risk is detected.
Events API: Open Beta (public preview)
Resource | C | R | U | D | L | Test Specs | |
---|---|---|---|---|---|---|---|
Event data | Event | {} |
123 |
123, {} |
123 |
{} |
See on github |
EventPast | {} |
{} |
See on github | ||||
EventLabel | 123 |
123, {} |
123 |
{} |
See on github | ||
EventLastId | {} |
See on github |
- C: Create
- R: Retrieve
- U: Update
- D: Delete
- L: List
123
: resource id{}
: JSON with query parameters
Parsing incoming webhooks
Oriskami signs its webhooks according to the Json Web Token standard www—here is how to parse incoming requests with express/restify:
var Oriskami = oriskami = oriskami
Code snippets and filter parameters
A few code snippets:
Action | Code snippet |
---|---|
1. Change token | oriskami.set("auth", "your-api-token") |
2. Add new resource |
oriskami.extend("resourceName", "resourcePath") |
3. Change timeout | oriskami.set("timeout", 20000) // in ms |
4. To disable signing of JSON payloads on nodejs >= v5 |
oriskami.set("unsigned", true) |
Filters available for most resources (list
).
Filter | Default | Example | Description |
---|---|---|---|
limit |
10 |
{"limit":10} |
At most 10 returned results |
gt |
{"id":{"gt":10}} |
id greater than 10 |
|
gte |
{"id":{"gte":10}} |
id greater than or equal |
|
lt |
{"id":{"lt":10}} |
id less than |
|
lte |
{"id":{"lte":10}} |
id less than or equal |
Development
To run the tests, you will need a Oriskami test API key (from your Oriskami dashboard)
export ORISKAMI_TEST_TOKEN="your-test-api-key"
npm install -g mocha
npm test
Note: on Windows, use SET
instead of export
for setting the ORISKAMI_TEST_TOKEN
environment variable.
Issues and feature requests
Author
- Inspired from stripe-node.
- Developed and maintained by Fabrice Colas for Oriskami.