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.

extract into plan-compare

Steven Teyb8aad0538cc6
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/upgrade/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/upgrade/page-client.tsx
index cfb23b0d70..70344cceb5 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/upgrade/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/upgrade/page-client.tsx
@@ -191,7 +191,7 @@ export function WorkspaceBillingUpgradePageClient() {
<div className="h-8 bg-gradient-to-b from-white" />
</div>
<div className="flex flex-col gap-8 pb-12">
- {PLAN_COMPARE_FEATURES.map(({ category, features }) => {
+ {PLAN_COMPARE_FEATURES.map(({ category, href, features }) => {
const Icon = COMPARE_FEATURE_ICONS[category];
return (
@@ -199,10 +199,17 @@ export function WorkspaceBillingUpgradePageClient() {
key={category}
className="w-full overflow-x-hidden [container-type:inline-size]"
>
- <h3 className="flex items-center gap-2 border-b border-neutral-200 px-5 pb-4 pt-2 text-base font-medium text-black">
+ <a
+ href={href}
+ target="_blank"
+ className="flex items-center gap-2 border-b border-neutral-200 px-5 pb-4 pt-2"
+ >
{Icon && <Icon className="size-4 text-neutral-600" />}
- {category}
- </h3>
+ <h3 className="text-base font-medium text-black">
+ {category}
+ </h3>
+ <span className="text-xs text-neutral-500">↗</span>
+ </a>
<table
className={cn(
"grid grid-cols-4 overflow-hidden text-sm text-neutral-800 [&_strong]:font-medium",
diff --git a/packages/utils/src/constants/index.ts b/packages/utils/src/constants/index.ts
index 51999a5abe..32538af99a 100644
--- a/packages/utils/src/constants/index.ts
+++ b/packages/utils/src/constants/index.ts
@@ -12,6 +12,7 @@ export * from "./localhost";
export * from "./main";
export * from "./middleware";
export * from "./misc";
+export * from "./plan-compare";
export * from "./pricing";
export * from "./regions";
export * from "./saml";
diff --git a/packages/utils/src/constants/plan-compare.tsx b/packages/utils/src/constants/plan-compare.tsx
new file mode 100644
index 0000000000..adb7c6a39b
--- /dev/null
+++ b/packages/utils/src/constants/plan-compare.tsx
@@ -0,0 +1,455 @@
+import { ReactNode } from "react";
+import { nFormatter } from "../functions/nformatter";
+import { INFINITY_NUMBER } from "./misc";
+import { PLANS } from "./pricing";
+
+export const PLAN_COMPARE_FEATURES: {
+ category: string;
+ href: string;
+ features: {
+ text:
+ | string
+ | ((d: { id: string; plan: (typeof PLANS)[number] }) => ReactNode);
+ href?: string;
+ check?:
+ | boolean
+ | {
+ default?: boolean;
+ free?: boolean;
+ pro?: boolean;
+ business?: boolean;
+ advanced?: boolean;
+ enterprise?: boolean;
+ };
+ }[];
+}[] = [
+ {
+ category: "Links",
+ href: "https://dub.co/home", // TODO: update to https://dub.co/links
+ features: [
+ {
+ text: () => (
+ <>
+ <strong>Unlimited</strong> clicks
+ </>
+ ),
+ },
+ {
+ text: ({ plan }) => (
+ <>
+ <strong>
+ {plan.name === "Enterprise" ? "∞" : nFormatter(plan.limits.links)}
+ </strong>{" "}
+ new links/mo
+ </>
+ ),
+ },
+ {
+ text: ({ plan }) => (
+ <>
+ <strong>
+ {plan.limits.tags === INFINITY_NUMBER
+ ? "Unlimited"
+ : nFormatter(plan.limits.tags)}
+ </strong>{" "}
+ tags
+ </>
+ ),
+ href: "https://dub.co/help/article/how-to-use-tags",
+ },
+ {
+ check: {
+ free: false,
+ default: true,
+ },
+ text: ({ plan }) => (
+ <>
+ <strong>
+ {plan.limits.folders === INFINITY_NUMBER
+ ? "Unlimited"
+ : nFormatter(plan.limits.folders)}
+ </strong>{" "}
+ folders
+ </>
+ ),
+ },
+ {
+ text: "Custom QR codes",
+ href: "https://dub.co/help/article/custom-qr-codes",
+ },
+ {
+ text: "UTM builder",
+ href: "https://dub.co/help/article/utm-builder",
+ },
+ {
+ text: "UTM templates",
+ href: "https://dub.co/help/article/utm-templates",
+ },
+ {
+ check: {
+ free: false,
+ default: true,
+ },
+ text: "Custom link previews",
+ href: "https://dub.co/help/article/custom-link-previews",
+ },
+ {
+ check: {
+ free: false,
+ default: true,
+ },
+ text: "Link cloaking",
+ href: "https://dub.co/help/article/link-cloaking",
+ },
+
+ {
+ check: {
+ free: false,
+ default: true,
+ },
+ text: "Link expiration",
+ href: "https://dub.co/help/article/link-expiration",
+ },
+ {
+ check: {
+ free: false,
+ default: true,
+ },
+ text: "Password protection",
+ href: "https://dub.co/help/article/password-protected-links",
+ },
+ {
+ check: {
+ free: false,
+ default: true,
+ },
+ text: "Device targeting",
+ href: "https://dub.co/help/article/device-targeting",
+ },
+ {
+ check: {
+ free: false,
+ default: true,
+ },
+ text: "Geo targeting",
+ href: "https://dub.co/help/article/geo-targeting",
+ },
+ ],
+ },
+ {
+ category: "Analytics",
+ href: "https://dub.co/analytics",
+ features: [
+ {
+ text: "Advanced analytics",
+ href: "https://dub.co/help/article/dub-analytics",
+ },
+ {
+ text: ({ plan }) => (
+ <>
+ <strong>
+ {plan.name === "Enterprise"
+ ? "∞"
+ : nFormatter(plan.limits.clicks)}
+ </strong>{" "}
+ tracked clicks/mo
+ </>
+ ),
+ href: "https://dub.co/help/article/dub-analytics-limits",
+ },
+ {
+ text: ({ id }) => (
+ <>
+ <strong>
+ {
+ {
+ free: "30 day",
+ pro: "1 year",
+ business: "3 year",
+ advanced: "5 year",
+ enterprise: "∞",
+ }[id]
+ }
+ </strong>{" "}
+ retention
+ </>
+ ),
+ },
+ {
+ check: {
+ default: false,
+ business: true,
+ advanced: true,
+ enterprise: true,
+ },
+ text: "Real-time events stream",
+ href: "https://dub.co/help/article/real-time-events-stream",
+ },
+ {
+ check: {
+ default: false,
+ business: true,
+ advanced: true,
+ enterprise: true,
+ },
+ text: "Conversion tracking",
+ href: "https://dub.co/help/article/dub-conversions",
+ },
+ ],
+ },
+ {
+ category: "Partners",
+ href: "https://dub.co/partners",
+ features: [
+ {
+ check: {
+ default: false,
+ business: true,
+ advanced: true,
+ enterprise: true,
+ },
+ text: "Partner management",
+ href: "https://dub.co/help/article/dub-partners",
+ },
+ {
+ check: {
+ default: false,
+ business: true,
+ advanced: true,
+ enterprise: true,
+ },
+ text: ({ id, plan }) =>
+ id === "free" || id === "pro" ? (
+ "No tracked sales"
+ ) : id === "enterprise" ? (
+ "∞ tracked sales"
+ ) : (
+ <>
+ <strong>${nFormatter(plan.limits.sales / 100)}</strong> tracked
+ sales/mo
+ </>
+ ),
+ },
+ {
+ check: {
+ default: false,
+ business: true,
+ advanced: true,
+ enterprise: true,
+ },
+ text: "1-click global payouts",
+ href: "https://dub.co/help/article/partner-payouts",
+ },
+ {
+ check: {
+ default: false,
+ business: true,
+ advanced: true,
+ enterprise: true,
+ },
+ text: ({ id }) =>
+ id === "free" || id === "pro" ? (
+ "No payouts"
+ ) : (
+ <>
+ <strong>
+ {
+ {
+ business: "7%",
+ advanced: "5%",
+ enterprise: "3%",
+ }[id]
+ }
+ </strong>{" "}
+ payout fees
+ </>
+ ),
+ href: "https://dub.co/help/article/partner-payouts#payout-fees-and-timing",
+ },
+ {
+ check: {
+ default: false,
+ business: true,
+ advanced: true,
+ enterprise: true,
+ },
+ text: "Tax compliance",
+ href: "https://dub.co/help/article/partner-payouts#tax-compliance",
+ },
+ {
+ check: {
+ default: false,
+ business: false,
+ advanced: true,
+ enterprise: true,
+ },
+ text: "White-labeling support",
+ href: "https://dub.co/help/article/dub-partners#white-labeled-in-app-dashboard",
+ },
+ {
+ check: {
+ default: false,
+ business: false,
+ advanced: true,
+ enterprise: true,
+ },
+ text: "Branded email domains",
+ },
+ ],
+ },
+ {
+ category: "Domains",
+ href: "https://dub.co/help/category/custom-domains",
+ features: [
+ {
+ text: ({ plan }) => (
+ <>
+ <strong>{nFormatter(plan.limits.domains, { full: true })}</strong>{" "}
+ custom domains
+ </>
+ ),
+ },
+ {
+ text: () => <>SSL certificates</>,
+ },
+ {
+ check: {
+ default: true,
+ free: false,
+ },
+ text: () => (
+ <>
+ Premium <strong>dub.link</strong> domain
+ </>
+ ),
+ href: "https://dub.co/help/article/default-dub-domains#premium-dublink-domain",
+ },
+ {
+ check: {
+ default: true,
+ free: false,
+ },
+ text: () => (
+ <>
+ Free <strong>.link</strong> domain
+ </>
+ ),
+ href: "https://dub.co/help/article/free-dot-link-domain",
+ },
+ ],
+ },
+ {
+ category: "API",
+ href: "https://dub.co/docs/api-reference/introduction",
+ features: [
+ {
+ text: "API Access",
+ href: "https://dub.co/docs/api-reference/introduction",
+ },
+ {
+ text: "Native SDKs",
+ href: "https://dub.co/docs/sdks/overview",
+ },
+ {
+ text: ({ id, plan }) => (
+ <>
+ <strong>
+ {id === "enterprise"
+ ? "Custom"
+ : nFormatter(plan.limits.api) + "/min"}
+ </strong>{" "}
+ rate limit
+ </>
+ ),
+ },
+ {
+ check: {
+ default: false,
+ business: true,
+ advanced: true,
+ enterprise: true,
+ },
+ text: "Event webhooks",
+ href: "https://dub.co/docs/concepts/webhooks/introduction",
+ },
+ ],
+ },
+ {
+ category: "Workspace",
+ href: "https://dub.co/help/category/workspaces",
+ features: [
+ {
+ text: ({ plan }) => (
+ <>
+ <strong>{nFormatter(plan.limits.users)}</strong> user
+ {plan.limits.users === 1 ? "" : "s"}
+ </>
+ ),
+ },
+ {
+ check: {
+ default: false,
+ advanced: true,
+ enterprise: true,
+ },
+ text: "Role-based access control",
+ },
+ {
+ check: {
+ default: false,
+ enterprise: true,
+ },
+ text: "SAML/SSO",
+ href: "https://dub.co/help/category/saml-sso",
+ },
+ {
+ check: {
+ default: false,
+ enterprise: true,
+ },
+ text: "Custom SLA",
+ },
+ {
+ check: {
+ default: false,
+ enterprise: true,
+ },
+ text: "Audit logs",
+ },
+ ],
+ },
+ {
+ category: "Support",
+ href: "https://dub.co/help", // TODO: update to https://dub.co/contact/support
+ features: [
+ {
+ text: ({ id }) => (
+ <>
+ <strong>
+ {
+ {
+ free: "Basic support",
+ pro: "Elevated support",
+ business: "Priority support",
+ advanced: "Priority via Slack",
+ enterprise: "Priority with SLA",
+ }[id]
+ }
+ </strong>
+ </>
+ ),
+ },
+ {
+ check: {
+ default: false,
+ enterprise: true,
+ },
+ text: () => (
+ <>
+ <strong>Dedicated</strong> success manager
+ </>
+ ),
+ },
+ ],
+ },
+];
diff --git a/packages/utils/src/constants/pricing.tsx b/packages/utils/src/constants/pricing.tsx
index 944c4316a9..2446ddcf25 100644
--- a/packages/utils/src/constants/pricing.tsx
+++ b/packages/utils/src/constants/pricing.tsx
@@ -1,5 +1,3 @@
-import { ReactNode } from "react";
-import { nFormatter } from "../functions";
import { INFINITY_NUMBER } from "./misc";
export type PlanFeature = {
@@ -312,449 +310,6 @@ export const PLANS = [
},
];
-export const PLAN_COMPARE_FEATURES: {
- category: string;
- features: {
- text:
- | string
- | ((d: { id: string; plan: (typeof PLANS)[number] }) => ReactNode);
- href?: string;
- check?:
- | boolean
- | {
- default?: boolean;
- free?: boolean;
- pro?: boolean;
- business?: boolean;
- advanced?: boolean;
- enterprise?: boolean;
- };
- }[];
-}[] = [
- {
- category: "Links",
- features: [
- {
- text: () => (
- <>
- <strong>Unlimited</strong> clicks
- </>
- ),
- },
- {
- text: ({ plan }) => (
- <>
- <strong>
- {plan.name === "Enterprise" ? "∞" : nFormatter(plan.limits.links)}
- </strong>{" "}
- new links/mo
- </>
- ),
- },
- {
- text: ({ plan }) => (
- <>
- <strong>
- {plan.limits.tags === INFINITY_NUMBER
- ? "Unlimited"
- : nFormatter(plan.limits.tags)}
- </strong>{" "}
- tags
- </>
- ),
- href: "https://dub.co/help/article/how-to-use-tags",
- },
- {
- check: {
- free: false,
- default: true,
- },
- text: ({ plan }) => (
- <>
- <strong>
- {plan.limits.folders === INFINITY_NUMBER
- ? "Unlimited"
- : nFormatter(plan.limits.folders)}
- </strong>{" "}
- folders
- </>
- ),
- },
- {
- text: "Custom QR codes",
- href: "https://dub.co/help/article/custom-qr-codes",
- },
- {
- text: "UTM builder",
- href: "https://dub.co/help/article/utm-builder",
- },
- {
- text: "UTM templates",
- href: "https://dub.co/help/article/utm-templates",
- },
- {
- check: {
- free: false,
- default: true,
- },
- text: "Custom link previews",
- href: "https://dub.co/help/article/custom-link-previews",
- },
- {
- check: {
- free: false,
- default: true,
- },
- text: "Link cloaking",
- href: "https://dub.co/help/article/link-cloaking",
- },
-
- {
- check: {
- free: false,
- default: true,
- },
- text: "Link expiration",
- href: "https://dub.co/help/article/link-expiration",
- },
- {
- check: {
- free: false,
- default: true,
- },
- text: "Password protection",
- href: "https://dub.co/help/article/password-protected-links",
- },
- {
- check: {
- free: false,
- default: true,
- },
- text: "Device targeting",
- href: "https://dub.co/help/article/device-targeting",
- },
- {
- check: {
- free: false,
- default: true,
- },
- text: "Geo targeting",
- href: "https://dub.co/help/article/geo-targeting",
- },
- ],
- },
- {
- category: "Analytics",
- features: [
- {
- text: "Advanced analytics",
- href: "https://dub.co/help/article/dub-analytics",
- },
- {
- text: ({ plan }) => (
- <>
- <strong>
- {plan.name === "Enterprise"
- ? "∞"
- : nFormatter(plan.limits.clicks)}
- </strong>{" "}
- tracked clicks/mo
- </>
- ),
- href: "https://dub.co/help/article/dub-analytics-limits",
- },
- {
- text: ({ id }) => (
- <>
- <strong>
- {
- {
- free: "30 day",
- pro: "1 year",
- business: "3 year",
- advanced: "5 year",
- enterprise: "∞",
- }[id]
- }
- </strong>{" "}
- retention
- </>
- ),
- },
- {
- check: {
- default: false,
- business: true,
- advanced: true,
- enterprise: true,
- },
- text: "Real-time events stream",
- href: "https://dub.co/help/article/real-time-events-stream",
- },
- {
- check: {
- default: false,
- business: true,
- advanced: true,
- enterprise: true,
- },
- text: "Conversion tracking",
- href: "https://dub.co/help/article/dub-conversions",
- },
- ],
- },
- {
- category: "Partners",
- features: [
- {
- check: {
- default: false,
- business: true,
- advanced: true,
- enterprise: true,
- },
- text: "Partner management",
- href: "https://dub.co/help/article/dub-partners",
- },
- {
- check: {
- default: false,
- business: true,
- advanced: true,
- enterprise: true,
- },
- text: ({ id, plan }) =>
- id === "free" || id === "pro" ? (
- "No tracked sales"
- ) : id === "enterprise" ? (
- "∞ tracked sales"
- ) : (
- <>
- <strong>${nFormatter(plan.limits.sales / 100)}</strong> tracked
- sales/mo
- </>
- ),
- },
- {
- check: {
- default: false,
- business: true,
- advanced: true,
- enterprise: true,
- },
- text: "1-click global payouts",
- href: "https://dub.co/help/article/partner-payouts",
- },
- {
- check: {
- default: false,
- business: true,
- advanced: true,
- enterprise: true,
- },
- text: ({ id }) =>
- id === "free" || id === "pro" ? (
- "No payouts"
- ) : (
- <>
- <strong>
- {
- {
- business: "7%",
- advanced: "5%",
- enterprise: "3%",
- }[id]
- }
- </strong>{" "}
- payout fees
- </>
- ),
- href: "https://dub.co/help/article/partner-payouts#payout-fees-and-timing",
- },
- {
- check: {
- default: false,
- business: true,
- advanced: true,
- enterprise: true,
- },
- text: "Tax compliance",
- href: "https://dub.co/help/article/partner-payouts#tax-compliance",
- },
- {
- check: {
- default: false,
- business: false,
- advanced: true,
- enterprise: true,
- },
- text: "White-labeling support",
- href: "https://dub.co/help/article/dub-partners#white-labeled-in-app-dashboard",
- },
- {
- check: {
- default: false,
- business: false,
- advanced: true,
- enterprise: true,
- },
- text: "Branded email domains",
- },
- ],
- },
- {
- category: "Domains",
- features: [
- {
- text: ({ plan }) => (
- <>
- <strong>{nFormatter(plan.limits.domains, { full: true })}</strong>{" "}
- custom domains
- </>
- ),
- },
- {
- text: () => <>SSL certificates</>,
- },
- {
- check: {
- default: true,
- free: false,
- },
- text: () => (
- <>
- Premium <strong>dub.link</strong> domain
- </>
- ),
- href: "https://dub.co/help/article/default-dub-domains#premium-dublink-domain",
- },
- {
- check: {
- default: true,
- free: false,
- },
- text: () => (
- <>
- Free <strong>.link</strong> domain
- </>
- ),
- href: "https://dub.co/help/article/free-dot-link-domain",
- },
- ],
- },
- {
- category: "Workspace",
- features: [
- {
- text: ({ plan }) => (
- <>
- <strong>{nFormatter(plan.limits.users)}</strong> user
- {plan.limits.users === 1 ? "" : "s"}
- </>
- ),
- },
- {
- check: {
- default: false,
- advanced: true,
- enterprise: true,
- },
- text: "Role-based access control",
- },
- {
- check: {
- default: false,
- enterprise: true,
- },
- text: "SAML/SSO",
- href: "https://dub.co/help/category/saml-sso",
- },
- {
- check: {
- default: false,
- enterprise: true,
- },
- text: "Custom SLA",
- },
- {
- check: {
- default: false,
- enterprise: true,
- },
- text: "Audit logs",
- },
- ],
- },
- {
- category: "Support",
- features: [
- {
- text: ({ id }) => (
- <>
- <strong>
- {
- {
- free: "Basic support",
- pro: "Elevated support",
- business: "Priority support",
- advanced: "Priority via Slack",
- enterprise: "Priority with SLA",
- }[id]
- }
- </strong>
- </>
- ),
- },
- {
- check: {
- default: false,
- enterprise: true,
- },
- text: () => (
- <>
- <strong>Dedicated</strong> success manager
- </>
- ),
- },
- ],
- },
- {
- category: "API",
- features: [
- {
- text: "API Access",
- href: "https://dub.co/docs/api-reference/introduction",
- },
- {
- text: "Native SDKs",
- href: "https://dub.co/docs/sdks/overview",
- },
- {
- text: ({ id, plan }) => (
- <>
- <strong>
- {id === "enterprise"
- ? "Custom"
- : nFormatter(plan.limits.api) + "/min"}
- </strong>{" "}
- rate limit
- </>
- ),
- },
- {
- check: {
- default: false,
- business: true,
- advanced: true,
- enterprise: true,
- },
- text: "Event webhooks",
- href: "https://dub.co/docs/concepts/webhooks/introduction",
- },
- ],
- },
-];
-
export const FREE_PLAN = PLANS.find((plan) => plan.name === "Free")!;
export const PRO_PLAN = PLANS.find((plan) => plan.name === "Pro")!;
export const BUSINESS_PLAN = PLANS.find((plan) => plan.name === "Business")!;