whatisgithub

What is ps5-controller-webhid?

ashr12/ps5-controller-webhid — explained in plain English

Analysis updated 2026-05-18

0TypeScriptAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A TypeScript library that lets web browsers read and control PS5 DualSense controllers over WebHID.

Mindmap

mindmap
  root((ps5-controller-webhid))
    What it does
      DualSense WebHID access
      Named button and stick data
      Rumble and trigger feedback
    Tech stack
      TypeScript
      WebHID
      React
    Use cases
      Browser game input
      React controller hook
      Controller hardware testing
    Audience
      Web game developers
      React developers
      Controller enthusiasts

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Read DualSense controller buttons, sticks, and motion sensors directly in a web game.

USE CASE 2

Trigger rumble vibration and adaptive trigger resistance from browser JavaScript.

USE CASE 3

Add PS5 controller support to a React app using the included hook.

USE CASE 4

Test whether a specific DualSense controller and browser combination works correctly.

What is it built with?

TypeScriptWebHIDReactVite

How does it compare?

ashr12/ps5-controller-webhid0xradioac7iv/tempfs7vignesh/pgpulse
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires a secure browser context (localhost or HTTPS) and a Chromium based browser that supports WebHID.

MIT license: free to use, modify, and share, including commercially, as long as the copyright notice stays attached.

So what is it?

ps5-controller-webhid is a JavaScript and TypeScript library that lets web browsers read input from a PS5 DualSense controller directly, without any plugin or native app. It uses a browser technology called WebHID to talk to the controller and gives you clean, named access to buttons, joysticks, triggers, motion sensors, touch pad contacts, and battery level, instead of making you decode raw hardware data yourself. It can also send output back to the controller, such as rumble vibration and the adaptive trigger resistance the DualSense is known for. You install it as an npm package and connect a controller with a few lines of code, then either subscribe to a stream of input updates or read the current state yourself inside a game loop. It also ships with a matching React hook for projects built with React, kept as an optional add on so non React projects are not forced to include it. Alongside the library, the repository includes a small tester web app that connects a controller and checks that buttons, motion, and haptic feedback are all working, producing a local report of the results. The controller can connect over USB or Bluetooth, including step by step Bluetooth pairing instructions for macOS. All controller data stays inside the browser, the project has no backend server, analytics, or tracking of any kind. It currently supports the standard DualSense controller in Chrome and Edge on desktop, with other controllers and browsers like Safari and Firefox not yet supported. This is aimed at web developers building browser based games or interactive experiences who want proper DualSense controller support. It builds on an existing library called dualsense-ts and is released under the MIT license, though it is an independent project not affiliated with Sony.

Copy-paste prompts

Prompt 1
Help me install ps5-controller-webhid and connect a DualSense controller in my browser game.
Prompt 2
Explain how to use the React hook from ps5-controller-webhid/react in my app.
Prompt 3
Walk me through pairing a DualSense controller over Bluetooth on macOS for WebHID.
Prompt 4
Show me how to set rumble and adaptive trigger feedback with this library.

Frequently asked questions

What is ps5-controller-webhid?

A TypeScript library that lets web browsers read and control PS5 DualSense controllers over WebHID.

What language is ps5-controller-webhid written in?

Mainly TypeScript. The stack also includes TypeScript, WebHID, React.

What license does ps5-controller-webhid use?

MIT license: free to use, modify, and share, including commercially, as long as the copyright notice stays attached.

How hard is ps5-controller-webhid to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is ps5-controller-webhid for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.