Open source CapCut alternative.
TypeScript
feat(site): drop the vision-call signup grant
David Le4d6d56ca81bc
diff --git a/site/src/lib/auth.ts b/site/src/lib/auth.tsindex cf031cd6..9c0cb329 100644--- a/site/src/lib/auth.ts+++ b/site/src/lib/auth.ts@@ -33,9 +33,9 @@ export const auth = betterAuth({databaseHooks: {user: {create: {- // Every new account is provisioned with its signup grants (app credits- // + free Vision API calls), its starter project, the welcome email,- // and its Resend contact. provisionSignupGrants is idempotent and+ // Every new account is provisioned with its signup credit grant, its+ // starter project, the welcome email, and its Resend contact.+ // provisionSignupGrants is idempotent and// swallows its own errors, so it never blocks user creation.after: async (user) => {await provisionSignupGrants({diff --git a/site/src/lib/onboarding/sequence.ts b/site/src/lib/onboarding/sequence.tsindex 54843c40..41ee26e7 100644--- a/site/src/lib/onboarding/sequence.ts+++ b/site/src/lib/onboarding/sequence.ts@@ -39,8 +39,3 @@ export const ONBOARDING_VERSION = 1;* chat around them. A grant that can't buy one leaves every new account* bouncing off an empty balance on its first real try. */export const signupAppCredits = "3";--/** Lifetime free Vision API calls the signup hook grants. Lives beside the- * credit amount for the same reason: the welcome slides and the welcome email- * name the number the grant uses. */-export const signupVisionFreeCalls = 100;diff --git a/site/src/lib/onboarding/signup-grants.ts b/site/src/lib/onboarding/signup-grants.tsindex 38147e1a..4e4e2256 100644--- a/site/src/lib/onboarding/signup-grants.ts+++ b/site/src/lib/onboarding/signup-grants.ts@@ -1,14 +1,10 @@import { seedStarterProject } from "@/cut/server/cloud/starter";import { creditStringToMicros } from "@/lib/credits/amounts";import { grantCredits } from "@/lib/credits/inference";-import { grantVisionCalls } from "@/lib/credits/vision-grants";import { type EmailUser } from "@/lib/email/resend";import { sendWelcomeEmail } from "@/lib/email/send-welcome";import { syncResendContact } from "@/lib/email/sync-contact";-import {- signupAppCredits,- signupVisionFreeCalls,-} from "@/lib/onboarding/sequence";+import { signupAppCredits } from "@/lib/onboarding/sequence";// Single source of truth for what a new account starts with. All steps are// idempotent and keyed to the user, so provisioning can run more than once@@ -20,7 +16,6 @@ export async function provisionSignupGrants(user: EmailUser): Promise<void> {// and signup itself must never fail because a bonus grant hiccupped.const results = await Promise.allSettled([grantSignupAppCredits(user.id),- grantSignupVisionCalls(user.id),seedStarterProject(user.id),sendWelcomeEmail(user),syncResendContact(user),@@ -47,16 +42,3 @@ async function grantSignupAppCredits(userId: string): Promise<void> {userId,});}--async function grantSignupVisionCalls(userId: string): Promise<void> {- // A one-time vision_call grant — no subscription required. The Vision route- // and the api-keys gate both accept grant balance as access. Idempotent via- // (userId, unit, source, sourceId).- await grantVisionCalls({- calls: signupVisionFreeCalls,- description: "Signup bonus Vision API calls",- source: "signup",- sourceId: `signup-vision-calls:${userId}`,- userId,- });-}