node package manager


Backend Services SDK

Everlive JavaScript SDK


The Everlive JavaScript SDK is intended to run in any Javascript environment. It is packaged with Browserify for all environments except for Node.js where the code from the src is used directly. It is distributed in the following forms:

Internally we use it in:

  • The Cloud Code
  • API Server


The docs are available here

Supported environments

  • Browser - <script src="path/to/sdk/everlive.all.js"></script>
  • Node.js - var Everlive = require('everlive-sdk');
  • Cordova (Android, iOS, WindowsPhone) - <script src="path/to/sdk/everlive.all.js"></script>
  • NativeScript (Android, iOS) - var Everlive = require('everlive-sdk');
  • ES6 and TypeScript - import Everlive from 'everlive-sdk' Note: Use Typescript compiler version >= 2


Run $ npm install in the root of the project.

The source code is available in the src folder. The entry point of the application is index.everlive.ts.

To build the source code use:

$ npm run build

To build the source code on each change:

$ npm run watch

The output is located in the root of the project - everlive.js and

To make a distibution build use the npm start command:

$ npm start

It outputs the following files:

|-- root
    |-- dist
        |-- everlive.all.js
        |-- everlive.all.min.js
        |-- license
        |-- readme
        |-- declarations (contains the TS declarations)


We have setup automated tests for each supported environment. The tests are located in the test folder.

There are mobile projects for Cordova and Nativescript located in test/mobile/Everlive(Cordova|NativeScript). Currently there are automated tests only for Android.

External files for Node.js and PhantomJs are located in test/external.


  1. Setup Nativescript on your system -
  2. Setup Cordova on your system -

Also make sure to setup ADB on your system.

Running tests

The easiest way is to open an .html file in the browser - test/suites/everlive-caching/everlive-caching.html.

To run all tests against all platforms sequentially run:

$ npm run test

Most of the times you will want to run them against specific platforms:

$ npm run test --platform desktop|nodejs|cordova|nativescript

If you want to run only a specific suite (test/suites/everlive-anything) specify the suite flag. By convention it tries to find the suite in test/suites/(suite)/(suite).html.

$ npm run test --platform cordova --suite everlive-files

The test results are shown in the console and written as tap reports in test/testResults(platform).tap:

ok 0 Everlive data -  Online  EmailSubscribers Everlive data -  offline control offline should throw when offline not enabled
ok 1 Everlive data -  Online  EmailSubscribers Everlive data -  offline control isOffline should throw when offline not enabled
not ok 2 Everlive data -  Online  EmailSubscribers Everlive data -  offline control isOnline should throw when offline not enabled -   AssertionError: expected 'expected false to be truthy' to equal 'You have instantiated the SDK without support for offline storage'


Each platform's tests are ran against a different backend-services project. These settings can be changed in test/suites/externalconfig.template.js.

Creating tests

Write the actual tests in the test/suites/everlive-(suite) folder. Each such folder should have a everlive-(suite).html file which specifies its tests:

<!DOCTYPE html>
    <meta charset="utf-8">
    <title>Everlive tests</title>
<script src="../../TestRunner.js" data-js="everlive-caching.test.js"></script>

A simple test:

describe("Test", function () {
    ok(1 === 1);

This will load all the scripts and css needed by default (see test/TestRunner.js), create a div[id=mocha] and add the scripts specified in the data-js attribute.

The TestRunner can be accessed from window.runner.