A simple Qlik Sense app, with all charts, hosted in GitHub pages via Qlik anonymous access. Includes some basic tests.
This repository provides a simple, hosted Qlik Sense app that demonstrates all available chart types. It includes:
- An embeddable web app (
embed/index.html) for viewing the Qlik Sense app via Qlik's web components. - Automated deployment to GitHub Pages for the embed app. This is configured to deploy to a Qlik Cloud anonymous tenant (note this is why the NL object won't render).
- Automated deployment of the Qlik Sense app (
src/*.qvf) to your Qlik Cloud tenant using GitHub Actions.
embed/— Contains the embeddable web app and deployment scriptsindex.html— Main embed page (uses Qlik web components)index.css— Styling for the embed pageqlik-upload.js— Node.js script to upload and publish Qlik Sense apps to your tenant
src/— Contains Qlik Sense app files (.qvf).github/workflows/— GitHub Actions workflows for automationREADME.md— This documentation
The embed/ directory contains several example HTML pages that use Qlik's web components to display Qlik Sense apps and charts in different configurations:
index.html— Index page for examples.dual-classic-app.html— Qlik Sense app overview using both @qlik/embed-web-components and @qlik/api.solo-classic-app.html— Qlik Sense app overview using @qlik/embed-web-components.solo-analytics-sheet-selections.html— Dynamic sheet loading for Qlik Sense sheets using @qlik/embed-web-components and Ref API.solo-analytics-chart-otf.html— On-the-fly analytics chart using @qlik/embed-web-components (barchart, custom state, and more).solo-analytics-snapshot.html— Static chart rendering usingdata___jsonand @qlik/embed-web-components (no backend required).configurator.html— Interactive Qlik Sense chart configurator using @qlik/embed-web-components.
These pages require several Qlik Cloud variables to be injected at build/deploy time:
{{qlikHost}}— Your Qlik Cloud tenant host (e.g.your-tenant.qlikcloud.com){{qlikClientId}}— OAuth client ID for anonymous access{{qlikAccessCode}}— Access code for the anonymous app share{{qlikAppId}}— The Qlik Sense app ID to display
These placeholders are replaced automatically during the GitHub Pages deployment workflow.
Workflow: .github/workflows/pages.yml
- Triggers: On push to
mainaffectingembed/**, or manually via workflow dispatch - Steps:
- Checks for required Qlik environment variables
- Replaces placeholders in
embed/index.htmlwith values from repository variables - Uploads the
embed/directory as a GitHub Pages artifact - Deploys to GitHub Pages
QLIK_HOST— Your Qlik Cloud tenant hostQLIK_CLIENT_ID— OAuth client ID for anonymous accessQLIK_ACCESS_CODE— Access code for the anonymous app shareQLIK_APP_ID— The Qlik Sense app ID to embed
There are two workflows for working with Qlik Sense apps in this repository:
-
Workflow:
.github/workflows/qlik_app_deploy.yml- Purpose: Deploys (uploads and publishes) Qlik Sense apps from
src/*.qvfto your Qlik Cloud tenant for consumption via the embed page. - Triggers: On push to
mainaffectingsrc/*.qvf, or manually via workflow dispatch. - Steps:
- Installs dependencies
- Runs
embed/qlik-upload.jsto upload and publish the Qlik Sense app(s) to your tenant
- Purpose: Deploys (uploads and publishes) Qlik Sense apps from
-
Workflow:
.github/workflows/unbuild_app.yml- Purpose: Extracts ("unbuilds") the definition of each Qlik Sense app in
src/into a/difffolder for version control and review. This does not deploy apps. - Triggers: On pull requests to
mainaffectingsrc/**, or manually via workflow dispatch. - Steps:
- For each
.qvfinsrc/, imports the app to a temporary Qlik Cloud context - Runs
qlik app unbuildto extract the app definition (without data) into/diff/<qvf-name>/ - Downloads any app images/media into
/diff/<qvf-name>/images/ - Commits and pushes changes in
/diffif any are detected
- For each
- Purpose: Extracts ("unbuilds") the definition of each Qlik Sense app in
Note: Use
qlik-app-deploy.ymlto deploy apps to your tenant. Useunbuild_app.ymlto extract and version app definitions for code review and change tracking. The/difffolder is only updated by the unbuild workflow and is not used for deployment.
QLIK_HOST— Your Qlik Cloud tenant hostQLIK_ADMIN_CLIENT_ID— Machine-to-machine OAuth client ID withadmin_classicanduser_defaultscopesQLIK_ADMIN_CLIENT_SECRET(Secret) — Machine-to-machine OAuth client secret
- Go to your GitHub repository > Settings > Secrets and variables > Actions
- Add the following Variables:
QLIK_HOSTQLIK_CLIENT_IDQLIK_ACCESS_CODEQLIK_APP_IDQLIK_ADMIN_CLIENT_ID
- Add the following Secret:
QLIK_ADMIN_CLIENT_SECRET
The project includes a build system that automatically replaces Qlik placeholders with environment variables, just like the GitHub workflow.
-
Install dependencies:
npm install
-
Set up your Qlik environment variables using a
.envfile:# Copy the template file cp .env.template .env # Edit .env with your actual Qlik Cloud values
-
Start the development server:
npm start
-
Open your browser and navigate to:
- Main app: http://localhost:3000
The server will automatically:
- Run the build process to replace Qlik placeholders
- Serve files from the
build/directory - Use fallback values if environment variables aren't set
The build system:
- Copies all files from
embed/tobuild/ - Replaces
{{qlikHost}},{{qlikClientId}},{{qlikAccessCode}}, and{{qlikAppId}}placeholders - Uses environment variables if available, otherwise falls back to placeholder values
- Can be run independently with
npm run build
You can still open embed/index.html directly in your browser, but you'll need to manually replace the Qlik placeholders for the charts to render properly.
MIT License. See LICENSE.
This repository includes automated visual regression tests using Playwright. These tests ensure that the Qlik Sense charts render correctly and match the expected visual output.
-
Install dependencies:
npm install --no-save @playwright/test playwright npx playwright install --with-deps
-
Run the tests:
npx playwright test
- The tests navigate to the hosted Qlik Sense app and verify the presence of key elements.
- Visual regression checks are performed on the
.main-containerto ensure it matches the baseline image. - Timeout for rendering elements is set to 15 seconds to accommodate iframe loading delays.