vpndetection-next 2.1.2 → 2.1.3

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 +15 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -43,15 +43,28 @@ Then read the answer anywhere downstream:
43
43
 
44
44
  ```tsx
45
45
  // app/page.tsx
46
+ import { Suspense } from 'react';
46
47
  import { headers } from 'next/headers';
47
48
  import { readLookup } from 'vpndetection-next';
48
49
 
49
- export default async function Page() {
50
+ async function Greeting() {
50
51
  const lookup = readLookup(await headers());
51
- return <main>{lookup?.isVpn ? 'Hello, VPN user' : 'Hello'}</main>;
52
+ return lookup?.isVpn ? 'Hello, VPN user' : 'Hello';
53
+ }
54
+
55
+ export default function Page() {
56
+ return (
57
+ <main>
58
+ <Suspense fallback="Hello">
59
+ <Greeting />
60
+ </Suspense>
61
+ </main>
62
+ );
52
63
  }
53
64
  ```
54
65
 
66
+ The read of `headers()` sits inside `<Suspense>` because a new Next 16 app turns Cache Components on, and `next build` then refuses a page that reads request data outside one.
67
+
55
68
  By default nothing is blocked. Your own code decides what the answer means — which is usually what you want, because whether a VPN visitor is a problem depends entirely on what they are doing.
56
69
 
57
70
  **Set a `matcher`.** Without one the proxy runs on every request including static assets, which costs a lookup each.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpndetection-next",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "Official Next.js proxy/middleware for the VPNDetection API. Detect VPNs, proxies, Tor, hosting and CDN visitors on every request.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "node": ">=22"
45
45
  },
46
46
  "dependencies": {
47
- "vpndetection": "^5.5.3"
47
+ "vpndetection": "^5.6.0"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "next": ">=15"