Load object to be perpendicular to x-axis

Is there a way I can detect the model and make it automatically perpendicular to the x-axis grid? I can do this manually by rotating -90 degrees in the x-axis, but I was wondering if there is an automatic solution. I realized this only happens with the three.js loader. It’s perpendicular when I load in other 3d libraries such as babylon.js

What I’m not understanding is that how are other libraries able to know the model is the right way up and what I can do in three.js to implement that