Skip to content

Full Toolkit for Next-Level Domain Analysis

Implement `waitUntil` for query logging ⏳

Felix Wotschofsky116bc0381da8
diff --git a/app/lookup/[domain]/layout.tsx b/app/lookup/[domain]/layout.tsx
index cfdcda1..0daf03e 100644
--- a/app/lookup/[domain]/layout.tsx
+++ b/app/lookup/[domain]/layout.tsx
@@ -1,6 +1,6 @@
+import { waitUntil } from '@vercel/functions';
import { ExternalLinkIcon } from 'lucide-react';
import type { Metadata } from 'next';
-import dynamic from 'next/dynamic';
import { headers } from 'next/headers';
import { notFound } from 'next/navigation';
import { type FC, type ReactNode } from 'react';
@@ -53,7 +53,7 @@ const LookupLayout: FC<LookupLayoutProps> = async (props) => {
const headersList = await headers();
const ip = getVisitorIp(headersList);
const { isBot, userAgent } = isUserBot(headersList);
- recordLookup({ domain, ip, userAgent, isBot });
+ waitUntil(recordLookup({ domain, ip, userAgent, isBot }));
return (
<>
diff --git a/package.json b/package.json
index de37a7e..b6dc9bc 100644
--- a/package.json
+++ b/package.json
@@ -28,6 +28,7 @@
"@types/punycode": "^2.1.4",
"@types/validator": "^13.12.0",
"@uidotdev/usehooks": "^2.4.1",
+ "@vercel/functions": "^1.4.2",
"@vercel/speed-insights": "^1.0.12",
"autoprefixer": "^10.4.20",
"class-variance-authority": "^0.7.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 30631c9..6f1d10d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -51,6 +51,9 @@ importers:
'@uidotdev/usehooks':
specifier: ^2.4.1
+ '@vercel/functions':
+ specifier: ^1.4.2
+ version: 1.4.2
'@vercel/speed-insights':
specifier: ^1.0.12
@@ -1965,6 +1968,15 @@ packages:
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
+ '@vercel/[email protected]':
+ resolution: {integrity: sha512-WLY3g6NT1SVJDAoAqz5pJfJ8uyOmEejZkatZn0q57Dn6qXNrh/pjbeffolQy9npWRYJPcfwjgqw8tUqolTEyuw==}
+ engines: {node: '>= 16'}
+ peerDependencies:
+ '@aws-sdk/credential-provider-web-identity': '*'
+ peerDependenciesMeta:
+ '@aws-sdk/credential-provider-web-identity':
+ optional: true
+
'@vercel/[email protected]':
resolution: {integrity: sha512-ZGQ+a7bcfWJD2VYEp2R1LHvRAMyyaFBYytZXsfnbOMkeOvzGNVxUL7aVUvisIrTZjXTSsxG45DKX7yiw6nq2Jw==}
peerDependencies:
@@ -6050,6 +6062,8 @@ snapshots:
'@ungap/[email protected]': {}
+ '@vercel/[email protected]': {}
+
optionalDependencies:
@@ -6735,8 +6749,8 @@ snapshots:
'@typescript-eslint/parser': 8.2.0([email protected])([email protected])
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
eslint-plugin-jsx-a11y: 6.10.2([email protected])
eslint-plugin-react: 7.35.0([email protected])
eslint-plugin-react-hooks: 5.0.0([email protected])
@@ -6754,13 +6768,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
debug: 4.3.6
enhanced-resolve: 5.17.1
eslint: 8.57.0
fast-glob: 3.3.2
get-tsconfig: 4.7.6
is-core-module: 2.15.1
@@ -6771,29 +6785,29 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 8.2.0([email protected])([email protected])
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
transitivePeerDependencies:
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 8.2.0([email protected])([email protected])
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
transitivePeerDependencies:
- supports-color
dependencies:
'@rtsao/scc': 1.1.0
array-includes: 3.1.8
@@ -6804,7 +6818,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
hasown: 2.0.2
is-core-module: 2.15.1
is-glob: 4.0.3