Hello,
we're trying to embed our metabase analytics into a retool iframe. We have a node.js code to generate the url. this code works if it runs in node.
var jwt = require("jsonwebtoken");
var METABASE_SITE_URL = "https://our_url.com
var METABASE_SECRET_KEY = "our_key";
var payload = {
resource: { dashboard: 2 },
params: {},
exp: Math.round(Date.now() / 1000) + (10 * 60) // 10 minute expiration
};
var token = jwt.sign(payload, METABASE_SECRET_KEY);
var iframeUrl = METABASE_SITE_URL + "/embed/dashboard/" + token + "#bordered=true&titled=true";
return iframeUrl;
we tried loading the jsonwebtoken using the app script loader but i think it fails because it has require
commands inside it. How can we sign a JWT token to be able to use that in our embed frame. The only documentation we found was regarding JWT custom auth for REST API and not in js
thanks for the help!