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-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,17 @@
1
1
# TypingDNA JavaScript recorder
2
-
##### A simple way to record typing patterns
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 create an instance of the TypingDNA class. Once it's done, 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.
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
+
8
+
Alternative locations from where you can include the last class:
9
+
*https://typingdna.com/scripts/typingdna.js
10
+
*https://api.typingdna.com/scripts/typingdna.js
11
+
12
+
### TypingDNA class
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.
7
15
8
16
**Returns**: Returns the instance of the TypingDNA class (singleton)
9
17
@@ -28,7 +36,7 @@ This is the main function that outputs the user's typing pattern as a `String`
28
36
29
37
**Returns**: A typing pattern in `String` form
30
38
31
-
**optionsObject**: An object of the following form {type:Number, text:String, textId:Number, length: Number, extended:Boolean}. Detail table below.
39
+
**optionsObject**: An object of the following form {type:Number, text:String, textId:Number, length: Number, extended:Boolean, targetId:String}. Detail table below.
32
40
33
41
| Param | Type | Description |
34
42
| --- | --- | --- |
@@ -37,6 +45,7 @@ This is the main function that outputs the user's typing pattern as a `String`
37
45
|**textId**|`Number`| (Optional, only for type 1) a personalized id for the typed text |
38
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 |
39
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
+
|**targetId**|`String`| (Optional) specifies if pattern is obtain only from text typed in a certain target |
40
49
41
50
**Examples**
42
51
```js
@@ -48,7 +57,7 @@ var generalPattern = tdna.getTypingPattern({type=0, length=160});
48
57
### TypingDNA.addTarget(element_id)
49
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).
50
59
51
-
If you omit adding targets the typing patterns will be outputed for the entire typing session.
60
+
If you omit adding targets the typing patterns will be recorded for the entire typing session.
0 commit comments