DEV Community

Nikolaj Brask-Nielsen
Nikolaj Brask-Nielsen

Posted on

3 Ways to go headless with Umbraco

What is Umbraco?

Umbraco is a CMS framework for building great editor experiences. It comes with a fully fleshed backend for easy content management and provides a rich and flexible experience for developers.

Umbraco is built on the Asp Net platform, making it easy to use Razor to build your frontend. But this also locks you to using Asp Net as your frontend. Which is where making Umbraco headless comes into the picture. By making Umbraco headless, you allow your team to create a decopled frontend in any technogly.

So how do I go headless with umbraco?

There's a varity of ways to make Umbraco headless, which comes with different pros and cons. I've collected 3 examples here of ways that you could go about turing Umbraco headless.

Vertica.Umbraco.Headless

This is a highly flexible solution created by Vertica A/S based on hooking into the Umbraco render pipeline and outputting JSON data instead of html by doing this you can query data based on the route requested in a frontend and use the JSON response to render your frontend.

Pros

  • Friendly - plug & play headless CMS capability for Umbraco
  • Flexible - 100% extensible and customizable
  • Open - integrates seamlessly with the Umbraco ecosystem, thus imposing no limitations towards other Umbraco packages and add-ons

Cons

  • Limiting quering - It's not possible to select only the data you need, like in GraphQL

Vertica Umbraco Headless Framework

This is an extension for Umbraco (version 9+) that lets you use your Umbraco content in a headless fashion. It is highly customizable, and you can tweak or replace every aspect of the generated output.

Vertica Umbraco Headless Framework (VUHF) is not to be confused with the Umbraco Heartcore, commercial headless SaaS offering from Umbraco. This is purely a rendering framework, designed to replace (or complement) the rendering mechanism within Umbraco.

The framework is build to be:

  • Friendly - plug & play headless CMS capability for Umbraco
  • Flexible - 100% extensible and customizable
  • Open - integrates seamlessly with the Umbraco ecosystem, thus imposing no limitations towards other Umbraco packages and add-ons

Installation

First install the VUHF NuGet package in your Umbraco project:

dotnet add MyProject package Vertica.Umbraco.Headless.Core

Now open the Startup class of your Umbraco project and include the VUHF core extensions by adding:

using
Enter fullscreen mode Exit fullscreen mode

Nikcio.UHeadless

UHeadless is a GraphQL based package that allows you to query your data via. a GraphQL endpoint. UHeadless supports various ways of quering your data and is fully extendable to fit your needs.

Pros

  • Easy to setup
  • Fully extendable - can be customized to fit your needs
  • GraphQL - query only the data you need

GitHub logo nikcio / Nikcio.UHeadless

Make Umbraco headless using GraphQL

Nikcio.UHeadless

Logo-w-text

Codacy Badge Maintainability Build UHeadless Nuget Downloads Nuget Version Nuget (with prereleases)

This repository creates an easy setup solution for making Umbraco headless. It comes with a wide range of extensibility options that can be tailored to your needs.

Works on

  • Umbraco 9
  • Umbraco 10

To get started, add the following to your Startup.cs.

Setup

using Nikcio.UHeadless.Extensions;

public void ConfigureServices(IServiceCollection services)
        {
            services.AddUmbraco(_env, _config)
                /* Code obmitted for clarity */
                .AddUHeadless()
                /* Code obmitted for clarity */
        }

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    /* Code obmitted for clarity */

    app.UseUHeadlessGraphQLEndpoint();

    app.UseUmbraco()
    /* etc... */
}
Enter fullscreen mode Exit fullscreen mode

Now your content will be avalible at /graphql

To get started try adding some content to the root and run the following query:

{
  contentAtRoot {
    nodes {
      id,
      name
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Documentation

Find the

Build your own

If you're not feeling satified with any of the other options there's always the possibillity of building your own. This gives you the abillity to totally customize the setup of developer experice of the integrations. But you also need to maintain the package yourself. For example at Limbo (formerly skybrud) they're building their own headless package for internal use.

Pros

  • Get to build it - you decide what goes in

Cons

  • Maintenance - you have to maintain the package

GitHub logo skybrud / Skybrud.Umbraco.Spa

Work in progress...

Extra: Umbraco Heartcore

Umbraco has it's own headless solution that you can buy into called Umbrao Heartcore. This gives you a managed REST API and GraphQL endpoint. But the catch is that many of the packages from the Umbraco commuity can't be used.

Pros

  • Managed - ships with managed REST API, GraphQL, CDN, and more
  • Automatic upgrades
  • Hosting - Umbraco will host the solution for you

Cons

  • Payed
  • Package compatibillity - Not all Umbraco packages can work with Heartcore

Top comments (1)

Collapse
 
davidpeckuk profile image
David Peck

Useful. I'd not heard of these two packages. Another option is pushing Umbraco data (on publish/save) to MondoDB Atlas. You can then use MongoDB App Services to access the data via GraphQL (or you can write your own API controllers if you prefer).