YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(app): account page -> $50/mo Pro via new subscription checkout + token
Louis Beaumont9fc0c26b6927
diff --git a/apps/screenpipe-app-tauri/components/app-entitlement-gate.tsx b/apps/screenpipe-app-tauri/components/app-entitlement-gate.tsxindex 2057e2807..88f89b907 100644--- a/apps/screenpipe-app-tauri/components/app-entitlement-gate.tsx+++ b/apps/screenpipe-app-tauri/components/app-entitlement-gate.tsx@@ -114,7 +114,13 @@ export function AppEntitlementGate({ children }: { children: React.ReactNode })posthog.capture("app_entitlement_choose_plan_clicked", {logged_in: Boolean(user?.token),});- openUrl(PRICING_URL).catch(() => window.open(PRICING_URL, "_blank"));+ // Hand the Clerk token to the web checkout so it pins customer_email ++ // metadata.user_id to THIS account — prevents the "paid with a different+ // email in Stripe -> still locked" mismatch.+ const url = user?.token+ ? `${PRICING_URL}${PRICING_URL.includes("?") ? "&" : "?"}token=${encodeURIComponent(user.token)}`+ : PRICING_URL;+ openUrl(url).catch(() => window.open(url, "_blank"));}, [user?.token]);const openLogin = useCallback(() => {diff --git a/apps/screenpipe-app-tauri/components/settings/account-section.tsx b/apps/screenpipe-app-tauri/components/settings/account-section.tsxindex 0f351bc80..8503ef99a 100644--- a/apps/screenpipe-app-tauri/components/settings/account-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/account-section.tsx@@ -23,7 +23,6 @@ import { Label } from "@/components/ui/label";import { onOpenUrl } from "@tauri-apps/plugin-deep-link";import { localFetch } from "@/lib/api";import { listen } from "@tauri-apps/api/event";-import { PricingToggle } from "./pricing-toggle";import { ReferralCard } from "./referral-card";import { useHealthCheck } from "@/lib/hooks/use-health-check";import posthog from "posthog-js";@@ -50,7 +49,6 @@ function syncErrorDescription(e: unknown): string {export function AccountSection() {const { settings, updateSettings, loadUser } = useSettings();const { isServerDown } = useHealthCheck();- const [isAnnual, setIsAnnual] = useState(true);const [pipeSyncing, setPipeSyncing] = useState(false);const [memoriesSyncing, setMemoriesSyncing] = useState(false);const [connectionsSyncing, setConnectionsSyncing] = useState(false);@@ -112,19 +110,21 @@ export function AccountSection() {return;}if (!settings.user?.cloud_subscribed) {- posthog.capture("cloud_plan_selected", { billing: isAnnual ? "yearly" : "monthly" });+ posthog.capture("cloud_plan_selected", { plan: "pro" });try {- const response = await fetch("https://screenpi.pe/api/cloud-sync/checkout", {+ // New subscription checkout ($50/mo Pro). Pass the Clerk token so the+ // session pins customer_email + metadata.user_id to this account — the+ // webhook then links the sub even if a different email is used at Stripe.+ const response = await fetch("https://screenpi.pe/api/subscription/checkout", {method: "POST",headers: {"Content-Type": "application/json",- "Authorization": `Bearer ${settings.user?.token}`,},body: JSON.stringify({- tier: "pro",- billingPeriod: isAnnual ? "yearly" : "monthly",- userId: settings.user?.id,- email: settings.user?.email,+ plan: "pro",+ token: settings.user?.token,+ returnUrl: "https://screenpipe.com/account",+ origin: "app-account-section",}),});const data = await response.json();@@ -503,19 +503,10 @@ export function AccountSection() {<h3 className="text-lg font-semibold">Screenpipe Pro</h3></div><div className="flex items-baseline gap-2">- <span className="text-2xl font-bold">{isAnnual ? "$26" : "$39"}</span>+ <span className="text-2xl font-bold">$50</span><span className="text-muted-foreground text-sm">/month</span>- {isAnnual && (- <span className="text-xs border border-foreground/20 text-foreground px-2 py-0.5 rounded-full font-medium">- save 33%- </span>- )}</div>- {isAnnual && (- <p className="text-xs text-muted-foreground mt-0.5">$312/year, billed annually</p>- )}</div>- <PricingToggle isAnnual={isAnnual} onToggle={setIsAnnual} /></div><div className="grid grid-cols-2 gap-x-4 gap-y-1.5 text-sm mb-4">@@ -595,19 +586,10 @@ export function AccountSection() {<h3 className="text-lg font-semibold">Screenpipe Pro</h3></div><div className="flex items-baseline gap-2">- <span className="text-2xl font-bold">{isAnnual ? "$26" : "$39"}</span>+ <span className="text-2xl font-bold">$50</span><span className="text-muted-foreground text-sm">/month</span>- {isAnnual && (- <span className="text-xs border border-foreground/20 text-foreground px-2 py-0.5 rounded-full font-medium">- save 33%- </span>- )}</div>- {isAnnual && (- <p className="text-xs text-muted-foreground mt-0.5">$312/year, billed annually</p>- )}</div>- <PricingToggle isAnnual={isAnnual} onToggle={setIsAnnual} /></div><div className="grid grid-cols-2 gap-x-4 gap-y-1.5 text-sm mb-4">diff --git a/apps/screenpipe-app-tauri/components/settings/pricing-toggle.tsx b/apps/screenpipe-app-tauri/components/settings/pricing-toggle.tsxdeleted file mode 100644index 019b0aaeb..000000000--- a/apps/screenpipe-app-tauri/components/settings/pricing-toggle.tsx+++ /dev/null@@ -1,25 +0,0 @@-import { Label } from "@/components/ui/label";-import { Switch } from "@/components/ui/switch";--interface PricingToggleProps {- isAnnual: boolean;- onToggle: (value: boolean) => void;-}--export function PricingToggle({ isAnnual, onToggle }: PricingToggleProps) {- return (- <div className="flex items-center gap-4 mb-4">- <Label htmlFor="billing-toggle" className="text-sm">- monthly- </Label>- <Switch- id="billing-toggle"- checked={isAnnual}- onCheckedChange={onToggle}- />- <Label htmlFor="billing-toggle" className="text-sm">- annual (4 months free)- </Label>- </div>- );-}