How to get a unique ClientID/DeviceID from chrome app/extension?

In your manifest.json

  "permissions": [

Exe­cute the fol­low­ing code when your appli­ca­tion loads. It will fetch the value of the device iden­ti­fier of the direc­tory API, that is gen­er­ated by the server : enterprise_deviceAttributes

It will out­put 32 char­ac­ters long alpha numeric id. For exam­ple, 352z2721-77cc-aa1d-91a2-rc382c42a5a0

chrome.enterprise.deviceAttributes.getDirectoryDeviceId(function(deviceId) {
    console.debug('DeviceIdOfTheDirectoryAPI', deviceId); 

Impor­tant Note :

The chrome OS device has to be enrolled via enter­prise enroll­ment: Enroll Chrome devices

The chrome has to be installed force­fully on the chrome OS devices : Auto­mat­i­cally install apps and extensions

You may also like...