Embed the Bold BI dashboard using React with PHP application
Bold BI Embedding React with PHP Sample
You can download React with PHP sample. This Bold BI React (front-end) with PHP (back-end) sample contains the dashboard embedding samples. In this sample, React
application act as the front-end, and PHP
acts as the back-end application. This article guides you in rendering of dashboards available in your Bold BI server.
Requirements to run the demo
The samples require the following requirements to run.
- PHP installer
- Node.js
- Visual Studio Code
- In Visual studio code download the extensions, PHP intelephense and PHP Server.
Using the React with PHP sample
-
Open the PHP sample in visual studio code or any respective IDE.
-
Open the
authorizeserver.php
in the location, /PHP/rest/authorizeserver.php and provide the mandatory values as per your Bold BI Server.UserEmail UserEmail of the Admin in your Bold BI, which will be used to get the dashboards . secretCode Get your EmbedSecret key from the Embed tab by enabling the Enable embed authentication in the [administration page](https://help.boldbi.com/embedded-bi/site-administration/embed-settings/). -
Now, run the PHP sample.
-
Open the React sample in Visual studio code.
-
Open the
DashboardListing.js
file in the following location, /src/DashboardListing/DashboardListing.js. -
Please change the following properties in the
DashboardListing.js
file as per your Bold BI Server.apiHost PHP application would be run on http://localhost:3000/, which needs to be set as apiHost. RootUrl Dashboard Server URL (Eg: http://localhost:5000/bi, http://demo.boldbi.com/bi). SiteIdentifier For the Bold BI Enterprise edition, it should be like `site/site1`. For Bold BI Cloud, it should be an empty string. Environment Your Bold BI application environment. (If Cloud, you should use `cloud,` if Enterprise, you should use `enterprise`). authorizationUrl Url of the 'GetDetails' action in the PHP application. dashboardId Dashboard Id of dashboard you want to embed. -
Now run the React sample.
Install npm
To install all dependent packages, use the below command
npm install
Run/Serve
To run the sample, use the below command
npm start
Online Demos
Look at the Bold BI Embedding sample to live demo here.
Documentation
A complete Bold BI Embedding documentation can be found on Bold BI Embedding Help.