Nineties Party Mix

    @wecre8websites/sendinblue-tracker
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.6 • Public • Published

    SendInBlue REST Tracker

    No dependency REST implementation for SendinBlue's Tracker API

    Installation

    For Node.js

    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);

    Keywords

    Install

    npm i @wecre8websites/sendinblue-tracker

    DownloadsWeekly Downloads

    14

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    49 kB

    Total Files

    7

    Last publish

    Collaborators

    • jonathan-wecre8websites