convert json to base64 javascript code example
Example: convert json to base64 javascript
const json = { "a": 1, "b": 2 }
const string = JSON.stringify(json) // convert Object to a String
const encodedString = btoa(string) // Base64 encode the String