  
.then(() => {
const tm = new ThumbmarkJS.Thumbmark();
tm.get().then((res) => {
console.log(res)
})
})
`
Install with NPM
ā¼ļø Please refer to the documentation
However, you get it from NPM:
`bash
npm install @thumbmarkjs/thumbmarkjs
`
:warning: the fingerprinting needs to run in a browser context. Let me know if the library fails on a server side import, that shouldn't happen. To calculate the components though, it needs the browser APIs.
Integrations (React, Vue)
React and Vue integration plugins are being worked on, have a look.
Options are... optional
Thorough documentation about options are at docs.thumbmarkjs.com.
Options are passed to the Thumbmark class constructor, like so:
`javascript
const tm = new ThumbmarkJS.Thumbmark({
option_key: option_value
})
`
| option | type | example | what it does |
| - | - | - | - |
| api_key | string | 'ae8679607bf79f......' | Setting this to a key you've obtained from https://thumbmarkjs.com makes thumbmarks incredibly more unique and enables visitorId
| exclude | string[] | ['webgl', 'system.browser.version'] | Removes components from the fingerprint hash. An excluded top-level component improves performance. |
| include | string[] | ['webgl', 'system.browser.version'] | Only includes the listed components. exclude still excludes included components. |
| permissions_to_check | string[] | ['gyroscope', 'accelerometer'] | Checks only selected permissions. Like 'include', but more low-level. Permissions take the longest to resolve, so this is if you need to cut down some milliseconds. |
| timeout | integer | 5000 | Default is 5000. Component timeout in milliseconds.
| logging | boolean | true | Default is true. Some releases collect at most 0.01% logs to improve the library. This doesn't affect the user. |
| performance | boolean | false | Default is false. Setting to true includes millisecond performance of component resolving |
| stabilize | string[] | ['private', 'iframe'] | A preset exclusion list for different scenarios. Default is ['private', 'iframe'] which means thumbmark uses settings designed to stabilize for private browsing and iframes (i.e. thumbmark should be stable over those situations).
| metadata | varies | 'event-123' | Passes metadata to webhooks. Does not affect thumbmark. |
example usage:
`javascript
const tm_api = new ThumbmarkJS.Thumbmark({
api_key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
exclude: ['math']
});
`
Custom components
You can add custom components to the hash with includeComponent, which takes two parameters, the key` being the key of the component in the JSON and the function that returns the value (a string, a number or a JSON object). Custom components are described in here in the documentation.