Skip to content

wecre8websites/sendinblueTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SendInBlue REST Tracker

No dependency REST implementation for SendinBlue's Tracker API

Installation

npm

The following recommended installation requires npm. If you are unfamiliar with npm, see the npm docs.

Then install it via:

npm install @wecre8websites/sendinblue-tracker --save

Usage

Please follow the installation instruction and execute the following JS code:

var sibTracker = require("@wecre8websites/sendinblue-tracker").sibTracker;
var apiKey = "YOUR-API-KEY"; //Replace with your SIB API key
var sib = new sibTracker(apiKey);

/**
 * Identify
 *
 * Returns on a successful request
 * Returns false on a bad request
 */

var email = "email@domain.com"; // Required
var properties = [
  // Optional
  ("key": "value"),
  // ...
];

sib.identify(email, properties).then(console.log).catch(console.error);

/**
 * trackEvent
 *
 * Returns on a successful request
 * Returns false on a bad request
 */

var email = "email@domain.com"; // Required
var event = "some_event"; // Required
var properties = [
  // Optional
  ("key": "value"),
  // ...
];

sib.trackEvent(email, event, properties).then(console.log).catch(console.error);

/**
 * trackLink
 *
 * Returns on a successful request
 * Returns false on a bad request
 */

var email = "email@domain.com"; // Required
var link = "some_link_identifier"; // Required
var properties = [
  // Optional
  ("key": "value"),
  // ...
];

sib.trackLink(email, link, properties).then(console.log).catch(console.error);

/**
 * trackPage
 *
 * Returns on a successful request
 * Returns false on a bad request
 */

var email = "email@domain.com"; // Required
var page = "https://domain.com/page"; // Required
var properties = [
  // Optional
  ("key": "value"),
  // ...
];

sib.trackLink(email, page, properties).then(console.log).catch(console.error);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published