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.
Files changed (2) hide show
  1. package/README.md +75 -40
  2. 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
- async function run() {
21
- const result = await client.verify('test@example.com');
22
- console.log(result);
23
- /**
24
- * {
25
- * valid: true,
26
- * email: "test@example.com",
27
- * results: {
28
- * syntax: true,
29
- * disposable: false,
30
- * mx_records: true,
31
- * mailbox: true
32
- * },
33
- * score: 0.95,
34
- * timestamp: 1741512345678
35
- * }
36
- */
37
- }
38
-
39
- run();
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veripy-sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Email verification wrapper for Veripy",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",