veripy-sdk 1.0.1 → 1.0.2
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.
- package/README.md +75 -40
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,40 +1,75 @@
|
|
|
1
|
-
# veripy-sdk
|
|
2
|
-
|
|
3
|
-
The official Node.js wrapper for the Veripy Email Verification API.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install veripy-sdk
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
import VeripyClient from 'veripy-sdk';
|
|
15
|
-
|
|
16
|
-
const client = new VeripyClient({
|
|
17
|
-
apiKey: 'vp_your_api_key_here'
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
# veripy-sdk
|
|
2
|
+
|
|
3
|
+
The official Node.js wrapper for the Veripy Email Verification API.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install veripy-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import VeripyClient from 'veripy-sdk';
|
|
15
|
+
|
|
16
|
+
const client = new VeripyClient({
|
|
17
|
+
apiKey: 'vp_your_api_key_here'
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const result = await client.verify('test@example.com');
|
|
21
|
+
console.log(result);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Configuration
|
|
25
|
+
|
|
26
|
+
You can configure local security features to prevent API abuse and save on credits.
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
const client = new VeripyClient({
|
|
30
|
+
apiKey: 'vp_your_api_key_here',
|
|
31
|
+
config: {
|
|
32
|
+
rateLimit: true, // Enable local token bucket rate limiting (Default: true)
|
|
33
|
+
spamDetection: true // Enable local similar-email detection (Default: true)
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Local Rate Limiting
|
|
39
|
+
The SDK includes a built-in token bucket rate limiter. By default, it allows a burst of **10 requests** and refills at a rate of **10 requests per minute**. This helps prevent accidental loops or spikes from consuming your API quota.
|
|
40
|
+
|
|
41
|
+
### Local Spam Detection
|
|
42
|
+
The SDK monitors request patterns and blocks "highly similar" email variations (e.g., `user1@gmail.com`, `user2@gmail.com`) if more than **3 variations** are sent within a **1 minute window**.
|
|
43
|
+
|
|
44
|
+
## Per-Call Overrides
|
|
45
|
+
|
|
46
|
+
You can override the global configuration for specific calls if needed.
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
// Bypass local checks for a specific verification
|
|
50
|
+
const result = await client.verify('test@example.com', {
|
|
51
|
+
rateLimit: false,
|
|
52
|
+
spamDetection: false
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Types
|
|
57
|
+
|
|
58
|
+
### VerifyResult
|
|
59
|
+
```typescript
|
|
60
|
+
interface VerifyResult {
|
|
61
|
+
valid: boolean;
|
|
62
|
+
email: string;
|
|
63
|
+
results: {
|
|
64
|
+
syntax: boolean;
|
|
65
|
+
disposable: boolean;
|
|
66
|
+
mx_records: boolean;
|
|
67
|
+
mailbox: boolean;
|
|
68
|
+
};
|
|
69
|
+
score: number; // 0 to 1
|
|
70
|
+
timestamp: number;
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
ISC
|