Run the Vite dashboard locally
The dashboard uses React, TypeScript, Tailwind CSS and shadcn/ui. With Node.js 22.12 or newer installed, run npm ci and npm run dev, then open http://localhost:8080/dashboard.html.
Each Qlik object has a matching skeleton until its initial data connection is available. Slow connections and errors display a notice. Live data still requires the local origin and OAuth callback to be allowed in Qlik.
Run npm test and npm run build to validate the app. Azure publishes the resulting dist/ directory, including the unchanged report runtime and OAuth callback URLs.
What this demo shows
The analytics page is rendered with Qlik Embed. The six KPIs, chart and table embed the existing Qlik sheet objects. Two ancoreShare buttons, Sales Report and Current Selections + Variable, are rendered with the Capability API inside a floating report window.
Open the live demoHow are the report buttons embedded?
Designed for supported Nebula visualizations. It is the right choice for a modern embedded analytics interface.
An extension that depends on the Qlik extension and Capability API runtime to initialize its report actions.
Qlik documents that analytics/chart renders Nebula visualizations. Qlik also documents extensions as supported through classic/app, classic/chart with iframe="true", Capability APIs, or iFrame embedding. Therefore, direct use of an ancoreShare extension with analytics/chart is not a supported integration path and can render without providing the extension behavior.
The pattern used here preserves Qlik Embed for analytics while isolating the legacy Capability API runtime inside an iframe only for the ancoreShare buttons.
Implementation steps
1. Embed the analytics objects
Load Qlik Embed with your OAuth SPA client. Give every embedded object the same app ID and session identity.
<qlik-embed
ui="analytics/chart"
app-id="<app-id>"
object-id="<chart-object-id>"
identity="reporting-session">
</qlik-embed>
2. Embed the report buttons in a report window
Place a same-origin iframe inside a compact, non-modal report window. Keep the dashboard interactive outside the window, show the title and variable value only in the window header, and keep the iframe mounted when hidden. Pass the same session identity to the Capability API page.
<iframe
id="report-frame"
title="ancoreShare Reports"
src="api.html?identity=reporting-session">
</iframe>
3. Open the same app through the Capability API
In the iframe page, load RequireJS and js/qlik, then open the same app with the matching identity and Web Integration ID.
const config = {
host: "<tenant>.qlikcloud.com",
prefix: "/",
port: 443,
isSecure: true,
webIntegrationId: "<web-integration-id>",
identity: "reporting-session"
};
// Required by ancoreShare's own export authentication:
window.config = config;
const app = qlik.openApp("<app-id>", config);
app.getObject("report-button", "dRenfA");
app.getObject("context-report-button", "CJjxGy");
4. Transfer the dashboard context
Both pages use the same Qlik tenant, app ID, authenticated user, and identity. Before the report buttons are shown, the dashboard sends its active selections and vTest to the iframe. The initial transfer clears the Capability API session, applies the selections, and sets the variable. While the floating window remains mounted, a Qlik selection object watches for changes and committed variable updates trigger a new transfer. Typing in the input alone does not change the report; use Apply. Subsequent transfers update only changed fields and variables, including clearing fields removed from the selection.
Updates are debounced and serialized. The host checks the iframe source, origin and request ID, and updates the title only after acknowledgement. Identical snapshots are ignored to avoid feedback loops from a shared Engine session. The report buttons are temporarily covered while context is updating; the dashboard stays interactive. The iframe is kept mounted without a reload or a new login.
5. Establish the legacy report session
The Qlik Embed objects use OAuth SPA. The ancoreShare extension's legacy Reporting API calls use the interactive Qlik session from the Web Integration. Before loading the extension, call /api/v1/users/me with credentials and the Web Integration ID. If Qlik returns 401 or 403, show an explicit new-tab sign-in link. After signing in with the same account, the user chooses Try again to remount only api.html?identity=…. The login provider can refuse iframe embedding, so do not navigate an embedded report to the login page or redirect the dashboard. A directly opened report page can still use a normal top-level login redirect.
Expose window.config before loading ancoreShare. Its native setQlikHeaders() reads window.config.webIntegrationId to obtain the CSRF token for its export requests. A top-level const config does not create this window property. Omitting the explicit assignment can leave the dashboard working while report exports fail with 401 and “No Qlik Printing Service”.
getObject() can resolve before the extension runtime has finished loading. Wait for ancoreSoft.setQlikHeaders, await its initialization, and validate the CSRF token and Web Integration ID before announcing readiness. The implemented bounded wait is in public/api.html. Do not send authentication tokens in context messages.
Permission and sign-in failures
The dashboard listens to qlik-embed:error as well as connection promise rejections. An explicit app access-denied error replaces the charts and report controls with one English message. Network errors remain connection errors; a slow response alone is not treated as a permissions failure.
The report iframe uses a separate cookie-based Qlik session. A successful OAuth dashboard sign-in does not establish that report session. An unauthenticated iframe notifies the dashboard to replace the loading overlay with English sign-in instructions. The user opens Qlik in a new tab and retries only the report iframe; the dashboard remains interactive and keeps its selections. Use the same account for both sessions.
If the iframe never announces readiness, a 30-second startup timeout replaces the skeleton with recovery actions. This can indicate a blocked sign-in frame, third-party cookie restrictions, network issues, or an unavailable extension; it does not by itself identify the cause. A new-tab sign-in cannot override a browser policy that blocks cross-site cookies. If the Qlik hub is accessible but the report frame still receives 401, compare a regular browser window with private browsing and inspect the request's Cookies tab for excluded or blocked cookies. Do not assume every 401 proves a cookie block, or change app permissions to solve a session failure. For diagnosis, check the report frame's /api/v1/users/me response, WebSocket errors and the browser console. Do not share session cookies or access tokens.
Appearance and Qlik objects
The dashboard mirrors the existing Sales Dashboard sheet. Its six KPI objects, chart and table are embedded by object ID; there are no copied totals or changes to the Qlik app. The surrounding page uses blue #367BBF, red #DA3832, white cards and grey dividers. Report button styling is scoped to the iframe's .report-object containers.
Keep the report container measurable during loading with visibility: hidden, and reserve its full 64-pixel height. Avoid global header styles in the iframe: they also affect Qlik's internal object header and can squeeze the button until its caption is clipped. The second embedded report, CJjxGy, is labelled “Current Selections + Variable” and receives the same synchronized context. The floating window retains enough height for the native export progress dialog.
Required Qlik configuration
- A Qlik Cloud app containing the analytics objects and ancoreShare report button objects.
- An OAuth 2.0 SPA client for Qlik Embed, with the host page callback URL and origin configured.
- A Web Integration that allows the host page origin for the Capability API iframe.
- An interactive Qlik browser session available to the legacy Capability API and ancoreShare requests. Browsers must permit this cookie-based session.
- Access to the app and ancoreShare extension for the signed-in Qlik user.