-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
51 lines (42 loc) · 936 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* The reCAPTCHA site key
*/
export function getSiteKey(): string;
/**
* The reCAPTCHA secret key
*/
export function getSecretKey(): string;
/**
* Checks with Google if user is verified
*/
export function verify(res: string | undefined): VerifyResponse;
/**
* Check if site key and secret key are configured
*/
export function isConfigured(): boolean;
export interface VerifyResponse {
/**
* Whether this request was a valid reCAPTCHA token for your site
*/
success: boolean;
/**
* The score for this request (0.0 - 1.0)
*/
score: number;
/**
* the action name for this request (important to verify)
*/
action: string;
/**
* Timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ)
*/
challenge_ts: string;
/**
* The hostname of the site where the reCAPTCHA was solved
*/
hostname: string;
/**
* Error codes
*/
"error-codes"?: Array<string>;
}