How achievements and score data are loaded
Growth Achievements
Dashboard (list) data: Fetched from /wp-json/fleekdash/v1/growth-achievements/dashboard. The response includes data.categories (achievements per category) and data.summary (totals, completed, etc.). The frontend normalizes this into grouped lists (latest 7d, latest 30d, milestones, records) and applies the category filter in the UI.
Single achievement: Loaded via a data source that calls the growth-achievements API for one achievement (by ID). Used by GrowthAchievementDetail when you open an achievement; initial data from the list can be passed for instant display.
Caching: The dashboard request uses a data source with cache (e.g. cache: { enabled: true, ttl: 300 }), so repeated visits to the Achievements page can show cached data until refresh or TTL expiry.
Growth Meter / Growth Score
Events and score: The Growth Meter API (e.g. under /wp-json/fleekdash/v1/ growth endpoints) provides: list events, create/update/delete event, get dashboard data (score, breakdowns), recalculate points. The frontend uses growthMeterAPI (from @wordpress-bridge/api/growth-meter) and hooks such as useGrowthScoreData, useGrowthBreakdown, useGrowthEvents to load and update data.
Event types, post types, user roles: Fetched for the event form (dropdowns and config). Used when creating or editing events.
Authentication: All requests go through the platform apiClient, so authentication is handled automatically.
Benefit: One API for achievements and one for the meter/score; caching and refetch keep the UI responsive and up to date.