Hello I am working on embedding the Gooddata data ...
# gooddata-ui
g
Hello I am working on embedding the Gooddata data elements into my React UI and am having trouble understanding how to use the React SDK to embed the full analyzer page. I have set up the React SDK and have succeeded in embedding a single insight using the identifier from the catalog-export. But I am unsure on how to import the entire analyzer page so that our end user could create their own custom reports within the embedded page.
m
Hi Grant, you can embed the Analytical Designer, here we have an explicit example how to do it using Iframe. With React also is possible, we have the documentation you can follow but we do not have explicit example. Let us know if that helps.
g
Great thankyou! I went through both of those and tried out the iframes which were super easy to implement for what I needed. However, I have been unable to get the react method to work. When embedding the analyzer or the dashboards creator page. I do not understand what idRef to use?
m
Hi Grant, I would like to clarified, after ask internally, embedding the the analytical designer is not possible with SDK, for the moment only possible with Iframe. I hope this still works for you. Now, regarding your question, in general the
idRef
function is used to create a reference to your GoodData resources using their unique IDs. For example, if you want to embed an insight with the ID '1234567890abcdef', you would use:
const insightRef = idRef('1234567890abcdef');
Then, you would pass
insightRef
to the
InsightView
component. Please, let me know if that helps.
g
Yes thank you, iFrames will work, I just wanted to make sure their wasn't a way to use the SDK since that was our preferred method. I am running into some additional trouble setting up authentication using apiTokenAuthentication for the Analyzer. I successfully set up the dashboard version but the analyzer is giving me trouble. I believe my issue is in the src=url. If I put in the dashboard URL (ourcompany/dashboards/embedded/#/workspace/dev1/dashboard/?showNavigation=true&?apiTokenAuthentication=true) it correctly loads the iframe. but if I put in the analyze URL (ourcompany/embedded/#/dev1/reportId/?apiTokenAuthentication=true) it fails. However if I remove the ?apiTokenAuthentication=true part from teh analyze URL and just use my user browser login then the analyze will load. Any idea why that might be?
I figured it out. Thanks.
🙌 1