Last Updated:
September 20, 2021
by
Muskan Purohit
| Version: 7
| 1,542 views
| 0 followers
members are following updates on this item.
This article shows developers how to access Igloo workplace data from inside a custom widget, or retrieve it manually via a browser. The following information can be retrieved this way:
You can get this data directly using a browser by opening the browser console, and entering the following into the console:
Igloo.community
Custom widgets are rendered on the page inside an iframe, so functions of the parent document/window are not directly accessible by the logic inside the widget. Since the iframe is rendered directly on the page from the same domain, there are no CORs issues. Developers can use the code example below to access the parent document/window.
/**
* @description Use this JavaScript inside your widget to access workplace data
*/
var workplaceInfo= window.parent.Igloo.community
/** Your custom code here... */
console.log(workplaceInfo);
Both the above methods will return information in the following format:
{id: "a2bb0890-bafc-48d3-8440-ab6f0f570b93", key: "12345678", workplaceKey: "1234567890", title: "Sample Workplace", timezoneTZ: "America/New_York", …}