Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

replace @vercel/edge with @vercel/functions

Steven Teyc20521cd4a3d
diff --git a/apps/web/app/api/analytics/edge/route.ts b/apps/web/app/api/analytics/edge/route.ts
index 137e88a5d9..54cb1c7105 100644
--- a/apps/web/app/api/analytics/edge/route.ts
+++ b/apps/web/app/api/analytics/edge/route.ts
@@ -9,7 +9,7 @@ import { getLinkViaEdge, getWorkspaceViaEdge } from "@/lib/planetscale";
import { ratelimit } from "@/lib/upstash";
import { analyticsQuerySchema } from "@/lib/zod/schemas/analytics";
import { DUB_DEMO_LINKS, DUB_WORKSPACE_ID, getSearchParams } from "@dub/utils";
-import { ipAddress } from "@vercel/edge";
+import { ipAddress } from "@vercel/functions";
import { NextResponse, type NextRequest } from "next/server";
export const runtime = "edge";
diff --git a/apps/web/app/api/auth/account-exists/route.ts b/apps/web/app/api/auth/account-exists/route.ts
index 72f603856b..69019f6714 100644
--- a/apps/web/app/api/auth/account-exists/route.ts
+++ b/apps/web/app/api/auth/account-exists/route.ts
@@ -1,7 +1,7 @@
import { isWhitelistedEmail } from "@/lib/edge-config";
import { DATABASE_URL, conn } from "@/lib/planetscale";
import { ratelimit } from "@/lib/upstash";
-import { ipAddress } from "@vercel/edge";
+import { ipAddress } from "@vercel/functions";
import { NextRequest, NextResponse } from "next/server";
export const runtime = "edge";
diff --git a/apps/web/app/api/track/click/route.ts b/apps/web/app/api/track/click/route.ts
index a65448af21..6306d9e4e1 100644
--- a/apps/web/app/api/track/click/route.ts
+++ b/apps/web/app/api/track/click/route.ts
@@ -4,8 +4,7 @@ import { getLink, getProjectByPublishableKey } from "@/lib/planetscale";
import { recordClick } from "@/lib/tinybird";
import { redis } from "@/lib/upstash";
import { nanoid } from "@dub/utils";
-import { ipAddress } from "@vercel/edge";
-import { waitUntil } from "@vercel/functions";
+import { ipAddress, waitUntil } from "@vercel/functions";
import { NextResponse } from "next/server";
export const runtime = "edge";
diff --git a/apps/web/app/api/unsplash/search/route.ts b/apps/web/app/api/unsplash/search/route.ts
index 57496c8daf..de4c4abcfe 100644
--- a/apps/web/app/api/unsplash/search/route.ts
+++ b/apps/web/app/api/unsplash/search/route.ts
@@ -1,5 +1,5 @@
import { ratelimit } from "@/lib/upstash";
-import { ipAddress } from "@vercel/edge";
+import { ipAddress } from "@vercel/functions";
import { NextResponse } from "next/server";
import { unsplash } from "../utils";
diff --git a/apps/web/lib/api/utils.ts b/apps/web/lib/api/utils.ts
index 2bb67b9b34..7e85f5df78 100644
--- a/apps/web/lib/api/utils.ts
+++ b/apps/web/lib/api/utils.ts
@@ -1,4 +1,4 @@
-import { ipAddress } from "@vercel/edge";
+import { ipAddress } from "@vercel/functions";
import { getToken } from "next-auth/jwt";
import { headers } from "next/headers";
import { NextRequest } from "next/server";
diff --git a/apps/web/lib/middleware/utils/get-identity-hash.ts b/apps/web/lib/middleware/utils/get-identity-hash.ts
index 8e295fec99..4609fff0fd 100644
--- a/apps/web/lib/middleware/utils/get-identity-hash.ts
+++ b/apps/web/lib/middleware/utils/get-identity-hash.ts
@@ -1,5 +1,5 @@
import { LOCALHOST_IP, hashStringSHA256 } from "@dub/utils";
-import { ipAddress } from "@vercel/edge";
+import { ipAddress } from "@vercel/functions";
import { userAgent } from "next/server";
/**
diff --git a/apps/web/lib/tinybird/record-click.ts b/apps/web/lib/tinybird/record-click.ts
index 233d2f9193..d2eb4c8a6b 100644
--- a/apps/web/lib/tinybird/record-click.ts
+++ b/apps/web/lib/tinybird/record-click.ts
@@ -6,7 +6,7 @@ import {
nanoid,
} from "@dub/utils";
import { EU_COUNTRY_CODES } from "@dub/utils/src/constants/countries";
-import { geolocation, ipAddress } from "@vercel/edge";
+import { geolocation, ipAddress } from "@vercel/functions";
import { userAgent } from "next/server";
import { LinkWithTags, transformLink } from "../api/links/utils/transform-link";
import {
diff --git a/apps/web/package.json b/apps/web/package.json
index 6e57499ef9..b94fd77577 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -38,9 +38,8 @@
"@upstash/qstash": "^2.3.0",
"@upstash/ratelimit": "^1.1.3",
"@upstash/redis": "^1.25.1",
- "@vercel/edge": "^0.3.1",
"@vercel/edge-config": "^0.4.1",
- "@vercel/functions": "^1.0.1",
+ "@vercel/functions": "^1.4.1",
"@vercel/og": "^0.6.2",
"@visx/axis": "^2.14.0",
"@visx/curve": "^3.3.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 5d98591504..b061b5c47b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -110,15 +110,12 @@ importers:
'@upstash/redis':
specifier: ^1.25.1
version: 1.25.1
- '@vercel/edge':
- specifier: ^0.3.1
- version: 0.3.1
'@vercel/edge-config':
specifier: ^0.4.1
version: 0.4.1
'@vercel/functions':
- specifier: ^1.0.1
- version: 1.0.1
+ specifier: ^1.4.1
+ version: 1.4.1
'@vercel/og':
specifier: ^0.6.2
version: 0.6.2
@@ -9665,13 +9662,14 @@ packages:
'@vercel/edge-config-fs': 0.1.0
dev: false
- /@vercel/[email protected]:
- resolution: {integrity: sha512-NdJxoaUI/AMvSu9dBM5MA1mxzk+Xo1sMrjyNRtNGsH5iKYyMdMWNUEvHdkyn1kN6opM03rQHYOYgXhBwNyIfdQ==}
- dev: false
-
- /@vercel/[email protected]:
- resolution: {integrity: sha512-YBOEKITWgRWQJg2/0TJaiZOAsJz/OqjBfZO87lBA5PtddNjjEUQQxSlon/ank+RC7laJ/51zMKkv9rgprmLMow==}
+ /@vercel/[email protected]:
+ resolution: {integrity: sha512-987mKpoDCI18x2rDjrDbiuGOtxDMK/UhfhDZoN3A2SAt40BMaj8HEKwVqL6fOian5j/3RZcOuJnMOpatQGgpjw==}
engines: {node: '>= 16'}
+ peerDependencies:
+ '@aws-sdk/credential-provider-web-identity': '*'
+ peerDependenciesMeta:
+ '@aws-sdk/credential-provider-web-identity':
+ optional: true
dev: false