SaaSBox
Search…
Creating an API endpoint that returns your application

Step 1: Create a single API to fetch your application into the dashboard

Simple Nocode Apps: If your application is purely a simple nocode embed, you can directly use the nocode embed feature in SaaSBox to store and deliver your embed to the dashboard area from SaaSBox, without a backend. This way you can deliver a set of static embeds for each user plan. See our nocode guide for details. If you need a little more advanced/dynamic use case, then use the guide below.
You typically need a single API call from the SaaSBox dashboard to fetch and display your SaaS application. This can be:
  • An entire single page ReactJS / VueJS application
  • A call that simply returns some data to display in a table,
  • A nocode embed url generated from another application, and tailored for the current user.
Here is an example that creates a single GET API implemented in an ExpressJS server, that returns an embed url for AWS Quicksight dashboards.
The API route defined for generating an embed url for the user:
1
// API defined in routes/index.js:
2
3
let quicksight = require("../controllers/quicksight");
4
// https://<server-url>/get-embed-url returns an anonymous embed url
5
router.get("/get-embed-url", quicksight.get_anon_embed_url);
Copied!
Here is the API handler implementation:
1
exports.get_anon_embed_url = function(req, res, next) {
2
// Generate the embed url
3
return quicksightEmbedGenPromise(req, res, next).then(embed_url => {
4
5
if (embed_url) {
6
// Send the embed url to the requestor, in our case the SaaSBox dashboard.
7
return res.send(embed_url)
8
} else {
9
return res.send({ error: "Could not create embed url"})
10
}
11
}).catch(err => { console.log("Error:", err); res.send({ error: err })});
12
}
Copied!
This handler implements the /get-embed-url API call. It generates and returns an embed url as a json object. You may see the full example in our github repository.

Last modified 1mo ago