swiftwasm / swiftwasm/JavaScriptKit
[Question] To control USB devices directly from a browser
Open
@diuming is already working on this.
Since Apr 23, 2026.
question
- Dominant language
- Swift
- Stars
- 986
- Forks
- 76
- Avg merge
- 21h 11m
- Merged PRs (30d)
- 4
Description
Hi,
I've successfully communicated and controlled my USB device within a browser using Emscripten + libusb (compiled into a static library by Emscripten).
Most of code (communication and control) is written in C, and Emscripten compiles it into JavaScript and wasm.
I am specifically concerned about the WebUSB bridging, as Emscripten provides a built-in layer for libusb, which SwiftWasm might lack.
Is it possible to convert this communication and control C code to Swift using Swift SDKs for WebAssembly?
Browser communicate with USB Device?
`My Swift code` + `Swift SDKs for WebAssembly` + `Emscripten libusb static library`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.