Rider HTTP Client CryptoJS.enc.Base64.stringify

suppose I am trying to do 1 or all of a few different things. currently have a postman lib that I am working to migrate over and am stuck with a pre-request script that builds and signs a JWT token. that script has dependencies on CryptoJS but this lib is not available best of my knowledge 

  1. how do I import / include / ref additional libs in request scripts if possible.
  2. what is the `crypto` alternative to `CryptoJS.enc.Base64.stringify()`

I expected the following code to work as expected but sadly this doesn't result with a usable JWT token :/

This does not create a valid JWT token :(

let header = JSON.stringify({"alg": "HS512"});
let body = JSON.stringify({
"username": request.environment.get('the_big_username'),
"entity": request.environment.get('the_big_entity'),
"datetime": new Date().toISOString()

let theBigSecret = request.environment.get("the_big_secret");
let theHeader = crypto.sha512()

let theBody = crypto.sha512()

const content = `${theHeader}.${theBody}`
let theSignature = encodeURIComponent(crypto.hmac.sha512()
.withTextSecret(theBigSecret, )

// pm.globals.set('jws', signedJws);
const allTogetherNow = `${content}.${theSignature}`

// request.variables.set('apexJws', signedJws);
request.variables.set('the_big_token', allTogetherNow);