Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(startups): ask YC applicants for a YC founder verification link (#84322)

Joe Martin01464528757b
diff --git a/frontend/src/scenes/startups/StartupProgram.tsx b/frontend/src/scenes/startups/StartupProgram.tsx
index 8b6f0c84066e..cb648a1399ed 100644
--- a/frontend/src/scenes/startups/StartupProgram.tsx
+++ b/frontend/src/scenes/startups/StartupProgram.tsx
@@ -497,6 +497,43 @@ export function StartupProgram(): JSX.Element {
{isYC && (
<>
+ <LemonField
+ name="yc_verification_url"
+ label="Your YC verification link"
+ info={
+ <span>
+ See{' '}
+ <Link
+ target="_blank"
+ to="https://www.ycombinator.com/verify"
+ >
+ YC's verification docs
+ </Link>{' '}
+ for how verification links work. We check your link when you
+ submit the application.
+ </span>
+ }
+ help={
+ <span>
+ Create a verification link at{' '}
+ <Link
+ target="_blank"
+ to="https://www.ycombinator.com/verify/manage"
+ >
+ ycombinator.com/verify/manage
+ </Link>{' '}
+ with your company details and batch visible, so we can
+ verify you automatically. Phone number, personal email, and
+ social profiles can be left off.
+ </span>
+ }
+ >
+ <LemonInput
+ placeholder="https://www.ycombinator.com/verify/your-unique-code"
+ className="bg-bg-light"
+ />
+ </LemonField>
+
<LemonField name="yc_batch" label="Which YC batch are you?">
<LemonSelect options={ycBatchOptions} className="bg-bg-light" />
</LemonField>
diff --git a/frontend/src/scenes/startups/constants.ts b/frontend/src/scenes/startups/constants.ts
index 5212181ea253..494f8c58fcd6 100644
--- a/frontend/src/scenes/startups/constants.ts
+++ b/frontend/src/scenes/startups/constants.ts
@@ -6,6 +6,10 @@ import freeEmailDomains from 'free-email-domains'
// which enforces the same block server-side.
export const PUBLIC_EMAIL_DOMAINS: ReadonlySet<string> = new Set(freeEmailDomains.map((d) => d.toLowerCase()))
+// Matches YC founder verification links, e.g. https://www.ycombinator.com/verify/db9imrf5u1kaxib5
+// Keep in sync with the billing repo at billing/utils/startups.py, which enforces the same check server-side
+export const YC_VERIFICATION_URL_REGEX = /^(?:https?:\/\/)?(?:www\.)?ycombinator\.com\/verify\/([A-Za-z0-9]+)\/?$/
+
export const RAISED_OPTIONS = [
{ label: 'Bootstrapped', value: '0' },
{ label: 'Under $100k', value: '99999' },
diff --git a/frontend/src/scenes/startups/startupProgramLogic.test.ts b/frontend/src/scenes/startups/startupProgramLogic.test.ts
index d0733563da6f..041a371bfda9 100644
--- a/frontend/src/scenes/startups/startupProgramLogic.test.ts
+++ b/frontend/src/scenes/startups/startupProgramLogic.test.ts
@@ -155,4 +155,32 @@ describe('startupProgramLogic', () => {
],
])
})
+
+ describe('YC verification link', () => {
+ // The billing service verifies the link once, on submit. Client-side we only check the URL shape.
+ it('requires a link on the YC form and validates its shape', async () => {
+ const logic = await mountStartupProgramLogic({ email: '[email protected]', referrer: 'yc' })
+
+ expect(logic.values.startupProgramValidationErrors.yc_verification_url).toEqual(
+ 'Please enter your YC verification link'
+ )
+
+ logic.actions.setStartupProgramValue('yc_verification_url', 'https://example.com/verify/abc')
+ expect(logic.values.startupProgramValidationErrors.yc_verification_url).toEqual(
+ 'This should look like https://www.ycombinator.com/verify/your-unique-code'
+ )
+
+ logic.actions.setStartupProgramValue(
+ 'yc_verification_url',
+ 'https://www.ycombinator.com/verify/db9imrf5u1kaxib5'
+ )
+ expect(logic.values.startupProgramValidationErrors.yc_verification_url).toBeUndefined()
+ })
+
+ it('does not require a link on the non-YC form', async () => {
+ const logic = await mountStartupProgramLogic({ email: '[email protected]' })
+
+ expect(logic.values.startupProgramValidationErrors.yc_verification_url).toBeUndefined()
+ })
+ })
})
diff --git a/frontend/src/scenes/startups/startupProgramLogic.ts b/frontend/src/scenes/startups/startupProgramLogic.ts
index 45525815e9df..449e552e0bf5 100644
--- a/frontend/src/scenes/startups/startupProgramLogic.ts
+++ b/frontend/src/scenes/startups/startupProgramLogic.ts
@@ -15,6 +15,7 @@ import { userLogic } from 'scenes/userLogic'
import { BillingType } from '~/types'
import type { OrganizationType, StartupProgramLabel, UserType } from '../../types'
+import { YC_VERIFICATION_URL_REGEX } from './constants'
import { getEmailDomain, getYCBatchOptions, isPublicEmailDomain } from './utils'
export enum StartupProgramType {
@@ -29,6 +30,7 @@ export interface StartupProgramFormValues {
organization_id: string
raised?: string
incorporation_date?: Dayjs
+ yc_verification_url?: string
yc_batch?: string
yc_proof_screenshot_url?: string
yc_merch_count?: number
@@ -71,6 +73,32 @@ function validateFunding(raised: string | undefined, isYC: boolean): string | un
return undefined
}
+/** Ensure the link has a scheme before it's sent to the billing service, which expects a full URL. */
+function normalizeYcVerificationUrl(url: string | undefined): string | undefined {
+ const trimmed = url?.trim()
+ if (!trimmed) {
+ return undefined
+ }
+ return /^https?:\/\//.test(trimmed) ? trimmed : `https://${trimmed}`
+}
+
+/**
+ * Only the URL shape is checked client-side. The billing service does the real verification
+ * against YC once, on submit, and its errors surface through the submit failure path.
+ */
+function validateYcVerificationUrl(url: string | undefined, isYC: boolean): string | undefined {
+ if (!isYC) {
+ return undefined
+ }
+ if (!url) {
+ return 'Please enter your YC verification link'
+ }
+ if (!YC_VERIFICATION_URL_REGEX.test(url.trim())) {
+ return 'This should look like https://www.ycombinator.com/verify/your-unique-code'
+ }
+ return undefined
+}
+
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface startupProgramLogicValues {
billing: BillingType | null // billingLogic
@@ -310,6 +338,7 @@ export const startupProgramLogic = kea<startupProgramLogicType>([
organization_id: values.currentOrganizationId,
raised: undefined,
incorporation_date: undefined,
+ yc_verification_url: values.isYC ? '' : undefined,
yc_batch: values.isYC ? '' : undefined,
yc_proof_screenshot_url: undefined,
yc_merch_count: values.isYC ? 1 : undefined,
@@ -323,6 +352,7 @@ export const startupProgramLogic = kea<startupProgramLogicType>([
organization_id,
raised,
incorporation_date,
+ yc_verification_url,
yc_batch,
yc_proof_screenshot_url,
}: StartupProgramFormValues,
@@ -346,6 +376,7 @@ export const startupProgramLogic = kea<startupProgramLogicType>([
organization_id: !organization_id ? 'Please select an organization' : undefined,
raised: validateFunding(raised, isYC),
incorporation_date: validateIncorporationDate(incorporation_date, isYC),
+ yc_verification_url: validateYcVerificationUrl(yc_verification_url, isYC),
yc_batch: isYC && !yc_batch ? 'Please select your YC batch' : undefined,
yc_proof_screenshot_url:
isYC && !yc_proof_screenshot_url ? 'Please upload a screenshot' : undefined,
@@ -360,6 +391,7 @@ export const startupProgramLogic = kea<startupProgramLogicType>([
}
if (values.isYC) {
+ valuesToSubmit.yc_verification_url = normalizeYcVerificationUrl(formValues.yc_verification_url)
valuesToSubmit.yc_batch = formValues.yc_batch
valuesToSubmit.yc_proof_screenshot_url = formValues.yc_proof_screenshot_url
}
@@ -377,7 +409,9 @@ export const startupProgramLogic = kea<startupProgramLogicType>([
try {
await api.create('api/billing/startups/apply', valuesToSubmit)
actions.setFormSubmitted(true)
- posthog.capture('startup program application submitted', valuesToSubmit)
+ // The verification link is bearer proof of YC founder status, so it stays out of analytics
+ const { yc_verification_url: _discarded, ...capturedValues } = valuesToSubmit
+ posthog.capture('startup program application submitted', capturedValues)
} catch (error: any) {
// Billing-service validation errors can arrive as an object under error.detail
const detail = typeof error.detail === 'string' ? error.detail : error.detail?.detail