In my node.js application I did an npm install btoa-atob so that I could use the btoa() and atob() functions which are native in clien
npm install btoa-atob
btoa()
atob()
export const universalBtoa = str => { try { return btoa(str); } catch (err) { return Buffer.from(str).toString('base64'); } }; export const universalAtob = b64Encoded => { try { return atob(b64Encoded); } catch (err) { return Buffer.from(b64Encoded, 'base64').toString(); } };