In our project we did use the app/65139, but it would indeed be prettier to use clientside code. You can do this by creating a widget that will retrieve it. This is the first option I found: https://aboutreact.com/react-native-get-unique-id-of-device/ but that uses ReactNative, so that is for later. For the Hybrid Offline App maybe you can create a widget that uses either Phonegap or MoSync (got this wisdom from StackOverflow.
I have checked the widget-resources on Github and we have a Javascript Action for this: https://github.com/mendix/widgets-resources/blob/master/packages-hybrid/hybrid-mobile-actions/src/mobile/GetDeviceInfo.ts
Please have a look at https://appstore.home.mendix.com/link/app/109513/. These are mostly Native mobile actions, but some might work on Hybrid as well.