Emscripten exposes the devicemotion
event as a callback, so I think it should be possible to add Emscripten as a supported backend for SDL's Sensor API.
It does come with the caveat of requiring explicit user permission beforehand but that's the case for other APIs as well.