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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@cluster-data-experience/qlik-modules

v2.8.3

Published

Modules for connecting to Qlik and consuming object data

Readme

@cluster-data-experience/qlik-modules

npm version Auth Module TypeScript License: ISC TypeScript

A comprehensive and type-safe React library for integrating Qlik Sense into your applications with powerful hooks, providers, and utilities.

✨ Features

  • 🚀 Easy Integration - Simple setup with Qlik Sense applications
  • ⚛️ React Hooks - Modern React patterns with custom hooks for all Qlik objects
  • 🎯 Type Safety - Full TypeScript support with comprehensive type definitions
  • 🔄 Real-time Updates - Reactive data updates from Qlik Engine
  • 📊 Rich Visualizations - Support for Charts, KPIs, Tables, Lists, and more
  • 🛡️ Error Handling - Robust error handling and loading states
  • 🎨 Customizable - Flexible configuration and theming options

🎯 What it does

qlik-modules provides a set of React hooks and utilities for integrating Qlik Sense into your applications. It simplifies working with Qlik's Enigma.js and handles common tasks such as:

  • 🔐 Multiple authentication methods (OAuth2 PKCE, Web Integration, On-Premise)
  • Connection Management - Seamless connection to Qlik Sense Cloud and Enterprise servers
  • State Management - Centralized state for Qlik sessions and app data
  • Object Lifecycle - Automatic creation and cleanup of Qlik objects
  • Data Visualization - Ready-to-use hooks for charts, KPIs, tables, and lists
  • Selection Handling - Complete selection management with history support
  • Variable Management - Easy variable creation and manipulation
  • Performance Optimization - Built-in performance strategies
  • Modular architecture following SOLID principles

✨ Features

🔐 Enterprise-Grade Authentication

  • OAuth2 PKCE Flow: RFC 7636 compliant with secure token management
  • Web Integration: Session-based authentication with CSRF protection
  • On-Premise Support: Cookie-based authentication for Qlik Sense Enterprise
  • Type-Safe: Full TypeScript support across all authentication methods

🎯 Developer Experience

  • React Hooks: Easy-to-use hooks for all Qlik functionality
  • Auto-Reconnection: Automatic session management and recovery
  • Debug Mode: Comprehensive logging for troubleshooting
  • Custom Callbacks: Flexible authentication flow customization
  • Zero Config: Sensible defaults for quick setup

📊 Visualization Support

  • KPIs and metrics
  • Charts and graphs
  • Filter objects
  • Pivot tables
  • Custom visualizations

📦 Installation

npm install @cluster-data-experience/qlik-modules

Peer Dependencies

This library requires the following peer dependencies:

npm install react enigma.js

🚀 Quick Start

1. Basic Setup

import React from "react";
import {
  QlikProvider,
  useQlikApp,
  useGenericKPI,
} from "@cluster-data-experience/qlik-modules";

// Connection configuration
const config = {
  isSecure: true,
  host: "your-qlik-server.com",
  port: 443,
  appId: "YOUR-APP-ID",
  prefix: "/prefix/",
  webIntegrationId: "YOUR-WEB-INTEGRATION-ID", // For Qlik Sense Cloud
};

// Root component with Qlik Provider
const App = () => {
  return (
    <QlikProvider config={config}>
      <Dashboard />
    </QlikProvider>
  );
};

2. Using Hooks

// Component using Qlik hooks
const Dashboard = () => {
  const { app } = useQlikApp();

  // Your Qlik-enabled component logic

  return <div>{/* Your Qlik-enabled components */}</div>;
};

Authentication

qlik-modules supports multiple authentication methods for both Qlik Sense Cloud and on-premise deployments:

Qlik Sense Cloud

OAuth2 with Client ID (Recommended)

const config = {
  host: "your-tenant.qlikcloud.com",
  appId: "YOUR-APP-ID",
  clientId: "YOUR-OAUTH-CLIENT-ID", // OAuth2 PKCE flow
};

Web Integration ID

const config = {
  host: "your-tenant.qlikcloud.com",
  appId: "YOUR-APP-ID",
  webIntegrationId: "YOUR-WEB-INTEGRATION-ID", // Session-based auth
};

Qlik Sense On-Premise

const config = {
  host: "your-qlik-server.local",
  appId: "YOUR-APP-ID",
  isSecure: false, // or true for HTTPS
  port: 4848, // or 443 for HTTPS
};

Authentication Architecture

The authentication module has been completely refactored into a modular, maintainable architecture:

  • 🔐 OAuth2 PKCE: RFC 7636 compliant implementation with secure token management
  • 🌐 Web Integration: Session-based authentication with CSRF protection
  • 🏢 On-Premise: Cookie-based authentication for Qlik Sense Enterprise
  • 📦 Modular Design: 16 specialized modules following SOLID principles
  • 🧪 100% Testable: Each authentication provider independently testable
  • 📚 Comprehensive Docs: Complete architecture and usage documentation

For detailed authentication documentation, see:

Custom Authentication Callback

You can customize the authentication flow with an onAuthRequired callback:

const config = {
  host: "your-tenant.qlikcloud.com",
  appId: "YOUR-APP-ID",
  webIntegrationId: "YOUR-WEB-INTEGRATION-ID",
};

const options = {
  debugMode: "verbose", // Enable detailed logging
  onAuthRequired: (loginUrl) => {
    // Custom authentication handling
    // e.g., show a custom login modal instead of redirecting
    console.log("Authentication required. Login URL:", loginUrl);
    showCustomLoginModal(loginUrl);
  },
};

<QlikProvider config={config} options={options}>
  <App />
</QlikProvider>;

Documentation

For detailed documentation, see the docs folder:

Getting Started

API & Hooks

Advanced

Authentication Module (Deep Dive)

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide to learn how to:

  • Set up the development environment
  • Use the internal playground for testing
  • Link the package to other projects with npm link
  • Follow our code conventions and workflow

License

ISC

Table Component

const ProductTable = () => {
  const { data, columns, loading, sort, pagination, nextPage, previousPage } =
    useTable({
      dimensions: ["Product", "Category"],
      measures: ["Sum(Sales)", "Sum(Quantity)"],
      pageHeight: 20,
    });

  return (
    <div className="table-container">
      <table>
        <thead>
          <tr>
            {columns.map((col, i) => (
              <th
                key={col.id}
                onClick={() => sort(i, "asc")}
                style={{ cursor: col.sortable ? "pointer" : "default" }}
              >
                {col.title}
              </th>
            ))}
          </tr>
        </thead>
        <tbody>
          {data?.map((row, i) => (
            <tr key={i}>
              {row.qMatrix[0].map((cell, j) => (
                <td key={j}>{cell.qText}</td>
              ))}
            </tr>
          ))}
        </tbody>
      </table>

      <div className="pagination">
        <button onClick={previousPage} disabled={pagination.currentPage === 0}>
          Previous
        </button>
        <span>
          Page {pagination.currentPage + 1} of {pagination.totalPages}
        </span>
        <button onClick={nextPage} disabled={!pagination.hasNext}>
          Next
        </button>
      </div>
    </div>
  );
};

Built with ❤️ by Cluster Data Experience