Display widgets as iframe in external website

Hello,

As the title very explicitely mentions, my company would like to know if there is a simple way to display c8y widgets as iframes on external website ?
Thanks,

Paul

Hi @paul.de-la-porte-des,

There are multiple hurdles to take regarding this:

  1. Every request to Cumulocity needs to be authorized (to you want the login screen as in front of the iframe? Are users already logged in in some way?)
  2. Cumulocity does not allow embedding Web Applications in an iframe
  3. Only showing the widget within the iframe

The first hurdle could be solved by creating an additional user with limited permissions that only allows viewing the dashboard and the data displayed on it. And creating a custom application based on the Web SDK that has the user credentials hardcoded into it (might be dangerous depending on the permissions that you give to the user).

The second hurdle can be resolved by following the instructions for iframe usage offered by our codex.

The third hurdle would be to show the widget in fullscreen within that iframe.. By adding some query parameters (hideHeader and hideNavigator) you should at least be able to get rid of the navigation and header.. So you would end up with the whole dashboard including the action bar. You could configure your dashboard to only contain a single widget with the full width of the iframe.


Depending on your CSS skills you might also be able to remove certain parts of that screen to really limit the view to just the widget.

So depending on your skill level these steps might be simple or complicated for you. In case they are too complicated for you, you could get in touch with our Professional Services team to perform the implementation for you.

Regards,
Tristan

2 Likes