Umbraco REST API, alternatives to Umbraco Headless
We are looking to put a Vue.js front end on an Umbraco 8 site. Since Umbraco REST API is not supported with Umbraco 8 and Headless is still in beta and reported to only be supported in Umbraco Cloud, what other options are there? Has anyone created an API interface for an on-prem Umbraco 8? What if we returned JSON instead of HTML for each of our "pages"? Can we pass in an auth token to restrict access?
Magnus, that looks interesting, especially since it supports the latest Umbraco. I guess I need to read up on UmbracoApiController as I'm not sure how I would pass an auth token? Any sample projects I can download?
Have done something like this myself. Not a complete site but parts of it with vue.js as the frontend. It's actually possible to render the models passed back from Umbraco as json objects if you get rid of the circle references with your own json contract resolver. I have even made it possible to pass Umbraco dictionary items to the vue.js app.
If you do it in this way you don't even need the Api for getting the Umbraco data to your vue.js app as you getting it directly from your serialized models.
There are some caveats ie its get data only you cannot write back to umbraco and there is no security so all content is available. For my project it works a treat we have gatsby app that talks to graphiql.
Umbraco REST API, alternatives to Umbraco Headless
We are looking to put a Vue.js front end on an Umbraco 8 site. Since Umbraco REST API is not supported with Umbraco 8 and Headless is still in beta and reported to only be supported in Umbraco Cloud, what other options are there? Has anyone created an API interface for an on-prem Umbraco 8? What if we returned JSON instead of HTML for each of our "pages"? Can we pass in an auth token to restrict access?
Maybe this project could be of interest? https://github.com/deMD/UmbracoContentApi
Regards, Magnus
Magnus, that looks interesting, especially since it supports the latest Umbraco. I guess I need to read up on UmbracoApiController as I'm not sure how I would pass an auth token? Any sample projects I can download?
@Connie Did you find any solution to your problem?
Have done something like this myself. Not a complete site but parts of it with vue.js as the frontend. It's actually possible to render the models passed back from Umbraco as json objects if you get rid of the circle references with your own json contract resolver. I have even made it possible to pass Umbraco dictionary items to the vue.js app.
Take a look at this example, it's a pretty good example of how to render nested content as json data and you can do the same thing with all umbraco data I guess. https://24days.in/umbraco-cms/2019/hybrid-headless-approach/
If you do it in this way you don't even need the Api for getting the Umbraco data to your vue.js app as you getting it directly from your serialized models.
I been using umbraco graphiql although on v7 there is v8 version as well see https://github.com/rasmusjp/umbraco-graphql cool thing is the flexbility.
There are some caveats ie its get data only you cannot write back to umbraco and there is no security so all content is available. For my project it works a treat we have gatsby app that talks to graphiql.
Regards
Ismail
is working on a reply...