aboardly

0.1.4 • Public • Published

aboardly-client-node

Official Aboardly API library client for node.js

This library is generated by alpaca and then modified by hand, hence why some things seem over engineered.

Installation

Make sure you have npm installed.

$ npm install aboardly

Versions

Works with [ 0.8 / 0.9 / 0.10 / 0.11 ]

Usage

var aboardly = require('aboardly');
 
// Then we instantiate a client (as shown below)

Build a client

Using this api without authentication gives an error

Basic authentication
var client = aboardly.client({
    username: 'api_key',
    password: 'api_secret'
});

Response information

All the callbacks provided to an api call will recieve the response as shown below

// You can also omit the 'methodOptions' param below
client.klass.method('args', methodOptions, function (err, response) {
    if (err) console.log(err);
    response.code;
    // >>> 200
    response.headers;
    // >>> {'x-server': 'apache'}
}

Customers api

Create/Update customer (PUT customers/:customerId)

Updates customer data. If customer does not exist it is created.

The following arguments are required:

  • customer_id: Customer identifier - an identifier that can 1:1 match to the user in your own systems.
  • options.email: Customer email - required
  • options: Data about customer like first_name, last_name, email (required)
client.customers.upsert("customer_id", options, callback);

Events api

Create event (POST customers/:customerId/events/:eventName)

Creates a new event for a customer

The following arguments are required:

  • customer_id: Customer identifier - an identifier that can 1:1 match to the user in your own systems.
  • event_name: Event name (e.g. logged_in, signed_up, added_funds)
client.events.create("customer_id", "event_name", options, callback);

Package Sidebar

Install

npm i aboardly

Weekly Downloads

1

Version

0.1.4

License

MIT

Last publish

Collaborators

  • herkyl
  • landland