import jwt from 'jsonwebtoken';
// this routine must happen on server side as your secret should remain secret
const embedToken = "<MY_EMBED_TOKEN>";
const clientSecret = "<MY_CLIENT_SECRET>";
const orgSlug = "<MY_ORG_SLUG>";
// we require you to generate a payload with the default filters you want to pass
// if you don't want to pass filters just input an empty object {}
// the filter payload is an object which keys are the apiName of the filter
// and the value is the value that you want to pass
expiration_date: Date.now() + 24 * 60 * 60 * 1000 // valid for 24h
// generate and sign your JWT, please use the HS256 algorithm
const myToken = jwt.sign(payload, clientSecret);
// generate the embed url
const embed_url = `https://app.whaly.io/${orgSlug}/embed/report/${embedToken}?token=${myToken}`