Skip to content

TeamLifecycle/lifecycle-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lifecycle Bindings for Node.js

Installation

npm install lifecycle-node

Documentation

Check out the official documentation at https://www.lifecycle.io/docs/campaign.

API Overview

Identify and Track users via your lifecycle instance.

Identify

Identify users to create, add, and update attributes to user data stored with Lifecycle.

var lifecycle = require('lifecycle-node');
lifecycle.identify(uniqueId, [defaultAttributes], [extraAttributes], callback);
Arguments

uniqueId (String): required
        Your unique identifier for the user
defaultAttributes (Object): optional
        first_name (String)
        The first name of the user
        last_name (String)
        The last name of the user
        email_address (String)
        The email address of the user
        phone_number (String)
        The phone number of the user
        apns_token (String)
        The apns token of the user
        gcm_token (String)
        The gcm token of the user
        browser_token (String)
        The browser token of the user
        street_address (String)
        The street address of the user
        city (String)
        The city of the user
        state (String)
        The state of the user
        zip_code (String)
        The zip code of the user
extraAttributes (Object): optional
        Any other identifiers you use
callback (Function): required
        Returns error or result

Track

Track your events and the users who trigger them.

var lifecycle = require('lifecycle-node');
lifecycle.track(eventId, uniqueId, [properties], callback);
Arguments

eventId (String): required
        The name of your event
uniqueId (String): required
        Your unique identifier for the user
properties (Object): optional
        Any properties associated with your event
callback (Function): required
        Returns error or result

Configuration

Set the environment variable LIFECYCLE_API_KEY before running your app:

export LIFECYCLE_API_KEY='{YOUR_API_KEY}'

Note: On Windows use SET instead of export for setting the LIFECYCLE_API_KEY environment variable.

License

This package is available as open source under the terms of the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published