In recent years I’ve been developing a side project called UAParser.js. It's basically an open-source tool that provides a more structured way to detect user environments compared to the traditional user-agent strings.
As for now, it has gained more than 12 millions of downloads per week (https://www.npmjs.com/package/ua-parser-js) and are being used by many top tech companies that you can think of, under the hood.
I’m currently working on the next major version update, which will include new features, improved accuracy, and also offer commercial editions.
Please check out: https://uaparser.dev/