vpndetection-web 1.2.0 → 1.2.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 CHANGED
@@ -30,7 +30,7 @@ It runs in Chrome and Edge 109, Firefox 115 ESR and Safari 16.4 or newer. TypeSc
30
30
 
31
31
  ## Usage
32
32
 
33
- **No API key needed to start.** The Unlimited tier answers `ip`, `is_vpn`, Tor and relay detection, `location` and `asn`, with no daily or monthly cap, with a key or without one. In a page the address calling is the visitor's, so `myIp` tells you about the visitor:
33
+ **No API key needed to start.** Unlimited, the free plan, answers `ip`, `is_vpn`, Tor and relay detection, `location` and `asn`, with no daily or monthly cap, with a key or without one. In a page the address calling is the visitor's, so `myIp` tells you about the visitor:
34
34
 
35
35
  ```js
36
36
  import { VPNDetection } from 'vpndetection-web';
@@ -48,7 +48,7 @@ console.log(result.asn?.name); // who runs the announcing network
48
48
 
49
49
  ### With an API key
50
50
 
51
- Where the key stays private (see above), every paid plan answers every field: `is_hosting`, `is_cdn` and the four proxy flags as well, and the provider, confidence and last-seen detail behind each flag. The plans differ only in how many lookups they include, and a new account can try every field, 100 lookups a day. Create a key in the [console](https://app.vpndetection.io), then pass it in:
51
+ Where the key stays private (see above), every paid plan answers every field: `is_hosting`, `is_cdn` and the four proxy flags as well, and the provider, confidence and last-seen detail behind each flag. The plans differ only in how many lookups they include, and a free account tries every field, 100 lookups a day. Create a key in the [console](https://app.vpndetection.io), then pass it in:
52
52
 
53
53
  ```js
54
54
  const client = new VPNDetection({ apiKey: 'your-api-key' });
@@ -79,7 +79,7 @@ console.log(ent.usage.requests); // 580
79
79
  console.log(ent.usage.window_end); // when the allowance resets
80
80
  ```
81
81
 
82
- Usage counts against the anniversary of your subscription on a paid plan, not the calendar month and not the billing period, and against the UTC day on a trial key; it is the same number a lookup is gated on. `hard_limit` is null on an uncapped plan, which is not the same as zero. It needs a key, so it belongs where a key does.
82
+ Usage counts against the anniversary of your subscription on a paid plan, not the calendar month and not the billing period, and against the UTC day on the free plan; it is the same number a lookup is gated on. `hard_limit` is null on an uncapped plan, which is not the same as zero. It needs a key, so it belongs where a key does.
83
83
 
84
84
  ### Batch lookup
85
85
 
@@ -246,12 +246,12 @@ The library is ES2022 and needs only what a browser has, `fetch` and, for PKCE,
246
246
 
247
247
  ### Absent is not false
248
248
 
249
- The Unlimited tier leaves out `isHosting`, `isCdn` and the four proxy flags, and of the detail behind each flag it answers only Tor's and relay's; a trial key's answer carries `trialExpired`, true once its day of full answers is spent. A field your key does not include is `undefined`, which means "not in your plan" rather than "checked, and no".
249
+ Unlimited leaves out `isHosting`, `isCdn` and the four proxy flags, and of the detail behind each flag it answers only Tor's and relay's; a free-plan key's answer carries `trialExpired`, true once its daily trial is spent. A field your key does not include is `undefined`, which means "not in your plan" rather than "checked, and no".
250
250
 
251
251
  ```js
252
252
  result.isHosting ?? false // when you only want the flag
253
- result.isHosting === undefined // on the Unlimited tier: not in your plan
254
- result.trialExpired === true // a trial key's day of full answers is spent
253
+ result.isHosting === undefined // on Unlimited: not in your plan
254
+ result.trialExpired === true // a free-plan key's daily trial is spent
255
255
  ```
256
256
 
257
257
  ## Other Libraries
package/dist/client.d.ts CHANGED
@@ -18,7 +18,7 @@ export interface CacheOptions {
18
18
  }
19
19
  export interface Options {
20
20
  /**
21
- * Your API key. Without one a lookup is on the Unlimited tier: `ip`,
21
+ * Your API key. Without one a lookup is on Unlimited, the free plan: `ip`,
22
22
  * `is_vpn`, the Tor and relay members, `location` and `asn`, with no daily
23
23
  * or monthly cap. A batch needs a key on a paid plan.
24
24
  * A key in a web page is readable by anyone who opens the page.
@@ -123,7 +123,7 @@ export declare class VPNDetection {
123
123
  *
124
124
  * Usage counts against the ALLOWANCE WINDOW - on a paid plan the
125
125
  * anniversary of the subscription, not the calendar month and not the
126
- * billing period, and on a trial key the UTC day - and it is the same
126
+ * billing period, and on the free plan the UTC day - and it is the same
127
127
  * number a lookup is gated on. It can lag by a few seconds, because
128
128
  * requests are counted in memory and flushed in aggregate.
129
129
  *
@@ -149,7 +149,7 @@ export declare class VPNDetection {
149
149
  * An IPv4-mapped address is looked up as the IPv4 address it carries, and its
150
150
  * answer keyed as you passed it. The batch endpoint needs a paid plan:
151
151
  * without a key every address sent to it carries an `unauthorized` error,
152
- * and a trial key's batch of two or more a `bad_request` (HTTP 402).
152
+ * and a free-plan key's batch of two or more a `bad_request` (HTTP 402).
153
153
  */
154
154
  lookupBatch(ips: Iterable<string>, options?: BatchOptions): Promise<Map<string, Result | VPNDetectionError>>;
155
155
  private unstored;
package/dist/client.js CHANGED
@@ -163,7 +163,7 @@ export class VPNDetection {
163
163
  *
164
164
  * Usage counts against the ALLOWANCE WINDOW - on a paid plan the
165
165
  * anniversary of the subscription, not the calendar month and not the
166
- * billing period, and on a trial key the UTC day - and it is the same
166
+ * billing period, and on the free plan the UTC day - and it is the same
167
167
  * number a lookup is gated on. It can lag by a few seconds, because
168
168
  * requests are counted in memory and flushed in aggregate.
169
169
  *
@@ -197,7 +197,7 @@ export class VPNDetection {
197
197
  * An IPv4-mapped address is looked up as the IPv4 address it carries, and its
198
198
  * answer keyed as you passed it. The batch endpoint needs a paid plan:
199
199
  * without a key every address sent to it carries an `unauthorized` error,
200
- * and a trial key's batch of two or more a `bad_request` (HTTP 402).
200
+ * and a free-plan key's batch of two or more a `bad_request` (HTTP 402).
201
201
  */
202
202
  async lookupBatch(ips, options = {}) {
203
203
  const concurrency = checkConcurrency(options.concurrency);
@@ -17,8 +17,8 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
17
17
  * Lookup
18
18
  *
19
19
  * Answers what is known about a single IPv4 or IPv6 address. Which fields
20
- * come back is decided by the presented key; with no key, the Unlimited
21
- * tier, the answer is `ip`, `is_vpn`, the Tor and relay members,
20
+ * come back is decided by the presented key; with no key, on Unlimited,
21
+ * the free plan, the answer is `ip`, `is_vpn`, the Tor and relay members,
22
22
  * `location` and `asn`.
23
23
  *
24
24
  */
@@ -59,9 +59,9 @@ export declare const lookupMyIp: <ThrowOnError extends boolean = false>(options?
59
59
  * and never a throttle.
60
60
  *
61
61
  * A batch needs a paid plan: without a key the call is refused with `401`,
62
- * and with a trial key with `402`, unless it names one address, which is
63
- * answered as `GET /{ip}` would answer it. Unlimited and a trial look up
64
- * one address at a time.
62
+ * and with a key on the free plan with `402`, unless it names one address,
63
+ * which is answered as `GET /{ip}` would answer it. Unlimited looks up one
64
+ * address at a time.
65
65
  *
66
66
  */
67
67
  export declare const lookupBatch: <ThrowOnError extends boolean = false>(options: Options<LookupBatchData, ThrowOnError>) => RequestResult<LookupBatchResponses, LookupBatchErrors, ThrowOnError>;
@@ -5,8 +5,8 @@ import { urlSearchParamsBodySerializer } from './client/index.js';
5
5
  * Lookup
6
6
  *
7
7
  * Answers what is known about a single IPv4 or IPv6 address. Which fields
8
- * come back is decided by the presented key; with no key, the Unlimited
9
- * tier, the answer is `ip`, `is_vpn`, the Tor and relay members,
8
+ * come back is decided by the presented key; with no key, on Unlimited,
9
+ * the free plan, the answer is `ip`, `is_vpn`, the Tor and relay members,
10
10
  * `location` and `asn`.
11
11
  *
12
12
  */
@@ -71,9 +71,9 @@ export const lookupMyIp = (options) => (options?.client ?? client).get({
71
71
  * and never a throttle.
72
72
  *
73
73
  * A batch needs a paid plan: without a key the call is refused with `401`,
74
- * and with a trial key with `402`, unless it names one address, which is
75
- * answered as `GET /{ip}` would answer it. Unlimited and a trial look up
76
- * one address at a time.
74
+ * and with a key on the free plan with `402`, unless it names one address,
75
+ * which is answered as `GET /{ip}` would answer it. Unlimited looks up one
76
+ * address at a time.
77
77
  *
78
78
  */
79
79
  export const lookupBatch = (options) => (options.client ?? client).post({
@@ -96,9 +96,9 @@ export type LookupResponse = {
96
96
  location?: Location;
97
97
  asn?: Asn;
98
98
  /**
99
- * On every answer to a trial key, an organization on no paid plan, and
100
- * on no other: `false` while the organization's 100 full answers for
101
- * the UTC day last, `true` once the answer is Unlimited's.
99
+ * On every answer to a key on the free plan, and on no other: `false`
100
+ * while its organization's daily trial lasts (every field for the first
101
+ * 100 lookups each UTC day), `true` once the answer has Unlimited's.
102
102
  *
103
103
  */
104
104
  trial_expired?: boolean;
@@ -409,15 +409,15 @@ export type EntitlementApikey = {
409
409
  };
410
410
  export type EntitlementPlan = {
411
411
  /**
412
- * The plan the organization is on, or `trial` on none: a trial
413
- * answers every field for the organization's first 100 lookups each
414
- * UTC day, and Unlimited's answer after them.
412
+ * The plan the organization is on: `free` for the free plan,
413
+ * Unlimited, or a paid plan's key. On `free`, usage counts the
414
+ * day's lookups answered with every field, its daily trial.
415
415
  *
416
416
  */
417
417
  key: string;
418
418
  /**
419
419
  * The field tier, which decides how much of a lookup answer comes
420
- * back; `free` is a trial's. What each tier includes is documented
420
+ * back; `free` is the free plan's. What each tier includes is documented
421
421
  * on the lookup endpoint rather than repeated here, so there is one
422
422
  * place it can be wrong.
423
423
  *
@@ -675,8 +675,8 @@ export type LookupBatchErrors = {
675
675
  */
676
676
  401: LookupError;
677
677
  /**
678
- * The key is a trial's, an organization on no paid plan, and the batch
679
- * names more than one address: a batch needs a paid plan.
678
+ * The key is on the free plan and the batch names more than one
679
+ * address: a batch needs a paid plan.
680
680
  *
681
681
  */
682
682
  402: LookupError;
package/dist/types.d.ts CHANGED
@@ -27,8 +27,9 @@ export interface Result {
27
27
  isMobproxy?: boolean;
28
28
  isPubproxy?: boolean;
29
29
  /**
30
- * On a Trial key's answers only: `false` while the organization's 100 full answers for the
31
- * UTC day last, `true` once the answer is Unlimited's.
30
+ * On answers to a key on the free plan only: `false` while its organization's daily trial
31
+ * lasts (every field for the first 100 lookups each UTC day), `true` once the answer has
32
+ * Unlimited's.
32
33
  */
33
34
  trialExpired?: boolean;
34
35
  vpn?: VpnDetail;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpndetection-web",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Official browser client library for the VPNDetection API. Detect VPNs, proxies, Tor, hosting and CDN IPs.",
5
5
  "type": "module",
6
6
  "license": "MIT",