npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qlik

v4.0.5

Published

A collection of helpful utilities for using the Qlik Capability APIs

Downloads

242

Readme

qlik

NPM

This module facilitates easy integration between Qlik Sense Enterprise/Cloud and web applications by leveraging the Qlik Capability API. Developers can seamlessly connect to multiple Qlik Sense applications and interact with the Qlik Sense API using the utilities provided in this package. Qlik helper for more details & other API's

This module provides a set of utilities to streamline the interaction between your web applications and the Qlik Sense API.

Table of Contents

Features

  • Simplifies connection to Qlik Sense environments
  • Facilitates communication with multiple Qlik Sense applications
  • Interacts with various Qlik Sense API endpoints
  • Enhances development experience with Qlik Sense integrations

Installation

To install the Qlik Capability API Wrapper, use npm:

$ npm install qlik

Or with yarn:

$ yarn add qlik

Configuration

Create a configuration object with the following properties:

  • host (string): The hostname of your Qlik Sense instance.
  • port (string | number): The port number to connect to Qlik Sense.
  • prefix (string): The prefix for the Qlik Sense resources (default: /).
  • isSecure (boolean): Whether to use HTTPS (default: true).
  • ticket (string, optional): Ticket for authentication.
  • webIntegrationId (string, optional): Web integration ID for Qlik Sense SaaS.

Example configuration:

const config = {
  host: "your-qlik-sense-host",
  port: 443,
  prefix: "/",
  isSecure: true,
  ticket: "your-ticket",
  webIntegrationId: "your-web-integration-id",
};

Usage

Initialization

Import and initialize the Qlik module with your configuration:

import Qlik from "qlik";

const qlik = new Qlik(config);

Authentication

Authenticate to Qlik Sense:

qlik
  .authenticateToQlik()
  .then(() => console.log("Authenticated to Qlik Sense"))
  .catch((error) => console.error("Authentication failed", error));

Fetch User Information

Fetch authenticated user information:

qlik
  .setAuthUser()
  .then(() => {
    console.log("User information set", qlik.user);
  })
  .catch((error) => console.error("Failed to fetch user information", error));

Fetch Data

Get List of Spaces:

qlik
  .getSpaceList()
  .then((spaces) => console.log("Spaces:", spaces))
  .catch((error) => console.error("Failed to fetch spaces", error));

Get List of Users:

qlik
  .getUserList()
  .then((users) => console.log("Users:", users))
  .catch((error) => console.error("Failed to fetch users", error));

Get List of Apps:

qlik
  .getAppList()
  .then((apps) => console.log("Apps:", apps))
  .catch((error) => console.error("Failed to fetch apps", error));

Get List of Themes:

qlik
  .getThemeList()
  .then((themes) => console.log("Themes:", themes))
  .catch((error) => console.error("Failed to fetch themes", error));

Advanced Usage

Open an App and Fetch Data

async function fetchAppData(appId: string) {
  try {
    const app = await qlik.isAppOpen(appId);
    const sheets = await qlik.getSheet(app);
    const measures = await qlik.getMeasure(app);
    const fields = await qlik.getFields(app);
    const variables = await qlik.getVariable(app);
    const bookmarks = await qlik.getBookmark(app);

    console.log("Sheets:", sheets);
    console.log("Measures:", measures);
    console.log("Fields:", fields);
    console.log("Variables:", variables);
    console.log("Bookmarks:", bookmarks);
  } catch (error) {
    console.error("Failed to fetch app data", error);
  }
}

fetchAppData("your-app-id");

API Documentation

Qlik Class

Constructor

new Qlik(config: IConfig)

remove this link aswell

Fetch the list of spaces.

getSpaceList(): Promise<any[]>

Fetch the list of users.

getUserList(): Promise<any[]>

Fetch the list of apps.

getAppList(): Promise<any[]>

Fetch the list of themes.

getThemeList(): Promise<any[]>

Fetch the list of documents.

getDocs(): Promise<IApp[]>

Fetch a list of objects from an app.

getList(app: IApp, type: ListTypes): Promise<any>

  • app (Qlik app instance): Qlik app instance.
  • type (Type of objects to fetch): Type of objects to fetch.

Fetch measures from an app.

getMeasure(app: IApp): Promise<any>

Fetch variables from an app.

getVariable(app: IApp): Promise<any>

Fetch fields from an app.

getFields(app: IApp): Promise<any>

Fetch bookmarks from an app.

getBookmark(app: IApp): Promise<any>

Evaluate an expression in an app.

evaluateExpression(app: IApp, title: any): Promise<any>

  • app: Qlik app instance.
  • title: Expression to evaluate.

Fetch properties of an object in an app.

objectProper(app: IApp, model: any): Promise<any>

  • app: Qlik app instance.
  • model: Object model.

Fetch titles of an object in an app.

getQlikObjectTitles(app: IApp, id: string): Promise<any>

  • app: Qlik app instance.
  • id: Object ID.

Fetch sheets from an app.

getSheet(app: IApp): Promise<any>

Fetch a specific object from an app.

callObject(app: IApp, id: string): Promise<any>

  • app: Qlik app instance.
  • id: Object ID.

Fetch data from an app.

getApp(id: string): Promise<any[]>

  • id: App ID.

Example

Enterprise

To get started with a sample module for React with Qlik Enterprise, clone the example project from GitHub and start the project.

Steps:

  1. Clone the repository:
$ git clone https://github.com/ranvithm/qlik.git
  1. Navigate to the example project directory:
$ cd qlik/example/with-enterprise
  1. Install the dependencies:
$ npm install
  1. Start the project:
$ npm start

Before utilizing the Qlik Capability API Wrapper, it's necessary to create a virtual proxy in your Qlik Sense environment to configure the prefix and whitelist the host (localhost) and port (3000).

Explore the sample project here.

Cloud

To get started with a sample module for React with Qlik Cloud, clone the example project from GitHub and start the project.

Steps:

  1. Clone the repository:
$ git clone https://github.com/ranvithm/qlik.git
  1. Navigate to the example project directory:
cd qlik/example/with-cloud
  1. Install the dependencies:
$ npm install
  1. Start the project:
$ npm start

Before utilizing the Qlik Capability API Wrapper, it's necessary to create a web integration id in your Qlik Sense environment to configure and whitelist the host (localhost) and port (3000).

Explore the sample project here.

Contributing

This library is still under construction and we are looking for contributors. If you would like to contribute, please contact me: [email protected]

License

MIT © Ranjithkumar M