The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
remove runtime = 'edge'
Steven Tey7d13d5633b29
diff --git a/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/action-buttons.tsx b/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/action-buttons.tsxindex 51e52407cc..5d539ce3f0 100644--- a/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/action-buttons.tsx+++ b/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/action-buttons.tsx@@ -1,9 +1,9 @@"use client";-import { EdgeLinkProps } from "@/lib/planetscale";import { Button, IOSAppStore, useCopyToClipboard } from "@dub/ui";+import { Link } from "@prisma/client";-export function DeepLinkActionButtons({ link }: { link: EdgeLinkProps }) {+export function DeepLinkActionButtons({ link }: { link: Link }) {const [_copied, copyToClipboard] = useCopyToClipboard();const handleClick = async ({ withCopy }: { withCopy?: boolean } = {}) => {diff --git a/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/brand-logo-badge.tsx b/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/brand-logo-badge.tsxindex 5d253c4e41..e9bb0f88cf 100644--- a/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/brand-logo-badge.tsx+++ b/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/brand-logo-badge.tsx@@ -1,10 +1,10 @@"use client";-import { EdgeLinkProps } from "@/lib/planetscale";import { useCopyToClipboard } from "@dub/ui";import { getApexDomain, GOOGLE_FAVICON_URL } from "@dub/utils";+import { Link } from "@prisma/client";-export function BrandLogoBadge({ link }: { link: EdgeLinkProps }) {+export function BrandLogoBadge({ link }: { link: Link }) {const [_copied, copyToClipboard] = useCopyToClipboard();return (diff --git a/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsx b/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsxindex fc5389bb13..0ce059204f 100644--- a/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsx+++ b/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsx@@ -1,4 +1,4 @@-import { getLinkViaEdge } from "@/lib/planetscale";+import { prisma } from "@dub/prisma";import { Grid, Wordmark } from "@dub/ui";import { ArrowRight, Copy, IOSAppStore, MobilePhone } from "@dub/ui/icons";import { cn } from "@dub/utils";@@ -7,8 +7,6 @@ import { redirect } from "next/navigation";import { DeepLinkActionButtons } from "./action-buttons";import { BrandLogoBadge } from "./brand-logo-badge";-export const runtime = "edge";-export default async function DeepLinkPreviewPage({params,}: {@@ -16,7 +14,14 @@ export default async function DeepLinkPreviewPage({}) {const domain = params.domain;const key = decodeURIComponent(params.key);- const link = await getLinkViaEdge({ domain, key });+ const link = await prisma.link.findUnique({+ where: {+ domain_key: {+ domain,+ key,+ },+ },+ });if (!link) {redirect("/");diff --git a/packages/utils/src/constants/reserved-slugs.ts b/packages/utils/src/constants/reserved-slugs.tsindex 5c11a6b857..e19df996d8 100644--- a/packages/utils/src/constants/reserved-slugs.ts+++ b/packages/utils/src/constants/reserved-slugs.ts@@ -9,6 +9,7 @@ export const RESERVED_SLUGS = ["static","stats","share",+ "deeplink","robots.txt","proxy","account",