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.

added a few more limits

Steven Tey1a0c2d171500
diff --git a/apps/web/app/api/callback/stripe/route.ts b/apps/web/app/api/callback/stripe/route.ts
index dbf3b5d495..fb011a1f21 100644
--- a/apps/web/app/api/callback/stripe/route.ts
+++ b/apps/web/app/api/callback/stripe/route.ts
@@ -77,6 +77,8 @@ export const POST = async (req: Request) => {
usageLimit: plan.limits.clicks!,
linksLimit: plan.limits.links!,
domainsLimit: plan.limits.domains!,
+ tagsLimit: plan.limits.tags!,
+ usersLimit: plan.limits.users!,
plan: plan.name.toLowerCase(),
},
select: {
@@ -160,6 +162,8 @@ export const POST = async (req: Request) => {
usageLimit: plan.limits.clicks!,
linksLimit: plan.limits.links!,
domainsLimit: plan.limits.domains!,
+ tagsLimit: plan.limits.tags!,
+ usersLimit: plan.limits.users!,
plan: plan.name.toLowerCase(),
},
select: {
@@ -238,6 +242,8 @@ export const POST = async (req: Request) => {
usageLimit: FREE_PLAN.limits.clicks!,
linksLimit: FREE_PLAN.limits.links!,
domainsLimit: FREE_PLAN.limits.domains!,
+ tagsLimit: FREE_PLAN.limits.tags!,
+ usersLimit: FREE_PLAN.limits.users!,
},
}),
pipeline.exec(),
diff --git a/apps/web/app/api/projects/route.ts b/apps/web/app/api/projects/route.ts
index 4b354c1ade..24d90fa407 100644
--- a/apps/web/app/api/projects/route.ts
+++ b/apps/web/app/api/projects/route.ts
@@ -4,13 +4,13 @@ import {
domainExists,
validateDomain,
} from "@/lib/api/domains";
-import { withAuth } from "@/lib/auth";
+import { withAuth, withSession } from "@/lib/auth";
import { isReservedKey } from "@/lib/edge-config";
import prisma from "@/lib/prisma";
import { DEFAULT_REDIRECTS, validSlugRegex } from "@dub/utils";
// GET /api/projects - get all projects for the current user
-export const GET = withAuth(async ({ session, headers }) => {
+export const GET = withSession(async ({ session }) => {
const projects = await prisma.project.findMany({
where: {
users: {
@@ -23,7 +23,7 @@ export const GET = withAuth(async ({ session, headers }) => {
domains: true,
},
});
- return NextResponse.json(projects, { headers });
+ return NextResponse.json(projects);
});
export const POST = withAuth(async ({ req, session }) => {
diff --git a/apps/web/app/app.dub.co/(dashboard)/analytics/client.tsx b/apps/web/app/app.dub.co/(dashboard)/analytics/client.tsx
deleted file mode 100644
index bb953d63f2..0000000000
--- a/apps/web/app/app.dub.co/(dashboard)/analytics/client.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-"use client";
-
-import LayoutLoader from "@/ui/layout/layout-loader";
-import LinkNotFound from "@/ui/links/link-not-found";
-import { fetcher, isDubDomain } from "@dub/utils";
-import { useSession } from "next-auth/react";
-import { useParams, useSearchParams } from "next/navigation";
-import { ReactNode } from "react";
-import useSWR from "swr";
-
-export default function AnalyticsClient({ children }: { children: ReactNode }) {
- const searchParams = useSearchParams();
- const domain = searchParams?.get("domain");
- const key = searchParams?.get("key");
-
- const { slug } = useParams() as { slug?: string };
- const { data: session, status } = useSession();
- const { data: link, isLoading } = useSWR(
- domain &&
- key &&
- `/api/links/info?domain=${domain}&key=${key}${
- slug ? `&projectSlug=${slug}` : ""
- }`,
- fetcher,
- { dedupingInterval: 30000 },
- );
-
- if (status === "loading" || isLoading) {
- return <LayoutLoader />;
- }
-
- if (!domain || !key || !isDubDomain(domain)) {
- return <LinkNotFound />;
- }
-
- // @ts-expect-error
- if (session?.user?.id !== link?.userId) {
- return <LinkNotFound />;
- }
-
- return children;
-}
diff --git a/apps/web/app/app.dub.co/(dashboard)/analytics/page.tsx b/apps/web/app/app.dub.co/(dashboard)/analytics/page.tsx
deleted file mode 100644
index 47ca3b683f..0000000000
--- a/apps/web/app/app.dub.co/(dashboard)/analytics/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import Stats from "@/ui/stats";
-import { Suspense } from "react";
-import AnalyticsClient from "./client";
-import LayoutLoader from "@/ui/layout/layout-loader";
-
-export default function LinkAnalytics() {
- return (
- <Suspense fallback={<LayoutLoader />}>
- <AnalyticsClient>
- <Stats />
- </AnalyticsClient>
- </Suspense>
- );
-}
diff --git a/apps/web/app/app.dub.co/(dashboard)/links/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/links/page-client.tsx
deleted file mode 100644
index ab4d992b0d..0000000000
--- a/apps/web/app/app.dub.co/(dashboard)/links/page-client.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-"use client";
-
-import LinksContainer from "@/ui/links/links-container";
-import { useAddEditLinkModal } from "@/ui/modals/add-edit-link-modal";
-import { MaxWidthWrapper } from "@dub/ui";
-
-export default function LinksClient() {
- const { AddEditLinkModal, AddEditLinkButton } = useAddEditLinkModal();
-
- return (
- <>
- <AddEditLinkModal />
- <div className="flex h-36 items-center border-b border-gray-200 bg-white">
- <MaxWidthWrapper>
- <div className="flex items-center justify-between">
- <h1 className="text-2xl text-gray-600">My Links</h1>
- <AddEditLinkButton />
- </div>
- </MaxWidthWrapper>
- </div>
- <LinksContainer AddEditLinkButton={AddEditLinkButton} />
- </>
- );
-}
diff --git a/apps/web/app/app.dub.co/(dashboard)/links/page.tsx b/apps/web/app/app.dub.co/(dashboard)/links/page.tsx
deleted file mode 100644
index afecaf5a80..0000000000
--- a/apps/web/app/app.dub.co/(dashboard)/links/page.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import LinksClient from "./page-client";
-
-export default function Links() {
- return <LinksClient />;
-}
diff --git a/apps/web/app/app.dub.co/(redirects)/analytics/page.tsx b/apps/web/app/app.dub.co/(redirects)/analytics/page.tsx
new file mode 100644
index 0000000000..fbdabca05e
--- /dev/null
+++ b/apps/web/app/app.dub.co/(redirects)/analytics/page.tsx
@@ -0,0 +1,26 @@
+import { getProjects } from "@/lib/fetchers";
+import { redirect } from "next/navigation";
+
+export default async function OldLinksAnalytics({
+ searchParams,
+}: {
+ searchParams: { [key: string]: string };
+}) {
+ const projects = await getProjects();
+ if (!projects || projects.length === 0) {
+ redirect("/");
+ }
+
+ const newParams = new URLSearchParams();
+ if (searchParams.domain) {
+ newParams.set("domain", searchParams.domain);
+ }
+ if (searchParams.key) {
+ newParams.set("key", searchParams.key);
+ }
+ const queryString = newParams.toString();
+
+ redirect(
+ `/${projects[0].slug}/analytics${queryString ? `?${queryString}` : ""}`,
+ );
+}
diff --git a/apps/web/app/app.dub.co/(redirects)/layout.tsx b/apps/web/app/app.dub.co/(redirects)/layout.tsx
deleted file mode 100644
index af8ea32654..0000000000
--- a/apps/web/app/app.dub.co/(redirects)/layout.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { ReactNode } from "react";
-
-export const runtime = "edge";
-
-export default function RedirectsLayout({ children }: { children: ReactNode }) {
- return <>{children}</>;
-}
diff --git a/apps/web/app/app.dub.co/(redirects)/links/[key]/page.tsx b/apps/web/app/app.dub.co/(redirects)/links/[key]/page.tsx
index 1ea879ca72..104c8a5cc1 100644
--- a/apps/web/app/app.dub.co/(redirects)/links/[key]/page.tsx
+++ b/apps/web/app/app.dub.co/(redirects)/links/[key]/page.tsx
@@ -1,11 +1,16 @@
+import { getProjects } from "@/lib/fetchers";
import { redirect } from "next/navigation";
-export default function OldLinksStatsPage({
+export default async function OldLinksStatsPage({
params,
}: {
params: {
key: string;
};
}) {
- redirect(`/analytics?domain=dub.sh&key=${params.key}`);
+ const projects = await getProjects();
+ if (!projects || projects.length === 0) {
+ redirect("/");
+ }
+ redirect(`/${projects[0].slug}/analytics?domain=dub.sh&key=${params.key}`);
}
diff --git a/apps/web/app/app.dub.co/(redirects)/links/page.tsx b/apps/web/app/app.dub.co/(redirects)/links/page.tsx
new file mode 100644
index 0000000000..3182483e85
--- /dev/null
+++ b/apps/web/app/app.dub.co/(redirects)/links/page.tsx
@@ -0,0 +1,10 @@
+import { getProjects } from "@/lib/fetchers";
+import { redirect } from "next/navigation";
+
+export default async function OldLinksPage() {
+ const projects = await getProjects();
+ if (!projects || projects.length === 0) {
+ redirect("/");
+ }
+ redirect(`/${projects[0].slug}`);
+}
diff --git a/apps/web/app/app.dub.co/(redirects)/loading.tsx b/apps/web/app/app.dub.co/(redirects)/loading.tsx
new file mode 100644
index 0000000000..1e580e4e01
--- /dev/null
+++ b/apps/web/app/app.dub.co/(redirects)/loading.tsx
@@ -0,0 +1,9 @@
+import LayoutLoader from "@/ui/layout/layout-loader";
+
+export default function Loading() {
+ return (
+ <div className="h-screen w-screen bg-gray-50">
+ <LayoutLoader />
+ </div>
+ );
+}
diff --git a/apps/web/lib/api/errors.ts b/apps/web/lib/api/errors.ts
index 8ba018eb0e..e75680f8c4 100644
--- a/apps/web/lib/api/errors.ts
+++ b/apps/web/lib/api/errors.ts
@@ -8,7 +8,7 @@ export const exceededLimitError = ({
}: {
plan: PlanProps;
limit: number;
- type: "links" | "domains" | "tags" | "users";
+ type: "clicks" | "links" | "domains" | "tags" | "users";
}) => {
return `You've reached your ${
type === "links" ? "monthly" : ""
diff --git a/apps/web/lib/api/links.ts b/apps/web/lib/api/links.ts
index a0b2307344..046099d193 100644
--- a/apps/web/lib/api/links.ts
+++ b/apps/web/lib/api/links.ts
@@ -218,7 +218,7 @@ export async function processLink({
bulk = false,
}: {
payload: LinkProps;
- project: ProjectProps | null;
+ project: ProjectProps;
session?: Session;
bulk?: boolean;
}) {
@@ -252,45 +252,34 @@ export async function processLink({
};
}
- // domain checks
- if (!domain) {
- return {
- link: payload,
- error: "Missing short link domain.",
- status: 400,
- };
- }
-
- if (project) {
- if (!project.domains?.find((d) => d.slug === domain)) {
- return {
- link: payload,
- error: "Domain does not belong to project.",
- status: 403,
- };
- }
- if (project.linksUsage >= project.linksLimit) {
+ // free plan restrictions
+ if (project.plan === "free") {
+ if (proxy || rewrite || expiresAt || ios || android || geo) {
return {
link: payload,
- error: exceededLimitError({
- plan: project.plan,
- limit: project.linksLimit,
- type: "links",
- }),
+ error:
+ "You can only use link cloaking, custom social media cards, link expiration, device and geo targeting on a Pro plan and above. Upgrade to Pro to use these features.",
status: 403,
};
}
- // internal Dub.co checks
- } else if (process.env.NEXT_PUBLIC_IS_DUB) {
- // if it's not a custom project, do some filtering
+ // can't use `/` in key on free plan
if (key?.includes("/")) {
return {
link: payload,
error:
- "Key cannot contain '/'. You can only use this with a custom domain.",
+ "Key cannot contain '/'. You can only use this on a Pro plan and above. Upgrade to Pro to use this feature.",
status: 422,
};
}
+ }
+
+ // if domain is not defined, use the project's primary domain
+ if (!domain) {
+ domain = project.domains?.find((d) => d.primary)?.slug || SHORT_DOMAIN;
+
+ // if domain is defined, do some checks
+ } else {
+ // checks for dub.sh domain
if (domain === "dub.sh") {
const keyBlacklisted = await isBlacklistedKey(key);
if (keyBlacklisted) {
@@ -308,6 +297,8 @@ export async function processLink({
status: 422,
};
}
+
+ // checks for other Dub-owned domains (chatg.pt, spti.fi, etc.)
} else if (isDubDomain(domain)) {
// coerce type with ! cause we already checked if it exists
const { allowedHostnames } = DUB_DOMAINS.find((d) => d.slug === domain)!;
@@ -321,39 +312,12 @@ export async function processLink({
status: 422,
};
}
- // we can do it here because we only pass session when creating a link (and not editing it)
- if (session) {
- const count = await prisma.link.count({
- where: {
- domain,
- userId: session?.user.id,
- },
- });
- if (count > 25) {
- return {
- link: payload,
- error: `You can only create 25 ${domain} short links.`,
- status: 403,
- };
- }
- }
- } else {
- // domain is not dub.sh or a Dub domain
- return {
- link: payload,
- error: "Invalid domain",
- status: 403,
- };
- }
- }
- // free plan restrictions
- if (!project || project.plan === "free") {
- if (proxy || rewrite || expiresAt || ios || android || geo) {
+ // else, check if it belongs to the project
+ } else if (!project.domains?.find((d) => d.slug === domain)) {
return {
link: payload,
- error:
- "You can only use link cloaking, custom social media cards, link expiration, device and geo targeting on a Pro plan and above. Upgrade to Pro to use these features.",
+ error: "Domain does not belong to project.",
status: 403,
};
}
diff --git a/apps/web/lib/auth/index.ts b/apps/web/lib/auth/index.ts
index 8f48eb021b..06435396a1 100644
--- a/apps/web/lib/auth/index.ts
+++ b/apps/web/lib/auth/index.ts
@@ -11,6 +11,7 @@ import {
isDubDomain,
} from "@dub/utils";
import { ratelimit } from "../upstash";
+import { exceededLimitError } from "../api/errors";
export interface Session {
user: {
@@ -87,6 +88,16 @@ export const withAuth =
const searchParams = getSearchParams(req.url);
const { linkId } = params || {};
const slug = params?.slug || searchParams.projectSlug;
+
+ if (!slug) {
+ return new Response(
+ "Project slug not found. Did you forget to include a `projectSlug` query parameter?",
+ {
+ status: 400,
+ },
+ );
+ }
+
const domain = params?.domain || searchParams.domain;
const key = searchParams.key;
@@ -113,15 +124,6 @@ export const withAuth =
});
}
- if (!slug && url.pathname.includes("/links")) {
- return new Response(
- "API access is only available for projects with custom domains. Did you forget to include a `projectSlug` query parameter?",
- {
- status: 403,
- },
- );
- }
-
const hashedKey = hashToken(apiKey, {
noSecret: true,
});
@@ -201,42 +203,42 @@ export const withAuth =
}
const [project, link] = (await Promise.all([
- slug &&
- prisma.project.findUnique({
- where: {
- slug,
- },
- select: {
- id: true,
- name: true,
- slug: true,
- logo: true,
- usage: true,
- usageLimit: true,
- linksUsage: true,
- linksLimit: true,
- domainsLimit: true,
- tagsLimit: true,
- usersLimit: true,
- plan: true,
- stripeId: true,
- billingCycleStart: true,
- createdAt: true,
- users: {
- where: {
- userId: session.user.id,
- },
- select: {
- role: true,
- },
+ prisma.project.findUnique({
+ where: {
+ slug,
+ },
+ select: {
+ id: true,
+ name: true,
+ slug: true,
+ logo: true,
+ usage: true,
+ usageLimit: true,
+ linksUsage: true,
+ linksLimit: true,
+ domainsLimit: true,
+ tagsLimit: true,
+ usersLimit: true,
+ plan: true,
+ stripeId: true,
+ billingCycleStart: true,
+ createdAt: true,
+ users: {
+ where: {
+ userId: session.user.id,
},
- domains: {
- select: {
- slug: true,
- },
+ select: {
+ role: true,
},
},
- }),
+ domains: {
+ select: {
+ slug: true,
+ primary: true,
+ },
+ },
+ },
+ }),
linkId
? prisma.link.findUnique({
where: {
@@ -253,110 +255,107 @@ export const withAuth =
},
})
: undefined,
- ])) as [ProjectProps | undefined, LinkProps | undefined];
+ ])) as [ProjectProps, LinkProps | undefined];
- // project checks
- if (slug) {
- if (!project || !project.users) {
- // project doesn't exist
- return new Response("Project not found.", {
- status: 404,
+ if (!project || !project.users) {
+ // project doesn't exist
+ return new Response("Project not found.", {
+ status: 404,
+ headers,
+ });
+ }
+
+ // prevent unauthorized access to domains that don't belong to the project
+ if (domain) {
+ if (!project.domains?.find((d) => d.slug === domain)) {
+ return new Response("Domain does not belong to project.", {
+ status: 403,
headers,
});
}
+ }
- // prevent unauthorized access to domains that don't belong to the project
- if (domain) {
- if (!project.domains?.find((d) => d.slug === domain)) {
- return new Response("Domain does not belong to project.", {
- status: 403,
- headers,
- });
- }
- }
-
- // project exists but user is not part of it
- if (project.users.length === 0) {
- const pendingInvites = await prisma.projectInvite.findUnique({
- where: {
- email_projectId: {
- email: session.user.email,
- projectId: project.id,
- },
- },
- select: {
- expires: true,
+ // project exists but user is not part of it
+ if (project.users.length === 0) {
+ const pendingInvites = await prisma.projectInvite.findUnique({
+ where: {
+ email_projectId: {
+ email: session.user.email,
+ projectId: project.id,
},
+ },
+ select: {
+ expires: true,
+ },
+ });
+ if (!pendingInvites) {
+ return new Response("Project not found.", {
+ status: 404,
+ headers,
});
- if (!pendingInvites) {
- return new Response("Project not found.", {
- status: 404,
- headers,
- });
- } else if (pendingInvites.expires < new Date()) {
- return new Response("Project invite expired.", {
- status: 410,
- headers,
- });
- } else {
- return new Response("Project invite pending.", {
- status: 409,
- headers,
- });
- }
- }
-
- // project role checks (enterprise only)
- if (
- requiredRole &&
- project.plan === "enterprise" &&
- !requiredRole.includes(project.users[0].role) &&
- !(allowSelf && searchParams.userId === session.user.id)
- ) {
- return new Response("Unauthorized: Insufficient permissions.", {
- status: 403,
+ } else if (pendingInvites.expires < new Date()) {
+ return new Response("Project invite expired.", {
+ status: 410,
+ headers,
+ });
+ } else {
+ return new Response("Project invite pending.", {
+ status: 409,
headers,
});
}
+ }
- // clicks usage overage checks
- if (needNotExceededClicks && project.usage > project.usageLimit) {
- return new Response(
- "Unauthorized: Clicks limits exceeded. Upgrade to get more clicks.",
- {
- status: 403,
- headers,
- },
- );
- }
-
- // links usage overage checks
- if (needNotExceededLinks && project.linksUsage > project.linksLimit) {
- return new Response(
- "Unauthorized: Links limits exceeded. Upgrade to get more links.",
- {
- status: 403,
- headers,
- },
- );
- }
+ // project role checks (enterprise only)
+ if (
+ requiredRole &&
+ project.plan === "enterprise" &&
+ !requiredRole.includes(project.users[0].role) &&
+ !(allowSelf && searchParams.userId === session.user.id)
+ ) {
+ return new Response("Unauthorized: Insufficient permissions.", {
+ status: 403,
+ headers,
+ });
+ }
- // plan checks
- if (!requiredPlan.includes(project.plan)) {
- // return res.status(403).end("Unauthorized: Need higher plan.");
- return new Response("Unauthorized: Need higher plan.", {
+ // clicks usage overage checks
+ if (needNotExceededClicks && project.usage > project.usageLimit) {
+ return new Response(
+ exceededLimitError({
+ plan: project.plan,
+ limit: project.usageLimit,
+ type: "clicks",
+ }),
+ {
status: 403,
headers,
- });
- }
- // for generic DUB_DOMAINS links / stats
- } else {
- if (domain && !isDubDomain(domain)) {
- return new Response("Domain not found.", {
- status: 404,
+ },
+ );
+ }
+
+ // links usage overage checks
+ if (needNotExceededLinks && project.linksUsage > project.linksLimit) {
+ return new Response(
+ exceededLimitError({
+ plan: project.plan,
+ limit: project.linksLimit,
+ type: "links",
+ }),
+ {
+ status: 403,
headers,
- });
- }
+ },
+ );
+ }
+
+ // plan checks
+ if (!requiredPlan.includes(project.plan)) {
+ // return res.status(403).end("Unauthorized: Need higher plan.");
+ return new Response("Unauthorized: Need higher plan.", {
+ status: 403,
+ headers,
+ });
}
// link checks (if linkId or domain and key are provided)
@@ -369,29 +368,8 @@ export const withAuth =
});
}
- // if it's a custom project link, we need to make sure the link is owned by the project
- if (slug) {
- if (link.projectId !== project?.id) {
- return new Response("Link not found.", {
- status: 404,
- headers,
- });
- }
-
- // if it's generic DUB_DOMAINS links, we need to make sure the user is the owner of the link
- } else if (isDubDomain(link.domain)) {
- if (
- link.projectId !== DUB_PROJECT_ID ||
- link.userId !== session.user.id
- ) {
- return new Response("Link not found.", {
- status: 404,
- headers,
- });
- }
-
- // if the domain is not part of DUB_DOMAINS
- } else {
+ // make sure the link is owned by the project
+ if (link.projectId !== project?.id) {
return new Response("Link not found.", {
status: 404,
headers,
@@ -405,7 +383,7 @@ export const withAuth =
searchParams,
headers,
session,
- project: project as ProjectProps,
+ project,
domain,
link,
});
diff --git a/apps/web/lib/fetchers.ts b/apps/web/lib/fetchers.ts
index 0ca3193545..3d3de6efc5 100644
--- a/apps/web/lib/fetchers.ts
+++ b/apps/web/lib/fetchers.ts
@@ -18,6 +18,7 @@ export const getProjects = cache(async () => {
},
include: {
domains: true,
+ users: true,
},
});
diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.ts
index ae1ff31180..2aa07a5b6e 100644
--- a/apps/web/lib/types.ts
+++ b/apps/web/lib/types.ts
@@ -58,11 +58,12 @@ export interface ProjectProps {
plan: PlanProps;
stripeId?: string;
billingCycleStart: number;
- createdAt?: Date;
- domains?: {
+ createdAt: Date;
+ domains: {
slug: string;
+ primary: boolean;
}[];
- users?: {
+ users: {
role: "owner" | "member";
}[];
}
diff --git a/apps/web/prisma/schema.prisma b/apps/web/prisma/schema.prisma
index fb4abf377c..3da2306f2c 100644
--- a/apps/web/prisma/schema.prisma
+++ b/apps/web/prisma/schema.prisma
@@ -94,7 +94,7 @@ model Project {
linksUsage Int @default(0)
linksLimit Int @default(25)
domainsLimit Int @default(1)
- tagsLimit Int @default(3)
+ tagsLimit Int @default(10)
usersLimit Int @default(1)
monitoringId String? @unique // cron job ID for monitoring
diff --git a/apps/web/ui/modals/add-edit-link-modal/index.tsx b/apps/web/ui/modals/add-edit-link-modal/index.tsx
index 9055ddd9c8..4a946669df 100644
--- a/apps/web/ui/modals/add-edit-link-modal/index.tsx
+++ b/apps/web/ui/modals/add-edit-link-modal/index.tsx
@@ -528,17 +528,11 @@ function AddEditLinkModal({
</div>
)}
</div>
- {keyError ? (
+ {keyError && (
<p className="mt-2 text-sm text-red-600" id="key-error">
{keyError}
</p>
- ) : process.env.NEXT_PUBLIC_IS_DUB &&
- isDubDomain(domain) &&
- domain !== "dub.sh" ? (
- <p className="mt-2 text-sm text-gray-500">
- You can only create up to 25 links with this domain.
- </p>
- ) : null}
+ )}
</div>
</div>
diff --git a/packages/utils/package.json b/packages/utils/package.json
index d5a07dd11a..d99b256f53 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -1,7 +1,7 @@
{
"name": "@dub/utils",
"description": "Utility functions and constants for Dub.co",
- "version": "0.0.23",
+ "version": "0.0.24",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
diff --git a/packages/utils/src/constants/pricing.tsx b/packages/utils/src/constants/pricing.tsx
index cd1cf209dd..8483492a44 100644
--- a/packages/utils/src/constants/pricing.tsx
+++ b/packages/utils/src/constants/pricing.tsx
@@ -10,6 +10,8 @@ export const PLANS = [
links: 25,
clicks: 1000,
domains: 1,
+ tags: 10,
+ users: 1,
},
colors: {
bg: "bg-black",
@@ -56,8 +58,10 @@ export const PLANS = [
},
limits: {
links: 250,
- clicks: 25000,
+ clicks: 50000,
domains: 10,
+ tags: 25,
+ users: 5,
},
colors: {
bg: "bg-blue-500",
@@ -73,7 +77,7 @@ export const PLANS = [
features: [
{ text: " 250 links/mo" },
{
- text: " 25K tracked clicks/mo",
+ text: "50K tracked clicks/mo",
},
{ text: "1-year analytics retention" },
{ text: "10 custom domains" },
@@ -105,8 +109,10 @@ export const PLANS = [
},
limits: {
links: 1000,
- clicks: 100000,
+ clicks: 250000,
domains: 20,
+ tags: 150,
+ users: 15,
},
colors: {
bg: "bg-sky-900",
@@ -122,7 +128,7 @@ export const PLANS = [
features: [
{ text: " 1,000 links/mo" },
{
- text: " 100K tracked clicks/mo",
+ text: "250K tracked clicks/mo",
},
{ text: "2-year analytics retention" },
{ text: "20 custom domains" },