Gamepad support in HTML5 games is currently pretty bad. Even if a framework or game engine says it supports them, in practice I've found it to be very unreliable especially when using different gamepads on different systems, primarily because the underlying JavaScript Gamepad API doesn't map buttons and sticks consistently. If there are reliable implementations out there, I haven't found them.
So I wrote a tool in JavaScript that you can launch from within your game that asks the player to press all the buttons and move all the sticks on their gamepad while it listens, stores that data in their browser's LocalStorage where games can read it, and then sends them back to your game. A nice aspect is that if the player configures their gamepad from ANY game on the site, EVERY game on the site can read the data and use it for gamepad support without them needing to run the tool again.
The Gamepad mapper page is linked here, and you can see how I used it in practice in my game Quad. The Gamepad mapper's page has links to demos showing the gamepad mapper being used in Unity, Godot, HaxeFlixel, and pure JavaScript including instructions and source code for those implementations in the author comments.