Headless
In a headless Brightspot implementation, the view system delivers content via a JSON API to a consuming application; that application processes and transforms the content using its own logic. In headless Brightspot implementations, two scenarios are common:
- Delivering APIs to mobile applications
- Delivering APIs to JavaScript frameworks ( React , Angular , or others)
Producing your JSON API requires two steps:
- Create a model
- Create a view model
The following sections provide examples for each of those steps.
The following snippet is a basic model for an article.
The following snippet is a headless view model that serializes a model’s data into JSON format.
-
Indicates output format for this view model is a JSON representation.
-
Indicates the source model is Article.
At run time, Brightspot manages the interaction between the model and view model to produce the JSON file containing field names and associated values.
The consuming application has the responsibility of processing the JSON output for downstream purposes.