How to display a 3D model from base64 encoded string in Three.js?

Hello everyone ,
I want to display a base64 encoded string in Three.js, but couldn’t find a way to do so, can anyone help with this issue?
I’m receiving a JSON , which contains a base64 encoded glb file, and I want to display it in the scene
Thanks,
Zaid,

you need to convert it back to an arraybuffer: javascript - Convert base64 string to ArrayBuffer - Stack Overflow

after that it’s just

new GLTFLoader().parse(buffer, "/", data => {
  ...
})

btw, a base64 glb on the web wouldn’t advisable, they’re big enough as they come but adding, i don’t know … 30% extra? doesn’t seem right. that’s why glb exists in the first place, because a compressed gltf is wasteful (it’s a json with base64 encoded buffers).