Create a bookmark

//Create and publish a bookmark
//Authorizes through OAuth2 M2M to connect to a Qlik Cloud application.
//To create an OAuth client for this snippet, go here:
//To use a sample app with this snippet, download and import the executive
//dashboard from this github location
* host: the hostname of your tenant
* clientId: the clientId of the OAuth2 client you created
* clientSecret: the client secret for the OAuth2 client you created
* appId: The GUID for the Qlik Sense app

//Uncomment below if you're using this code with
//global.fetch = require('@replit/node-fetch');

const Qlik = require('@qlik/sdk').default;
const { AuthType } = require("@qlik/sdk");

const host = "<>";
const clientId = "<OAUTH_CLIENT_ID>";
const clientSecret = "<OAUTH_CLIENT_SECRET>";
const appId = "<APPID_GUID_LIKE_THIS_b1b79fcd-e500-491c-b6e9-2ceaa109214c";

const config =  {
  authType: AuthType.OAuth2,
  host: host,
  clientId: clientId,
  clientSecret: clientSecret

(async () => {
  const qlik = new Qlik(config);
  await qlik.auth.authorize();
  const app = await qlik.apps.get(appId);
  const bmk = await app.createBookmarkEx(
      "creationDate": new Date().toISOString(),
      "qInfo": {
        "qType": "bookmark",
      "qMetaDef": {
        "qName": "hello-bookmark",
        "title": "hello-bookmark",
        "description": "Hello! This is a bookmark created with a snippet from",
        "isExtended": true
  const bmkLayout = await bmk.getLayout();
  const pubBmk = await bmk.publish();


Was this page helpful?