1.5.2 • Published 9 years ago

irritable v1.5.2

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

irritable

NPM

Iterable API request wrapper for client && node.js

Install

$ npm install irritable --save

Usage

// Send event to Iterable
var token = process.env.ITERABLE_TOKEN
var Irritable = require('irritable')({
    token: token //API Token
})

Irritable.Events.track({
  eventName: 'test',
  email: 'test@test.com'
}).then(console.log)

TODO

API

irritable(options) -> object

options
token

Required
Type: string or process.env.ITERABLE_TOKEN

Token / key used to communicate with Iterable API

baseURL

Optional Type: string Default: http://api.iterable.com/api/

Base URL of iterable api.

timeout

Optional Type: number Default: 3000 ms

Timeout of request life sent to iterable

responseType

Optional Type: string Default: json

Response type sent back from iterable

irritable.Events -> object

returns event handler object:

{
  track: <fn>,
  trackPushOpen: <fn>,
  trackConversion: <fn>
}

irritable.Events.track(eventObject) -> promise

Sends a validated event object to Iterable.

eventObject
email

optional
Type: string

Email associated with the event.

eventName

required
Type: string

eventName associated with the event.

createdAt

optional
Type: string

date / unix timestamp of the associated event.

dataFields

optional
Type: object

Metadata for the event.

campaignId

optional
Type: number

campaignId of the event.

templateId

optional
Type: number

templateId of the event.

irritable.Events.trackConversion(eventObject) -> promise

Sends a validated trackConversion event object to Iterable.

eventObject
email

required
Type: string

Email associated with the event.

campaignId

required
Type: number

campaignId of the event.

createdAt

optional
Type: string

date / unix timestamp of the associated event.

dataFields

optional
Type: object

Metadata for the event.

templateId

optional
Type: number

templateId of the event.

irritable.Events.trackPushOpen(eventObject) -> promise

Sends a validated trackPushOpen event object to Iterable.

eventObject
email

required
Type: string

Email associated with the event.

userId

required
Type: string

UserId associated with the event.

campaignId

required
Type: number

campaignId of the event.

createdAt

optional
Type: string

date / unix timestamp of the associated event.

dataFields

optional
Type: object

Metadata for the event.

templateId

optional
Type: number

templateId of the event.

1.5.2

9 years ago

1.5.0

9 years ago

1.4.0

9 years ago

1.3.0

9 years ago

1.2.5

9 years ago

1.2.4

9 years ago

1.2.3

9 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago