I am arriving kind of late to this, but if you are still looking for an alternative you could give suncalc.js a try. Basically you specify time input with a regular date object and then calculate sun position with
SunCalc.getPosition( date, lat, lng)
Which will give you altitude and azimuth in radians. That should be enough for converting them to spherical coordinates, let me know if you need further help