Deploying your first integration
This article walks you through deploying your first integration. This integration will be a custom widget that displays an <h1> element on the page with an innerHTML value of "Hello World." It will also take a string value (text) from the configuration screen and display it as a description below the <h1> element.
Tip: We recommend using the Hello World integration as a template to avoid the hassle of configuring everything from scratch for the deployment tool to work.
Note: The widget renders inside an <iframe> on the page, and that entire page is rendered by our platform upon a GET request. For this reason, CORS issues don't exist, but some porting may be required for JavaScript code to access objects in the parent window.
Note: The <iframe> gives you total control of how you implement HTML, CSS, and JavaScript in your widget, and you should feel free to disregard the style of this code example in place of your own best practices.
1. Create a project directory
Create a project directory in your development environment.
After creating a local directory for your new project, run the following command inside it using Command Line (Windows) or Terminal (mac):
#!/bin/sh
# This will install ig-deploy into your project directory
npm install --save @igloosoftware/ig-deploy
2. Download the example project
Download the official Igloo Hello World integration code found at the end of this article and extract it into your project directory.
3. Manage credentials
Open credentials.json from the root of your project directory and configure the contents as follows:
{
"account": "<yourIglooRepoName>",
"key": "<yourAzureKey>",
"url": "https://<yourIglooRepoName>.blob.core.windows.net/",
"environment": "<friendlyName>",
"provider": "azure"
}
The field mappings are:
- account: The name of your Igloo-provided Azure instance.
- key: Access/authorization key for the instance.
- url: Exact URL of the Azure blob store.
- environment: A name for developers to identify their credential set (e.g., sandbox, testing, or production).
- provider: azure — do not change this value.
That's it! You're all set up and ready to go.
4. Deploy
Run the following command to deploy the widget to your Igloo-provided Azure instance:
#!/bin/sh
# This command runs deploy.js- which deploys the widget to Azure
node deploy.js
5. Test the integration in your digital workplace
Inside your Igloo digital workplace, place an Integrations widget on a page and select Edit to configure it. Select your repository from the Integration Library dropdown, and you should see ig-deploy-hello-world with a green Igloo icon as shown in the figure below (Fig 5.1)
(Fig. 5.1) ig-deploy-hello-world icon
Select ig-deploy-hello-world and then select Update to add the integration to the page. Next, publish the page by scrolling to its bottom and selecting Publish Page. You can now view the integration in your digital workplace.
Themes
See How to create a theme to learn more about how you can host a theme in Azure so that it's available in your digital workplace's Theme Library.
- 2,201 views
- 0 previews
- 12 versions
- 0 comments
- 0 followers
- Updated By:
- Anum Basit
- January 19, 2022
- Posted By:
- Igloo Webmaster
- May 2, 2019
- Versions:
- v.12
0 Comments