getAttributes
Function
Using the The getAttributes
function is used to retrieve a set of attributes related to the user's browser or environment. This function returns a Promise that resolves to a BuiltinComponents
object containing various attributes. Each attribute provides information about a specific aspect of the user's environment.
Usage
To use the getAttributes
function in your project, follow these steps:
-
Import the
getAttributes
function into your JavaScript/TypeScript code:import { getAttributes } from 'fingerlockjs'; const attributesPromise = getAttributes(); attributesPromise.then((attributes) => { // Handle the attributes here console.log(attributes); }).catch((error) => { // Handle any errors that occur during attribute retrieval console.error(error); });
Response Payload:
- The
getAttributes
function returns a Promise that resolves to a BuiltinComponents object.
Response Payload
The BuiltinComponents object contains various attributes, each providing information about a specific aspect of the user's environment. Here's a description of some of the attributes included in the response:
- applePay: Information related to Apple Pay.
- architecture: Architecture information.
- audio: Audio-related information.
- canvas: Canvas-related information.
- colorDepth: Color depth of the user's display.
- colorGamut: Color gamut information.
- contrast: Contrast information.
- cookiesEnabled: Indicates if cookies are enabled.
- deviceMemory: Amount of device memory.
- domBlockers: Information about DOM blockers.
- fontPreferences: Font preferences.
- fonts: Array of fonts installed on the device.
- forcedColors: Indicates if forced colors are enabled.
- hardwareConcurrency: Number of hardware threads.
- hdr: Indicates if HDR is supported.
- indexedDB: Indicates if IndexedDB is supported.
- languages: Array of supported languages.
- localStorage: Indicates if local storage is supported.
- math: Mathematical function information.
- monochrome: Monochrome information.
- openDatabase: Indicates if the open database is supported.
- osCpu: Operating system CPU information.
- pdfViewerEnabled: Indicates if the PDF viewer is enabled.
- platform: User's platform (e.g., 'Win32').
- plugins: Array of installed plugins.
- privateClickMeasurement: Private click measurement information.
- reducedMotion: Indicates if reduced motion is enabled.
- screenFrame: Array of screen frame information.