Skip to content
Qlik Sense Extension Development Environment
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
packages
.gitignore
README.md
package.json

README.md

qExt

qExt is a tool to help you with automating building and deployment of your Qlik Sense extensions.


Setup

To get started, it is best to install the qext project setup package globally so that a new extension project can be started from any location

npm install -g qext


Usage

qext is run from the command line.

qext --create-extension my-extension --template starter --install

The above command will create a new project directory with whatever name was passed to the --create-extension flag, using the starter template and installing all necessary dependencies. See more qext templates here

Running qExt

qExt Scripts can be run by adding the qext-scripts command to your package.json scripts to run qext-scripts, with the option of running it in watch-mode where it will watch your src files for changes.

Example:

{
	"name": "my-extension",
	"scripts": {
		"qext-scripts": "qext-scripts",
		"watch-qext-scripts": "qext-scripts -w"
	}
}


Configuration

When running qExt, there are two main pieces of the configuration that need to be set. The first is the build-mode, which can be compile or vanilla, and the second is deploy-mode, which is either server or desktop. When deploying to server, you also have the option of authenticating using windows authentication, or header authentication. Below are examples that should help with setting up your configuration, but full configuration can be found here

compile mode

Compile mode uses webpack and babel to compile your extension files from ES6 spec into ES5 that can be read by most modern browsers. It checks your source files to make sure you have a source .js file as well as a .qext file. It also appropriately names your extension files and zips them up so they can be imported to a Sense Server when necessary.

Example: Assume you have a project structure:

|-my-extension
| |-src
| | |-index.js
| | |-index.qext

The following configuration will compile the index.js file and any dependent files into an extension within the dist directory, copy the qext file into dist, and then zip the directory

{
	"extension": "my-extension",
	"output": "./dist",
	"mode": "compile",
	"compile": {
		"entry": "index.js",
		"qext": "index.qext"
	}
}

output:

|-my-extension
| |-src
| | |-index.js
| | |-index.qext
| |-dist
| | |-my-extension.js
| | |-my-extension.qext

NOTE: make sure your javascript file attaches your define function to the window

window.define([], function() {
	return {
		//...paint function and others defined here
	}
})

vanilla mode

Vanilla mode will simply copy the contents of the defined entry directory into the output directory, and then zip that directory up

Example: Assume you have a project structure as such:

|-my-extension
| |-src
| | |-my-extension.js
| | |-my-extension.qext

The following configuration will copy the contents of the src directory to a new extension directory within dist and then zip up the directory.

{
	"extension": "my-extension",
	"output": "./dist",
	"mode": "vanilla",
	"vanilla": {
		"entry": "./src"
	}
}

The output would be:

|-my-extension
| |-src/
| | |-..src files
| |-dist
| | |-my-extension/
| | | |-my-extension.js
| | | |-my-extension.qext
| | |-my-extension.zip

NOTE - unlike compile mode, vanilla mode will not check the contents of the source directory for a .qext file or for correct naming standards. It is up to you to make sure the files are in the correct format for Qlik Sense to consume.



Deploy Modes

qext.config.json also has the ability to accept deployment configurations. The deploy property can be either server or desktop.

server

One of the great features of qExt Scripts is the ability to automatically deploy your extensions to a Qlik Sense Server. When in server deploy mode, you need to authenticate with Qlik Sense using either header authentication, or windows authentication.

header authentication

Header authentication works through a virtual proxy set up on the Qlik Sense server you want to deploy to. Go here for more information on setting up a virtual proxy in Qlik Sense.

Example:

{
	"extension": "my-extension",
	"output": "./dist",
	"mode": "compile",
	"deploy": "server",
	"authenticate": "header",
	"serverConfig": {
		"host": "<hostname>",
		"hdr-usr": "DOMAIN\\username",
		"prefix": "hdr"
	}
}

windows authentication

You can also have qext-scripts log connect to the engine using your sign in credentials

Example:

{
	"extension": "my-extension",
	"output": "./dist",
	"mode": "compile",
	"deploy": "server",
	"authenticate": "windows",
	"serverConfig": {
		"host": "<hostname>"
	}
}

desktop

If you're developing and testing your extension against a Qlik Sense Desktop instance, qExt can still help. by setting deploy to desktop, and then defining the deployment location of extension objects, your extension can automatically be deployed to that location from wherever you're developing

Example:

{
	"extension": "my-extension",
	"output": "./dist",
	"mode": "compile",
	"deploy": "desktop",
	"desktopConfig": {
		"destination": "C:\\Users\\%username%\\Documents\\Qlik\\Sense\\Extensions"
	}
}
You can’t perform that action at this time.