What is the _capuid in localStorage used for by Capacitor?

When running an Ionic app with Capacitor (v3) added as a web app, I can see that a key _capuid is being save to Window.localStorage. It’s an UUID like c35b1ec0-20c4-4e89-ab07-145aa261edf5 for example.

Bildschirmfoto 2021-04-07 um 12.35.39

What’s the purpose of this _capuid ? Looks like some kind of local installation ID … Can we use it somehow?

Hey,

for Capacitor 2 the _capuid comes from the capacitor device plugin

It is created here and you can use it for tracking devices. But be careful, when cleaning the browser cache or using another browser a new _capuid is created.

I think for Capacitor 3 it’s the same :wink:

Best regards

1 Like

Thanks. So it is the the uuid property of DeviceInfo that we get from getInfo()? (looking into the code, it looks like on Android this is returning the Settings.Secure.ANDROID_ID.

Yes the _capuid can be accessed via the uuid property on the DeviceInfo and for Android it’s the
Settings.Secure.ANDROID_ID

1 Like