Example of 0DOF controller handling in WebVR/XR?

Where can I find an example with pure JS? I have VR Box 2 with a thumbstick controller and want to make WebVR port of simple interactive WebGL https://glitch.com/~water-racing demo. I need forward/back and left/right controls.