Skip to content

JavaScript library for consuming Qlik's QIX Engine.

License

Notifications You must be signed in to change notification settings

fowlerp-qlik/enigma.js

 
 

Repository files navigation

CircleCI Greenkeeper badge

enigma.js is a library that communicates with Qlik QIX Engine. You can use it to build your own analytics tools or Node.js services that for example performs CRUD (create, read, update and delete) operations on Qlik documents.



Getting started

Prerequisites

Before continuing, make sure that you have these tools installed:

  • Node.js >= 4.0
  • Git bash if on Windows

And know of at least some these web technologies:

  • JavaScript
  • Promises
  • Websockets

Usage

First off, install enigma.js and a WebSocket library:

npm -S i enigma.js ws

Next, create a new file called my-file.js and put the following code into it:

const enigma = require('enigma.js');
const WebSocket = require('ws');
const schema = require('enigma.js/schemas/12.20.0.json');

// create a new session:
const session = enigma.create({
  schema,
  url: 'ws://localhost:9076/app',
  createSocket: url => new WebSocket(url),
});

// bind traffic events to log what is sent and received on the socket:
session.on('traffic:sent', data => console.log('sent:', data));
session.on('traffic:received', data => console.log('received:', data));

// open the socket and eventually receive the QIX global API, and then close
// the session:
session.open()
  .then((/*global*/) => console.log('We are connected!'))
  .then(() => session.close())
  .then(() => console.log('Session closed'))
  .catch(err => console.log('Something went wrong :(', err));

And then run it:

node my-file.js

You may need to adjust the code so the URL points towards your running QIX Engine.

About

JavaScript library for consuming Qlik's QIX Engine.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.0%
  • Other 1.0%