English Qlik Sense Developers 3.2

Using enigma.js in Qlik Sense

This feature is delivered as EXPERIMENTAL in this release.

This topic shows you how to evaluate enigma.js in Qlik Sense.

enigma.js is used by the Qlik Sense client, and opening the current app again might cause things to break. This code example can be used in both a mashup and in a visualization extension.

enigma.js is delivered as EXPERIMENTAL in this release, util and autogenerated/qix/engine-api used in the example below are unsupported modules.

define(['util', 'enigma', 'autogenerated/qix/engine-api'], function(Util, enigma, schema) {
  var cfg = {
    schema: schema,
    appId: 'app-to-open',
    session: {
      host: Util.hostname,
      port: Util.port || undefined,
      prefix: Util.basePath,
      unsecure: !Util.isSecure,
      reloadURI: Util.reloadURI
    }
  };
  enigma.getService('qix', cfg).then(function(qix) {
    qix.global.doStuff();
    qix.app.doStuff();
  }).catch(function(err) {
    console.log('Something went wrong', err);
  });
});