Skip to content

feat: add config builder#14226

Merged
sarahxsanders merged 7 commits intomasterfrom
config-builder
Mar 2, 2026
Merged

feat: add config builder#14226
sarahxsanders merged 7 commits intomasterfrom
config-builder

Conversation

@sarahxsanders
Copy link
Contributor

@sarahxsanders sarahxsanders commented Dec 23, 2025

reviving this one from the depths. re: https://posthog.slack.com/archives/C043VJ93L3B/p1772223020503949

adds a configurable code snippet builder

demo on JS Web SDK config page:

CleanShot.2026-02-27.at.16.59.21.mp4

@daniloc
Copy link
Contributor

daniloc commented Jan 5, 2026

this is badass and clearly the right thing to do imo.

My big question: is there anything we can do to trip an alarm if/when the configuration values drift out of date?

or even better, would it be possible to always derive them from the source code?

(edit: to be clear I am asking this in the abstract, not with any concrete knowledge of how often this happens. Maybe it's not a big deal! just thinking of the case where we have some new config item and it doesn't get added, and how we'd guard against that)

@sarahxsanders
Copy link
Contributor Author

this is badass and clearly the right thing to do imo.

My big question: is there anything we can do to trip an alarm if/when the configuration values drift out of date?

or even better, would it be possible to always derive them from the source code?

(edit: to be clear I am asking this in the abstract, not with any concrete knowledge of how often this happens. Maybe it's not a big deal! just thinking of the case where we have some new config item and it doesn't get added, and how we'd guard against that)

this actually crossed my mind this morning when I was re-looking at the PR. maintenance is definitely an issue. derive from source code would be SICK... I will dig into that 🙏🏼

Copy link
Member

@edwinyjlim edwinyjlim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the two column layout because it always spotlights the code, but the description text looks cramped on a laptop

instead of having the code block be fixed or sticky, maybe we try increasing the code block's min-height (or the same height as the entire component) and making the config list be scrollable. that way it doesn't eat up the entire vertical scroll

feel free to go a different direction, it's lookin awesome

config-builder-ui.mp4

@edwinyjlim
Copy link
Member

or maybe you do single column layout but you fix the code block at the top with sticky scroll

@sarahxsanders sarahxsanders changed the title wip: config builder feat: add config builder Feb 27, 2026
Adds a reusable ConfigBuilder component and JS-specific implementation
that generates posthog.init() configuration code interactively.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2026

Deploy preview

Status Details Updated (UTC)
🟢 Ready View preview Mar 02, 2026 10:39PM

@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2026

Vale prose linter → found 2 errors, 32 warnings, 1 suggestions in your markdown

Full report → Copy the linter results into an LLM to batch-fix issues.

Linter being weird? Update the rules!

contents/docs/libraries/js/config.mdx — 2 errors, 30 warnings, 1 suggestions
Line Severity Message Rule
20:136 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
42:242 warning 'pageleave' is a possible misspelling. PostHogBase.Spelling
48:205 warning Capitalize 'Surveys' for PostHog's product. Use 'surveys' for the general industry concept. PostHogBase.ProductNames
48:308 warning Capitalize 'Surveys' for PostHog's product. Use 'surveys' for the general industry concept. PostHogBase.ProductNames
50:213 warning Capitalize 'Logs' for PostHog's product. Use 'logs' for the general industry concept. PostHogBase.ProductNames
52:233 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
53:270 warning Capitalize 'Surveys' for PostHog's product. Use 'surveys' for the general industry concept. PostHogBase.ProductNames
54:448 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
54:500 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
54:565 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
60:263 warning 'googlebot' is a possible misspelling. PostHogBase.Spelling
61:239 suggestion Address the reader directly. Use 'you' instead of 'the user'. PostHogDocs.DirectAddress
76:68 warning 'autocapture's' is a possible misspelling. PostHogBase.Spelling
82:187 warning 'textarea' is a possible misspelling. PostHogBase.Spelling
87:16 warning 'rageclick' is a possible misspelling. PostHogBase.Spelling
106:216 warning Capitalize 'Surveys' for PostHog's product. Use 'surveys' for the general industry concept. PostHogBase.ProductNames
106:255 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
107:178 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
108:152 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
108:170 warning Capitalize 'Surveys' for PostHog's product. Use 'surveys' for the general industry concept. PostHogBase.ProductNames
108:236 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
108:254 warning Capitalize 'Surveys' for PostHog's product. Use 'surveys' for the general industry concept. PostHogBase.ProductNames
108:291 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
109:130 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
111:125 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
111:390 error Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. PostHogBase.EnDash
113:118 warning 'params' is a possible misspelling. PostHogBase.Spelling
114:482 error Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. PostHogBase.EnDash
121:244 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
135:125 warning 'gzip' is a possible misspelling. PostHogBase.Spelling
136:7 warning Capitalize 'Feature Flags' for PostHog's product. Use 'Feature flags' for the general industry concept. PostHogBase.ProductNames
136:50 warning Capitalize 'Feature Flags' for PostHog's product. Use 'feature flags' for the general industry concept. PostHogBase.ProductNames
137:63 warning Capitalize 'Surveys' for PostHog's product. Use 'surveys' for the general industry concept. PostHogBase.ProductNames
src/components/Docs/ConfigBuilder.README.md — 0 errors, 2 warnings, 0 suggestions
Line Severity Message Rule
45:28 warning 'breakpoint' is a possible misspelling. PostHogBase.Spelling
46:15 warning 'scrollable' is a possible misspelling. PostHogBase.Spelling

@PostHog PostHog deleted a comment from vercel bot Feb 27, 2026
@sarahxsanders sarahxsanders marked this pull request as ready for review February 27, 2026 22:01
@sarahxsanders sarahxsanders requested review from a team and willwearing February 27, 2026 22:01
@edwinyjlim
Copy link
Member

aw yeah. wanna try building your use case on top of this branch @willwearing?

Copy link
Contributor

@willwearing willwearing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing the 'Navigate to' affordance and think it would be useful/look better

Context on Loom here: https://www.loom.com/share/e087fb6db15d4a51a68a258b4789d561

@sarahxsanders sarahxsanders enabled auto-merge (squash) March 2, 2026 22:57
@sarahxsanders sarahxsanders merged commit 6d08a27 into master Mar 2, 2026
16 checks passed
@sarahxsanders sarahxsanders deleted the config-builder branch March 2, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants