@reactoo/watchtogether-sdk-js 2.6.14 → 2.6.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,55 +1,58 @@
1
- import FingerprintJs from "@fingerprintjs/fingerprintjs";
2
- import FingerprintJsPro from "@fingerprintjs/fingerprintjs-pro";
1
+ // import FingerprintJs from "@fingerprintjs/fingerprintjs";
2
+ // import FingerprintJsPro from "@fingerprintjs/fingerprintjs-pro";
3
+ import {getFingerPrint} from "./wt-fingerprint";
3
4
 
4
5
  let wait = function(ms) { return new Promise(resolve => setTimeout(resolve, ms))};
5
6
 
6
7
 
7
- const getFingerPrint = function(instanceType, salt) {
8
-
9
- let fingerprint = FingerprintJs.load({
10
- monitoring: false
11
- })
12
-
13
- return fingerprint
14
- .then(fp => fp.get())
15
- .then(result => {
16
- const components = {
17
- ...result.components,
18
- instanceType: { value: instanceType + '_' + salt },
19
- }
20
- return [8,13,18,23].reduce((acc, cur) => {
21
- return acc.slice(0,cur) + '-' + acc.slice(cur)
22
- }, FingerprintJs.hashComponents(components)).substring(0,36)
23
- })
24
- }
25
-
26
- const getPreciseFingerPrint = function() {
27
-
28
- let fingerprintPro = FingerprintJsPro.load({
29
- monitoring: false,
30
- apiKey: '5UHdpSuX3wHr3CjyEiSP',
31
- endpoint: "https://fingerprint.reactoo.com"
32
- })
33
-
34
- return fingerprintPro
35
- .then(fp => fp.get())
36
- .then(result => {
37
- let id = result.visitorId.padEnd(32, '0');
38
- return [8,13,18,23].reduce((acc, cur) => {
39
- return acc.slice(0,cur) + '-' + acc.slice(cur)
40
- }, id).substring(0,36)
41
- })
42
- }
8
+ // const getFingerPrint = function(instanceType, salt) {
9
+ //
10
+ // let fingerprint = FingerprintJs.load({
11
+ // monitoring: false
12
+ // })
13
+ //
14
+ // return fingerprint
15
+ // .then(fp => fp.get())
16
+ // .then(result => {
17
+ // const components = {
18
+ // ...result.components,
19
+ // instanceType: { value: instanceType + '_' + salt },
20
+ // }
21
+ // return [8,13,18,23].reduce((acc, cur) => {
22
+ // return acc.slice(0,cur) + '-' + acc.slice(cur)
23
+ // }, FingerprintJs.hashComponents(components)).substring(0,36)
24
+ // })
25
+ // }
26
+ //
27
+ // const getPreciseFingerPrint = function() {
28
+ //
29
+ // let fingerprintPro = FingerprintJsPro.load({
30
+ // monitoring: false,
31
+ // apiKey: '5UHdpSuX3wHr3CjyEiSP',
32
+ // endpoint: "https://fingerprint.reactoo.com"
33
+ // })
34
+ //
35
+ // return fingerprintPro
36
+ // .then(fp => fp.get())
37
+ // .then(result => {
38
+ // let id = result.visitorId.padEnd(32, '0');
39
+ // return [8,13,18,23].reduce((acc, cur) => {
40
+ // return acc.slice(0,cur) + '-' + acc.slice(cur)
41
+ // }, id).substring(0,36)
42
+ // })
43
+ // }
43
44
 
44
45
 
45
46
  let getBrowserFingerprint = function (instanceType = '', usePrecise = false, salt = '') {
46
- if(!usePrecise) {
47
- return getFingerPrint(instanceType, salt)
48
- }
49
- else {
50
- return getPreciseFingerPrint()
51
- .catch(() => getFingerPrint(instanceType, salt))
52
- }
47
+ // if(!usePrecise) {
48
+ // return getFingerPrint(instanceType, salt)
49
+ // }
50
+ // else {
51
+ // return getPreciseFingerPrint()
52
+ // .catch(() => getFingerPrint(instanceType, salt))
53
+ // }
54
+
55
+ return getFingerPrint(instanceType, salt);
53
56
  };
54
57
 
55
58
  let generateUUID = function () {