Installation
#global package installation (recommended if you are new to npm packages) npm install lytics-js -g #local package installation npm install lytics-js
Usage
JavaScript
You can use this package in order to write applications that use the Lytics API.
var lytics = ;var client = lytics;////get an array of account objectsvar accounts = await client;////test a query functionvar is_true = await client;var is_false = await client;var is_undefined = await client;var is_email = await client;
Command-line interface (CLI)
This package includes a command-line interface (CLI) for Lytics. The CLI is available as an executable included in the package. You can run the CLI by installing the package locally or globally.
Display help
#local package $(npm bin)/lytics-js help #global package lytics-js help
Lytics watch
#to use the Lytics API key set in the environment variable LIOKEY lytics-js watch . #to pass the Lytics API key directly lytics-js -k [apikey] watch .
Test query function
#to use the Lytics API key set in the environment variable LIOKEY lytics-js #to pass the Lytics API key directly lytics-js -k [apikey] #passing multiple parameters lytics-js #passing no parameters lytics-js
User field whitelisting
#list user fields currently whitelisted lytics-js whitelist -a [Lytics account ID] list #add a field to the whitelist lytics-js whitelist -a [Lytics account ID] add email #remove a field from the whitelist lytics-js whitelist -a [Lytics account ID] remove email