<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Configure connection mashup in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Configure-connection-mashup/m-p/2488663#M101701</link>
    <description>&lt;P&gt;Hello, actually I made the connections on my mashup through &lt;STRONG&gt;require.js&lt;/STRONG&gt; here is an example o my actual configuration simplified.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;index.html&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html qva-bootstrap="false"&amp;gt;
	&amp;lt;head&amp;gt;
		&amp;lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&amp;gt;
		&amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"&amp;gt;
		&amp;lt;title&amp;gt;Mashup&amp;lt;/title&amp;gt;
		&amp;lt;meta charset="utf-8"&amp;gt;
		&amp;lt;meta name="HandheldFriendly" content="True"&amp;gt;
		&amp;lt;meta name="MobileOptimized" content="320"&amp;gt;
		&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"&amp;gt;
		&amp;lt;meta name="apple-mobile-web-app-capable" content="yes"&amp;gt;
		&amp;lt;meta name="apple-mobile-web-app-status-bar-style" content="black"&amp;gt;
		&amp;lt;meta http-equiv="cleartype" content="on"&amp;gt;
		&amp;lt;!-- Add host to this link if the mashup is on an external webserver --&amp;gt;	
		&amp;lt;link rel="stylesheet" href="../../resources/autogenerated/qlik-styles.css"&amp;gt;
	&amp;lt;/head&amp;gt;
	&amp;lt;body class="body" role="document"&amp;gt;
       
        &amp;lt;!-- Content --&amp;gt;

		&amp;lt;!-- Load scripts --&amp;gt;	
		&amp;lt;script src="../../resources/assets/external/requirejs/require.js"&amp;gt;&amp;lt;/script&amp;gt;
		&amp;lt;script src="index.js"&amp;gt;&amp;lt;/script&amp;gt;
	&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;index.js&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;'use strict';

const configuracion = {
	config: {
		host: window.location.hostname,
		prefix: window.location.pathname.substr(0, window.location.pathname.toLowerCase().lastIndexOf('/extensions') + 1),
		port: window.location.port,
		isSecure: window.location.protocol === "https:"
	},
	appId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
};

require.config({
	baseUrl: (configuracion.config.isSecure ? 'https://' : 'http://') + configuracion.config.host + (configuracion.config.port ? ':' + configuracion.config.port : '') + configuracion.config.prefix + 'resources',
	paths: {
		'angular.controller': '/extensions/app/src/controllers/controller',
		'angular-route-segment': '/extensions/canales/vendor/angular-route-segment.min'
	}
});

define('angularJS.config', ['angular-route-segment'], () =&amp;gt; {
	// We start with angular JS definition
	angular.module('angularApp', ['ngRoute', 'route-segment', 'view-segment']);

	
	// Defining the paths
	angular.module('angularApp').config(['$routeSegmentProvider', '$routeProvider', '$locationProvider', function($routeSegmentProvider, $routeProvider, $locationProvider) {
		$locationProvider.hashPrefix('');
		
		// Path content...
	}]);
});


define('angularApp', ['angularJS.config'], () =&amp;gt; { 
		require([
			'angular.controller',
			],
			() =&amp;gt; { 
				require(['js/qlik'], function (qlik) {

					// Configuration variables
					const { config, appId } = configuracion;

					// Application bootstrap must be before use Qlik Sense API
					// qva-bootstrap="false" must be set on the html
					angular.bootstrap(document, ['angularApp', 'qlik-angular']);

					qlik.setOnError(function (error) {
						console.error(`Error: ${error.message}.`);
					});
				});
				
			}
		)
	}
)

require(['angularApp'], () =&amp;gt; console.log('Qlik API connected to our app'))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to update my configuration to avoid &lt;STRONG&gt;require.js&lt;/STRONG&gt; and use the modern approach with&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;web integration ID&lt;/STRONG&gt; (mention on&amp;nbsp;&lt;A href="https://qlik.dev/embed/nebula/quickstart/build-a-simple-mashup/" target="_blank" rel="noopener"&gt;https://qlik.dev/embed/nebula/quickstart/build-a-simple-mashup/&lt;/A&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;const app = await connect({
  url: "https://your-tenant.us.qlikcloud.com",
  webIntegrationId: "8Ys9sBVyq6i2lxtclPWaaZhQr7OgwKaT",
  appId: "7fc4d85c-0e07-4160-90a9-c2ca4a45fd81",
});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not access to all settings on the qmc, server are hosted by an external company, where they have to set up options to have available the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;web integration ID&lt;/STRONG&gt;?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Oct 2024 11:08:54 GMT</pubDate>
    <dc:creator>adecora</dc:creator>
    <dc:date>2024-10-23T11:08:54Z</dc:date>
    <item>
      <title>Configure connection mashup</title>
      <link>https://community.qlik.com/t5/App-Development/Configure-connection-mashup/m-p/2488663#M101701</link>
      <description>&lt;P&gt;Hello, actually I made the connections on my mashup through &lt;STRONG&gt;require.js&lt;/STRONG&gt; here is an example o my actual configuration simplified.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;index.html&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html qva-bootstrap="false"&amp;gt;
	&amp;lt;head&amp;gt;
		&amp;lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&amp;gt;
		&amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"&amp;gt;
		&amp;lt;title&amp;gt;Mashup&amp;lt;/title&amp;gt;
		&amp;lt;meta charset="utf-8"&amp;gt;
		&amp;lt;meta name="HandheldFriendly" content="True"&amp;gt;
		&amp;lt;meta name="MobileOptimized" content="320"&amp;gt;
		&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"&amp;gt;
		&amp;lt;meta name="apple-mobile-web-app-capable" content="yes"&amp;gt;
		&amp;lt;meta name="apple-mobile-web-app-status-bar-style" content="black"&amp;gt;
		&amp;lt;meta http-equiv="cleartype" content="on"&amp;gt;
		&amp;lt;!-- Add host to this link if the mashup is on an external webserver --&amp;gt;	
		&amp;lt;link rel="stylesheet" href="../../resources/autogenerated/qlik-styles.css"&amp;gt;
	&amp;lt;/head&amp;gt;
	&amp;lt;body class="body" role="document"&amp;gt;
       
        &amp;lt;!-- Content --&amp;gt;

		&amp;lt;!-- Load scripts --&amp;gt;	
		&amp;lt;script src="../../resources/assets/external/requirejs/require.js"&amp;gt;&amp;lt;/script&amp;gt;
		&amp;lt;script src="index.js"&amp;gt;&amp;lt;/script&amp;gt;
	&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;index.js&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;'use strict';

const configuracion = {
	config: {
		host: window.location.hostname,
		prefix: window.location.pathname.substr(0, window.location.pathname.toLowerCase().lastIndexOf('/extensions') + 1),
		port: window.location.port,
		isSecure: window.location.protocol === "https:"
	},
	appId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
};

require.config({
	baseUrl: (configuracion.config.isSecure ? 'https://' : 'http://') + configuracion.config.host + (configuracion.config.port ? ':' + configuracion.config.port : '') + configuracion.config.prefix + 'resources',
	paths: {
		'angular.controller': '/extensions/app/src/controllers/controller',
		'angular-route-segment': '/extensions/canales/vendor/angular-route-segment.min'
	}
});

define('angularJS.config', ['angular-route-segment'], () =&amp;gt; {
	// We start with angular JS definition
	angular.module('angularApp', ['ngRoute', 'route-segment', 'view-segment']);

	
	// Defining the paths
	angular.module('angularApp').config(['$routeSegmentProvider', '$routeProvider', '$locationProvider', function($routeSegmentProvider, $routeProvider, $locationProvider) {
		$locationProvider.hashPrefix('');
		
		// Path content...
	}]);
});


define('angularApp', ['angularJS.config'], () =&amp;gt; { 
		require([
			'angular.controller',
			],
			() =&amp;gt; { 
				require(['js/qlik'], function (qlik) {

					// Configuration variables
					const { config, appId } = configuracion;

					// Application bootstrap must be before use Qlik Sense API
					// qva-bootstrap="false" must be set on the html
					angular.bootstrap(document, ['angularApp', 'qlik-angular']);

					qlik.setOnError(function (error) {
						console.error(`Error: ${error.message}.`);
					});
				});
				
			}
		)
	}
)

require(['angularApp'], () =&amp;gt; console.log('Qlik API connected to our app'))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to update my configuration to avoid &lt;STRONG&gt;require.js&lt;/STRONG&gt; and use the modern approach with&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;web integration ID&lt;/STRONG&gt; (mention on&amp;nbsp;&lt;A href="https://qlik.dev/embed/nebula/quickstart/build-a-simple-mashup/" target="_blank" rel="noopener"&gt;https://qlik.dev/embed/nebula/quickstart/build-a-simple-mashup/&lt;/A&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;const app = await connect({
  url: "https://your-tenant.us.qlikcloud.com",
  webIntegrationId: "8Ys9sBVyq6i2lxtclPWaaZhQr7OgwKaT",
  appId: "7fc4d85c-0e07-4160-90a9-c2ca4a45fd81",
});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not access to all settings on the qmc, server are hosted by an external company, where they have to set up options to have available the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;web integration ID&lt;/STRONG&gt;?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 11:08:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Configure-connection-mashup/m-p/2488663#M101701</guid>
      <dc:creator>adecora</dc:creator>
      <dc:date>2024-10-23T11:08:54Z</dc:date>
    </item>
  </channel>
</rss>

