Global Components API
If you want to use the navigation and footer, pre-rendered with content from the public pages - we offer APIs that can be used by your web application.
The APIs
On the builders platform we have two services for serving the global navigation and footer. Both services have the same API interface. The services expose two endpoints with different API contracts. Requests should be sent pod-pod inside our kubernetes cluster (this requires configuration of Network Policy on both our side and your side).
Recommended endpoint: /json-html
Our recommended solution is to use the /json-html endpoint. This returns a json response with the keys html, js, and css. The js and css contains a list of html elements needed for client side hydration and styling.
Where to reach
This endpoint can be reached in the following ways:
Pod-Pod
- http://builders-globals-core-navigation-no.gjensidige-no.svc.cluster.local/global-navigation/json-html
- http://builders-globals-footer-no.gjensidige-no.svc.cluster.local/global-footer/json-html
Make sure you put the css element in the head of your application to avoid styling specificity problems.
You can see the API response by going to gjensidige.no/global-navigation/json-html and gjensidige.no/global-footer/json-html
Replace "no" with the relevant domain for your application.
Nice to know
If your application use both our navigation and footer, you only need to add the js and css from one of them. They are the same for both navigation and footer, thus including both will bloat your app with excess data.
Legacy solution
As this solution originally was built with the podium framework, the legacy solution adhere to podium conventions.
Where to reach
Pod-Pod
- HTML: http://builders-globals-core-navigation-no.gjensidige-no.svc.cluster.local
- Assets: http://builders-globals-core-navigation-no.gjensidige-no.svc.cluster.local/manifest.json
- HTML: http://builders-globals-footer-no.gjensidige-no.svc.cluster.local
- Assets: http://builders-globals-footer-no.gjensidige-no.svc.cluster.local/manifest.json
Replace "no" with the relevant domain for your application.
An example response for the assets looks like this:
As seen in the response above, the css and js contains some properties. These should be set on the respective tags used in your application. Note especially the
type: "esm"
When this is present, you need to add type=module in your script tag in order for it to work.
Configure Network Policies
If you are new to this solution, you need to configure your server to be allowed to make requests to our services.
Thus one of the following namespaces needs to be added to your egress:
- gjensidige-no
- gjensidige-dk
- gjensidige-se
The app labels are:
- builders-globals-core-navigation
- builders-globals-footer
We also need to add your server to our ingress config, please reach out to Mobile and Web Services.