SQLite

Javascript Client SDK Initialization and Configuration

Initialization

var client = new SQLiteCloud(PROJECT_ID, API_KEY);

You can get your APP_KEY and PROJECT_ID from the SQLiteCloud dashboard.


Optionally, during initialization you can pass two callbacks functions:

  • onErrorCallback called on WebSocket error event
  • onCloseCallback called on WebSocket close event
var onErrorCallback = function (event, msg) {
  console.log("WebSocket onError callback:" + msg);
  console.log(event);
}
var onCloseCallback = function (msg) {
  console.log("WebSocket OnClose callback:" + msg);
}
var client = new SQLiteCloud(PROJECT_ID, API_KEY, onErrorCallback, onCloseCallback);

Configuration

After initialization, you can optionally proceed with client configuration.

// Int value in milliseconds
// Default value is 3000 ms
SQLiteCloud.setRequestTimeout(Int)
// Default value is false
// If true during PUB/SUB communications, the library does not return messages sent by myself
SQLiteCloud.setFilterSentMessages(Boolean)
Previous
Installation