Skip to content

getSid JavaScript

Requires a Node.js runtime ('qsu/node')

Gets the Security Identifier (SID) value for the current user on the device. Throws an error if the value is not obtained.

The SID value is only supported on Windows and macOS. Other OSes throw an error.

Also, the SID value used on macOS is a value created for the directory service. If you don't trust this value, use the machineId method instead.

This value can be changed by the user.

Parameters

No required parameters

Returns

string

Examples

javascript
console.log(await sid()); // Returns 'S-1-5-21-406418252-5582013529-1321253100-2001'

Released under the MIT License