- Documentation
- Learning Hub
- Section 2 of 5 Foundation SDK fundamentals
The Foundation SDK builder pattern
Slide 1 of 3
How builders work in the Foundation SDK
You already know the Foundation SDK produces dashboard JSON. The usual way to get there is the builder pattern: define the dashboard one step at a time with chained method calls, instead of one giant config object.
Follow the builder sequence
Most dashboard code follows this flow:
- Start with DashboardBuilder for dashboard-level settings such as title, UID, refresh interval, and time range.
- Add each panel with PanelBuilder (for example a time series or stat panel).
- Add panel queries with DataqueryBuilder so each panel knows how to fetch data.
- Call build() (or the equivalent in your language) and export the final dashboard JSON.
That JSON is what you will store in Git for Git Sync.