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
- High-level concepts
- API documentation
- API documentation for v1.x
- Migrating from v1.x
- Contributing
- Runnable examples - WIP, most examples does not exist yet
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
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.