Bootstrap and Route Payloads
Role
ReactWP is powered by a shared payload contract.
That contract is used in two places:
- the initial page render through the bootstrap JSON
- client-side navigation through the route REST endpoint
This is one of the most important concepts in the starter.
Bootstrap Payload
The initial page render injects a JSON payload into:
#reactwp-bootstrap
The frontend reads it from:
src/themes/reactwp/js/inc/Runtime.js
The bootstrap payload currently contains:
sitethemesystemassetsnavigationrouteseoDefaults
site
site contains basic site metadata.
Typical values:
namedescriptionlanguagelocalehomeUrladminUrl
theme
theme contains the active theme metadata.
Typical values:
nameslugversion
system
system contains runtime infrastructure URLs and environment values.
Typical values:
publicbaseUrlhomeUrladminUrlajaxUrlrestUrlrestNoncethemeUrlthemeDirectoryrouteEndpoint
This part of the payload is designed to be extended through rwp_system.
assets
assets groups the starter's critical and deferred loading maps.
Current keys:
criticalFontscriticalMediasnoCriticalMedias
Each map is grouped by media group name, such as:
allhomeservice
The loader runtime combines all with the groups declared by the route.
navigation
navigation is the normalized menu payload exposed to React.
Each location key contains an array of items.
Each item can include:
idlabeltitleurlpathtargetclasseschildren
Example:
navigation.primary
route
route is the currently active normalized route payload.
This same general structure is reused during client-side navigation.
Typical values:
idtypetemplatepageNamepathurlseomediaGroupsdatais404head
Route Payload Shape
id
The route identifier.
Examples:
- post ID
user_12term_7nullfor a 404 route
type
The route object type.
Examples:
pagepost- custom post type slug
termuser404
template
The React template name to resolve through the template registry.
Examples:
DefaultNotFound- a custom template name stored in ACF
pageName
The route display name, used by templates and SEO helpers.
path
The normalized route path used by the frontend runtime.
Examples:
//starter-guide//services/design/
search
The normalized query string for the route, without the hash fragment.
Examples:
- `` (empty string)
?s=test?category=design&page=2
query
The parsed query object for the route.
Examples:
{}{ s: 'test' }{ category: 'design', page: '2' }
url
The full URL for the route.
seo
The route SEO payload.
This can contain fields like:
titletitle_frdescriptiondescription_frog_titleog_descriptionog_image
mediaGroups
A comma-separated string used by the loader runtime to decide which critical and deferred asset groups to load.
Example:
home, shared
data
The ACF route data that the template consumes.
This is where template-specific content lives.
is404
Boolean that tells the runtime whether the route is a 404 payload.
head
An optional array of rendered head tags.
If present, the frontend uses it to re-sync the document head after navigation.
See Head and SEO.
Why This Matters
The whole ReactWP navigation model depends on this contract staying stable.
That is why the starter resolves:
- the current route through PHP
- future routes through the REST endpoint
using the same normalization logic.
Where To Extend It
If you need to add data to the bootstrap or route payloads, the main extension points are:
rwp_systemrwp_bootstraprwp_route_payloadrwp_wp_head
See Hooks and Filters.