How to access confluence REST API from JIRA addon?

Expanding on what @daniel suggested it might be worth speaking to someone from the eazyBI team because I know they’ve achieved this:

Their main app for JIRA:
A suppporting app for Confluence that allows you to embed their reports into a Confluence page:

They’ve hidden the second Confluence app from so it can only be found via UPM within Confluence. I assume this is so people are less likely to start in the wrong place and allows them to better do SEO.