You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
-
# TypingDNA JavaScript recorder
1
+
# TypingDNA JavaScript recorder
2
2
##### A simple way to capture user’s typing patterns
3
3
Full documentation at [api.typingdna.com](https://api.typingdna.com)*
4
4
5
5
### Usage and description
6
-
First you need to import the [typingdna.js](https://typingdna.com/scripts/typingdna.js) file in the page that wants to record a typing pattern. You will need to record typing patterns when a user first creates his account and again whenever you want to authenticate that user on your platform. You can host the .js file yourself.
6
+
First you need to import the [typingdna.js](https://typingdna.com/scripts/typingdna.js) file in the page that wants to record a typing pattern. You will need to record typing patterns when a user first creates his account and again whenever you want to authenticate that user on your platform. You can host the .js file yourself.
7
7
8
-
Alternative locations from where you can include the last class:
8
+
Alternative locations from where you can include the last class:
9
9
*https://typingdna.com/scripts/typingdna.js
10
10
*https://api.typingdna.com/scripts/typingdna.js
11
11
12
12
### TypingDNA class
13
13
14
-
Once you create an instance of the TypingDNA class, the user typing starts being recorded (as a history of strokes). Whenever you want to get the user's typing pattern you have to invoke .getTypingPattern method described in detail below.
14
+
Once you create an instance of the TypingDNA class, the user typing starts being recorded (as a history of keystroke events). Whenever you want to get the user's typing pattern you have to invoke .getTypingPattern method described in detail below.
15
15
16
16
**Returns**: Returns the instance of the TypingDNA class (singleton)
17
17
@@ -28,7 +28,7 @@ Here are the functions available in the TypingDNA class:
28
28
* .start() *Automatically called by default*
29
29
* .stop()
30
30
* .reset()
31
-
* .getQuality(typingPattern) ⇒ `Number`
31
+
* .getQuality(typingPattern) ⇒ `Number`
32
32
33
33
34
34
### TypingDNA.getTypingPattern(optionsObject)
@@ -38,14 +38,15 @@ This is the main function that outputs the user's typing pattern as a `String`
38
38
39
39
**optionsObject**: An object of the following form {type:Number, text:String, textId:Number, length: Number, extended:Boolean, targetId:String}. Detail table below.
40
40
41
-
| Param | Type | Description |
41
+
| Param | Type | Description |
42
42
| --- | --- | --- |
43
-
|**type**|`Number`|`0 for anytext pattern` (when you compare random typed texts of usually 120-180 chars long) <br> `1 for diagram pattern` (recommended in most cases, for emails, passwords, phone numbers, credit cards, short texts) |
43
+
|**type**|`Number`|`0 for anytext pattern` (when you compare random typed texts of usually 120-180 chars long) <br> `1 for diagram pattern` (recommended in most cases, for emails, passwords, phone numbers, credit cards, short texts) |
44
44
|**text**|`String`| (Only for type 1) a typed string that you want the typing pattern for |
45
-
|**textId**|`Number`| (Optional, only for type 1) a personalized id for the typed text |
45
+
|**textId**|`Number`| (Optional, only for type 1) a personalized id for the typed text |
46
46
|**length**|`Number`| (Optional) the length of the text in the history for which you want the typing pattern, for type 0 is usually 140 or more |
47
47
|**extended**|`Boolean`| (Only for type 1) specifies if full information about what was typed is produced, including the actual key pressed, if false, only the order of pressed keys is kept (no actual content) |
48
48
|**targetId**|`String`| (Optional) specifies if pattern is obtain only from text typed in a certain target |
49
+
|**caseSensitive**|`Boolean`| (Optional, default: false, Only for type 1) Used if you pass a text for type 1 |
49
50
50
51
**Examples**
51
52
```js
@@ -55,7 +56,7 @@ var generalPattern = tdna.getTypingPattern({type=0, length=160});
55
56
```
56
57
57
58
### TypingDNA.addTarget(element_id)
58
-
(Optional) Adds a target to the targetIds array. It has to be a text input or text area or any other HTML DOM element that has the .value property. You can add multiple targets (such as username and password fields).
59
+
(Optional) Adds a target to the targetIds array. It has to be a text input or text area or any other HTML DOM element that has the .value property. You can add multiple targets (such as username and password fields).
59
60
60
61
If you omit adding targets the typing patterns will be recorded for the entire typing session.
61
62
@@ -72,14 +73,14 @@ Remove a target from the targetIds array.
72
73
Resets the history stack of recorded typing events.
73
74
74
75
### TypingDNA.start()
75
-
Automatically called at initilization. It starts the recording of typing events. You only have to call .start() to resume recording after a .stop()
76
+
Automatically called at initilization. It starts the recording of typing events. You only have to call .start() to resume recording after a .stop()
76
77
77
78
### TypingDNA.stop()
78
-
Ends the recording of further typing events.
79
+
Ends the recording of further typing events.
79
80
80
81
### TypingDNA.getQuality(typingPattern)
81
82
Checks the quality of a general typing pattern (type 0), how well it is revelated, how useful the
82
-
information will be for matching applications.
83
+
information will be for matching applications.
83
84
84
85
**Returns**: `Number` - A real number between `0` and `1`. Values over `0.3` are acceptable, however a value over `0.7` shows good pattern strength.
0 commit comments