Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
✨ Show API access as a Pro feature on the pricing page and in the pay wall (#3267)
Luke Vellad9d17ce33e1a
diff --git a/apps/landing/public/locales/en/pricing.json b/apps/landing/public/locales/en/pricing.jsonindex 2ba6d809f..77e0750a5 100644--- a/apps/landing/public/locales/en/pricing.json+++ b/apps/landing/public/locales/en/pricing.json@@ -1,6 +1,8 @@{"advancedPollSettings": "Advanced poll settings","advancedPollSettingsDescription": "Require participant emails, hide participant names, and hide votes",+ "apiAccess": "API access",+ "apiAccessDescription": "Create polls and read results from your own systems. <a>Read the API docs</a>","basicPolls": "Basic polls","cancelSubscription": "How do I cancel my subscription?","cancelSubscriptionAnswer": "You can cancel your subscription at any time by going to your <a>billing settings</a>. Once you cancel your subscription, you will still have access to your paid plan until the end of your billing period. After that, you will be downgraded to a free plan.",diff --git a/apps/landing/src/app/[locale]/(main)/pricing/page.tsx b/apps/landing/src/app/[locale]/(main)/pricing/page.tsxindex c15972ae9..1994e1df8 100644--- a/apps/landing/src/app/[locale]/(main)/pricing/page.tsx+++ b/apps/landing/src/app/[locale]/(main)/pricing/page.tsx@@ -13,6 +13,7 @@ import {MailPlusIcon,PaletteIcon,Settings2Icon,+ TerminalIcon,TimerResetIcon,UserPlusIcon,} from "lucide-react";@@ -75,6 +76,8 @@ import {const faqLinkClassName ="text-gray-800 underline underline-offset-2 hover:text-gray-600";+const apiDocsUrl = "https://support.rallly.co/api-reference/introduction";+export default async function Page(props: {params: Promise<{ locale: string }>;}) {@@ -384,6 +387,16 @@ export default async function Page(props: {/></PlanBenefitName></PlanBenefit>+ <PlanBenefit icon={<TerminalIcon />}>+ <PlanBenefitName>+ <Trans+ t={t}+ ns="pricing"+ i18nKey="apiAccess"+ defaults="API access"+ />+ </PlanBenefitName>+ </PlanBenefit></PlanBenefits></PlanCard></PlanCards>@@ -730,6 +743,35 @@ export default async function Page(props: {<CompareTableCheck label={included} /></CompareTableCell></tr>+ <tr>+ <CompareTableFeature>+ <CompareTableFeatureName>+ <Trans+ t={t}+ ns="pricing"+ i18nKey="apiAccess"+ defaults="API access"+ />+ </CompareTableFeatureName>+ <CompareTableFeatureDescription>+ <Trans+ t={t}+ ns="pricing"+ i18nKey="apiAccessDescription"+ components={{+ a: <a className={faqLinkClassName} href={apiDocsUrl} />,+ }}+ defaults="Create polls and read results from your own systems. <a>Read the API docs</a>"+ />+ </CompareTableFeatureDescription>+ </CompareTableFeature>+ <CompareTableCell>+ <CompareTableDash label={notIncluded} />+ </CompareTableCell>+ <CompareTableCell>+ <CompareTableCheck label={included} />+ </CompareTableCell>+ </tr></tbody></CompareTable></SectionContent>diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.jsonindex e624783c0..817f075b6 100644--- a/apps/web/public/locales/en/app.json+++ b/apps/web/public/locales/en/app.json@@ -50,6 +50,8 @@"alreadyLoggedInDescription": "Continue to your dashboard or sign out to use a different account.","alreadyLoggedInTitle": "You're already signed in","alreadyMember": "This person is already a member of this space",+ "apiAccess": "API access",+ "apiAccessBenefitDescription": "Create polls and read results from your own systems","apiAccessUpgradeDescription": "Create API keys to manage your polls programmatically. Included with Pro, with a shared limit of {count} requests per minute across your space.","apiAccessUpgradeTitle": "Upgrade for API access","apiDailyLimitLabel": "Daily limit",diff --git a/apps/web/src/features/billing/components/pay-wall-dialog.tsx b/apps/web/src/features/billing/components/pay-wall-dialog.tsxindex f22c4ff8a..663275c08 100644--- a/apps/web/src/features/billing/components/pay-wall-dialog.tsx+++ b/apps/web/src/features/billing/components/pay-wall-dialog.tsx@@ -30,6 +30,7 @@ import {MailPlusIcon,PaletteIcon,SparklesIcon,+ TerminalIcon,TimerResetIcon,UserPlusIcon,} from "lucide-react";@@ -182,14 +183,32 @@ const proBenefitsList = [/>),},+ {+ key: "apiAccess",+ icon: <TerminalIcon />,+ title: <Trans i18nKey="apiAccess" defaults="API access" />,+ description: (+ <Trans+ i18nKey="apiAccessBenefitDescription"+ defaults="Create polls and read results from your own systems"+ />+ ),+ },];+const leadingBenefitByTrigger: Partial<Record<PayWallTrigger["from"], string>> =+ {+ "invite-dialog": "emailInvites",+ "api-keys": "apiAccess",+ };+// The benefit that triggered the pay wall leads the list.function getProBenefits(from: PayWallTrigger["from"] | undefined) {- if (from !== "invite-dialog") return proBenefitsList;+ const leading = from ? leadingBenefitByTrigger[from] : undefined;+ if (!leading) return proBenefitsList;return [- ...proBenefitsList.filter((benefit) => benefit.key === "emailInvites"),- ...proBenefitsList.filter((benefit) => benefit.key !== "emailInvites"),+ ...proBenefitsList.filter((benefit) => benefit.key === leading),+ ...proBenefitsList.filter((benefit) => benefit.key !== leading),];}