npm install lifecycle-node
Check out the official documentation at https://www.lifecycle.io/docs/campaign.
Identify and Track users via your lifecycle
instance.
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);
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 your events and the users who trigger them.
var lifecycle = require('lifecycle-node');
lifecycle.track(eventId, uniqueId, [properties], callback);
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
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.
This package is available as open source under the terms of the MIT License.