All Motor Mashups include a settings/index.js file in the src folder. Here, you can edit some initial settings of your mashup, including connection to your Qlik app and some theming. You can find an example of this below.
In this example, we have 3 objects that we are using in our application:
footer: To edit the footer text
qlikConfig: Used in the Motor component to connect to your Qlik Sense site
appSettings: Settings used both in the Motor component (to theme the Login & Not Connected components) and to change some theme settings of our mashup
Connecting to your Qlik Site
You can connect to your Qlik site by updating the qlikConfig object with the details of your Qlik Sense instance.
The Motor Component
The Motor component will use the qlikConfig and appSettings objects to connect to your Qlik Sense site and apply some customisations.
This is imported into the root of your React project, so you can find it in src/index.js. This will be looking something like the below. Note we are passing the config into our Motor component along with specific customisations to theme the Login & Not Connected components.
The Motor component will pass the connection to your Qlik app as context to all of the hooks in the @motor-js/engine package.
import React from"react";import ReactDOM from"react-dom";import { Motor } from"@motor-js/engine";import reportWebVitals from"./reportWebVitals";import App from"./containers/App";import { qlikConfig, appSettings } from"settings";import Store from"store";ReactDOM.render( <Motorconfig={qlikConfig}logo={appSettings.logo}logoHeight={appSettings.logoHeight}logoWidth={appSettings.logoWidth}buttonColor={appSettings.buttonColor}buttonFontColor={appSettings.buttonFontColor}body={appSettings.body}loginfontFamily={appSettings.loginfontFamily}NotConnectedheader={appSettings.NotConnectedheader}NotConnectedBody={appSettings.NotConnectedBody} > <Store> <App /> </Store> </Motor>,document.getElementById("root"));// If you want to start measuring performance in your app, pass a function// to log results (for example: reportWebVitals(console.log))// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitalsreportWebVitals();
Connecting to Qlik Sense Cloud
Please find an example below connecting to a Qlik Sense Cloud instance. You need to set the qcs property to true and add a webIntId generated from you QSC server.
Hosting Externally, pointing to Qlik Sense Enterprise
Motor currently doesn't handle authentication to Qlik Sense Enterprise. You will need to configure this yourself depending on your choice of authentication method. You can see an example of this below:
For more details of how to connect to your Qlik Site, see Motor.
Having trouble connecting? Send our support team a note at hello@motor-js.io!