feat: add onboarding info fields to first user setup (#23989)

Add optional demographic and newsletter preference fields to the setup
page: business use (yes/no), industry type, organization size, and two
newsletter toggles (marketing, release/security updates).

The new data flows through telemetry via a FirstUserOnboarding struct in
the snapshot payload, sent once when the first user is created. The
telemetry-server and BigQuery schema changes are required separately to
persist this data.

---------

Co-authored-by: default <davidiii@fraley.us>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeremy Ruppel
2026-04-03 09:52:52 -04:00
committed by GitHub
co-authored by default Claude Sonnet 4.6
parent 53482adc2d
commit da3c46b557
9 changed files with 549 additions and 15 deletions
+70
View File
@@ -2383,6 +2383,21 @@ export interface CreateChatRequest {
readonly labels?: Record<string, string>;
}
// From codersdk/users.go
/**
* CreateFirstUserOnboardingInfo contains optional demographic and
* newsletter preference data collected during first user setup.
* Pointer fields allow an explicit "no" answer to be distinguished
* from a skipped question, which matters for the telemetry schema.
*/
export interface CreateFirstUserOnboardingInfo {
readonly is_business: boolean | null;
readonly industry_type: IndustryType;
readonly org_size: OrgSizeRange;
readonly newsletter_marketing: boolean | null;
readonly newsletter_releases: boolean | null;
}
// From codersdk/users.go
export interface CreateFirstUserRequest {
readonly email: string;
@@ -2391,6 +2406,7 @@ export interface CreateFirstUserRequest {
readonly password: string;
readonly trial: boolean;
readonly trial_info: CreateFirstUserTrialInfo;
readonly onboarding_info?: CreateFirstUserOnboardingInfo;
}
// From codersdk/users.go
@@ -3844,6 +3860,40 @@ export const InboxNotificationFallbackIconTemplate = "DEFAULT_ICON_TEMPLATE";
// From codersdk/inboxnotification.go
export const InboxNotificationFallbackIconWorkspace = "DEFAULT_ICON_WORKSPACE";
// From codersdk/users.go
export type IndustryType =
| "Consulting"
| "Education"
| "Energy"
| "Financial Services"
| "Government"
| "Healthcare"
| "Manufacturing"
| "Media"
| "Non-Profit"
| "Other"
| "Retail"
| "Technology"
| "Telecom"
| "Transportation";
export const IndustryTypes: IndustryType[] = [
"Consulting",
"Education",
"Energy",
"Financial Services",
"Government",
"Healthcare",
"Manufacturing",
"Media",
"Non-Profit",
"Other",
"Retail",
"Technology",
"Telecom",
"Transportation",
];
// From codersdk/insights.go
export type InsightsReportInterval = "day" | "week";
@@ -4786,6 +4836,26 @@ export const OptionTypes: OptionType[] = [
"string",
];
// From codersdk/users.go
export type OrgSizeRange =
| "11-50"
| "1001-5000"
| "201-1000"
| "2-10"
| "51-200"
| "5000+"
| "Just me";
export const OrgSizeRanges: OrgSizeRange[] = [
"11-50",
"1001-5000",
"201-1000",
"2-10",
"51-200",
"5000+",
"Just me",
];
// From codersdk/organizations.go
/**
* Organization is the JSON representation of a Coder organization.