Frontend Setup
Set up frontend for dashboard deployment
There are two ways to deploy dashboard in your front end:
- iFrame Embedding
- Native React Component Embedding 🔒
Please click on the Deploy button in the Hub.
You will need to get the JWT for the current user and the dashboard ID to render the correct dashboard. The JWT is generated by following the steps in Backend Setup. The dashboard ID could be found in the URL when you are viewing the dashboard you want to embed.
Below is an example of deploying component with JWT using Clerk middleware:
Please click on the Deploy button in the Hub.
You will need to get the JWT for the current user and the dashboard ID to render the correct dashboard. The JWT is generated by following the steps in Backend Setup. The dashboard ID could be found in the URL when you are viewing the dashboard you want to embed.
Below is an example of deploying component with JWT using Clerk middleware:
Import Upsolve AI SDK
Ask the Upsolve AI team for “a key to the private NPM library”. Use the key in your .npmrc
or .yarnrc
file. You can then import the SDK into your application.
Use the key as follows:
Now you may run npm i @upsolve-labs/sdk
or yarn add @upsolve-labs/sdk
to install the SDK.
Deploy Dashboard - Tailwind Setup
If you don’t already have Tailwind installed, please follow the setup instructions here. In your tailwind.config.js
you will need to make 2 changes:
And make sure, per the instructions, that in your root.tsx
file you have imported ./output.css
with the output.css
file you generated in step 4 of the Tailwind setup.
Deploy Dashboard - Configure global CSS
In your main layout.tsx
or page.tsx
, add this line to import the Upsolve CSS. For example, if you have a RootLayout
it will look like this:
Deploy Dashboard - Deploy component with JWT
You will need to get the JWT for the current user and the dashboard ID to render the correct dashboard. The JWT is generated by following the steps in Backend Setup. The dashboard ID could be found in the URL when you are viewing the dashboard you want to embed.
Below is an example of deploying component with JWT using Clerk middleware:
Deploy Dashboard - Deploy to Production
Make sure that your .npmrc
or .yarnrc.yml
values are provided to your deployment as env variables, otherwise the deployment will not work.
For enterprise features, look for the 🔒 symbol. These features are available in our Enterprise plan. Please contact us for more information.
Was this page helpful?