If your base64 value is static, you could hard code it in the app. The API I’m using is - it wants a client ID and secret encoded, so I just did it once with an online encoder and pasted the value into an app variable.
Here’s the JS:
//Use this if you want to pass in 'code' as part of the URL string (yourdomain.com?code=CODESTRINGHERE)
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const my_code = urlParams.get('code')
// currently I just pass back the code that was passed in, but mash it up with the second bit of code below, and you've got a base64 encoder/
//alternately, use the code below to take a message in, encode it, and pass it back.
// when we get a message from the app, display it on the page
// Do something with your message
// const reply_message = 'base64,' + btoa(message);
Or if you insist on an “all-Thunkable” solution, you could implement this algorithm. I don’t see anything there that /couldn’t/ be done with blocks. Base64 Encode Algorithm | Base64 Algorithm | Learn | Base64