Try our conversational search powered by Generative AI!

MartinOttosen
Dec 17, 2021
  3755
(3 votes)

JS SDK and Optimizely jamstack

With CMS 12 we introduced long awaited support for .Net 5 not just because it’s faster or adds cross platform support but because .NET Core is the future of .NET. Incidentally, a faster and cross platform CMS is also good news for folks whose interests runs more along the lines of JavaScript, APIs and Markup. The latest CMS 12 addition exposes new capabilities through REST APIs and with it the JS SDK which is now officially released.

The JS SDK

The JS SDK has a few pieces to it:

  1. A Node.js CLI for managing your content definitions [GitHub] [npm]
    npx content-definitions push manifest.json
  2. A typescript client for fetching content from the CMS [GitHub] [npm]
    getContent('...', { select: ['heading', 'body'] })
      .then((content) => {
        // Content was successfully loaded
      });
  3. A decoupled Vue.js sample site running on Node.js and CMS 12 [GitHub]

APIs

This is not an exhaustive list of APIs, but a good starting point for many decoupled content applications:

  1. Content Delivery API [package], [spec], [docs]
  2. Content Definitions API [package], [spec], [docs]
  3. Content Management API [package], [spec], [docs]

Btw check out this useful list of .NET packages and status with respect to .NET 5.

How to get started

The simplest way to get acquainted with the SDK is to clone the repository and setup the sample site. The sample site is based on CMS 12 and uses the new Content Definitions API and a simple in-process OIDC server based on OpenIddict meaning no need for an external identity provider to get things going, but makes it easy to transition to Azure AD or some other OIDC capable provider once you near production.

The decoupled sample site demonstrates how you can build completely decoupled applications without breaking preview or on-page-edit. Note, at the time of writing on-page-edit is not working in updated chrome browsers, but we expect to have a solution for that soon, which should work with the approach used in this sample.

Dec 17, 2021

Comments

Please login to comment.
Latest blogs
Do not upgrade to EPiServer.CMS.Core 12.21.4 without reading this!

Todays update of EPiServer.CMS.Core 12.21.4 alters default sort order in an unexpected way, when you are working with muligple languages and have...

Tomas Hensrud Gulla | May 14, 2024 | Syndicated blog

Upgrade Optimizely CMS From v11 to v12

Why Upgrade? There are many improvements implemented in version 12, but most importantly is that the whole framework is migrated from .Net Framewor...

MilosR | May 13, 2024

Configured Commerce - Infrastructure Updates Ahoy!

I'm very happy to share an important milestone - we no longer have any customers in our legacy v1 environment!  This means that the Configured...

John McCarroll | May 10, 2024

A day in the life of an Optimizely Developer - Enabling Opti ID within your application

Hello and welcome to another instalment of A Day In The Life Of An Optimizely developer, in this blog post I will provide details on Optimizely's...

Graham Carr | May 9, 2024

How to add a custom property in Optimizely Graph

In the Optimizely CMS content can be synchronized to the Optimizely Graph service for it then to be exposed by the GraphQL API. In some cases, you...

Ynze | May 9, 2024 | Syndicated blog

New Security Improvement released for Optimizely CMS 11

A new security improvement has been released for Optimizely CMS 11. You should update now!

Tomas Hensrud Gulla | May 7, 2024 | Syndicated blog