From 07331df68ba2e50b8a4ddcaca6b10afba45908b6 Mon Sep 17 00:00:00 2001 From: T3 Code Test Date: Thu, 27 Aug 2026 04:41:12 +0530 Subject: [PATCH 01/29] feat(connect): add account-backed referral points --- apps/marketing/src/pages/privacy-policy.astro | 18 +- apps/mobile/src/Stack.tsx | 8 + .../src/features/cloud/managedRelayState.ts | 58 + .../settings/SettingsReferralsRouteScreen.tsx | 216 ++ .../features/settings/SettingsRouteScreen.tsx | 8 + .../components/settings-sheet-targets.ts | 3 +- apps/web/src/cloud/managedRelayState.ts | 52 + apps/web/src/cloud/referralLinks.test.ts | 11 + apps/web/src/cloud/referralLinks.ts | 15 + .../clerk/ReferralsUserProfilePage.tsx | 194 ++ .../clerk/T3ConnectSidebarSignIn.tsx | 10 +- .../cloud/ReferralClaimCoordinator.tsx | 115 ++ apps/web/src/routes/__root.tsx | 2 + docs/README.md | 1 + docs/internals/t3-connect.md | 16 + docs/user/referrals.md | 17 + infra/relay/README.md | 2 + .../migration.sql | 23 + .../snapshot.json | 1812 +++++++++++++++++ infra/relay/src/http/Api.ts | 18 + infra/relay/src/persistence/schema.ts | 37 + .../src/referrals/ReferralProgram.test.ts | 223 ++ infra/relay/src/referrals/ReferralProgram.ts | 340 ++++ infra/relay/src/worker.ts | 2 + .../src/connection/resolver.test.ts | 2 + .../src/relay/discovery.test.ts | 4 + .../client-runtime/src/relay/managedRelay.ts | 42 + .../src/relay/managedRelayState.test.ts | 47 + .../src/relay/managedRelayState.ts | 46 +- packages/contracts/src/relay.ts | 43 + packages/shared/package.json | 4 + packages/shared/src/referral.test.ts | 16 + packages/shared/src/referral.ts | 13 + 33 files changed, 3409 insertions(+), 9 deletions(-) create mode 100644 apps/mobile/src/features/settings/SettingsReferralsRouteScreen.tsx create mode 100644 apps/web/src/cloud/referralLinks.test.ts create mode 100644 apps/web/src/cloud/referralLinks.ts create mode 100644 apps/web/src/components/clerk/ReferralsUserProfilePage.tsx create mode 100644 apps/web/src/components/cloud/ReferralClaimCoordinator.tsx create mode 100644 docs/user/referrals.md create mode 100644 infra/relay/migrations/postgres/20260826230249_complete_logan/migration.sql create mode 100644 infra/relay/migrations/postgres/20260826230249_complete_logan/snapshot.json create mode 100644 infra/relay/src/referrals/ReferralProgram.test.ts create mode 100644 infra/relay/src/referrals/ReferralProgram.ts create mode 100644 packages/shared/src/referral.test.ts create mode 100644 packages/shared/src/referral.ts diff --git a/apps/marketing/src/pages/privacy-policy.astro b/apps/marketing/src/pages/privacy-policy.astro index b85bc0b12b44..697f820ec2b7 100644 --- a/apps/marketing/src/pages/privacy-policy.astro +++ b/apps/marketing/src/pages/privacy-policy.astro @@ -75,6 +75,11 @@ const sections = [ credential hashes, connection status, app and operating-system versions, and notification preferences. +
  • + Referral information. If you use the referral program, we process + referral codes, account-to-account referral attribution, qualification status, and + point-ledger entries. +
  • Agent activity and notifications. If you enable notifications or Live Activities, we process push tokens and limited activity information needed to provide @@ -151,6 +156,7 @@ const sections = [