Search code examples
authenticationbabylonjs

Control asset loading in babylonjs for authentication


All examples I could find just pass the url to babylonjs and it does a GET internally.

I need to either add an authentication header to this request, or just do the loading myself and pass the byte array to babylonjs.

How is authentication supposed to work with babylonjs?


Solution

  • Hello in this case you can just do the loading by yourself and then creates a blob and use object.createObjectUrl to refer to it: var blob = new Blob([data]); var url = window.URL.createobjecturl(blob);