Bartosz Sekula
Nov 5, 2024
  45
(1 votes)

CMS + CMP + Graph integration

We have just released a new package https://nuget.optimizely.com/package/?id=EPiServer.Cms.WelcomeIntegration.Graph which changes the way CMS fetches CMP Asset metadata.

If you use the CMP it means that you also have access to Graph and can fetch metadata from it instead of relying on the CMP API.

There are a few steps required in order to start using the new package https://nuget.optimizely.com/package/?id=EPiServer.Cms.WelcomeIntegration.Graph 

  1. Existing EPiServer.Cms.WelcomeIntegration packages need to be updated to version 1.4.0
  2. EPiServer.Cms.WelcomeIntegration.Graph needs to be installed
  3. GraphClient needs to be configured in appsettings.json in the following way:
    "Optimizely": {
      "ContentGraph": {
        "GatewayAddress": "https://cg.optimizely.com",
        "SingleKey": "SINGLE_KEY_FROM_CMP",
        "QueryPath": "content/v2",
        "UseHmacKey": false
      }
    }
  4. Make sure there is services.AddDAMUi(o => o.Enabled = true) call in Startup.cs
  5. Add services.AddDAMGraphIntegration(); call to Startup.cs
  6. If customer already has a CMS to Graph integration then it means he already has this config in appsettings
    "Optimizely": {
      "ContentGraph": {
        "GatewayAddress": "https://cg.optimizely.com",
        "AppKey": "APPKEY",
        "Secret": "SECRET",
        "QueryPath": "content/v2"
      }
    }
  7. Those AppKey&Secret allow to read&write to a CMS schema. But our new CMP+Graph integration uses different schema which is now available with the CMS keys.

  8. The following config needs to be added to appsettings.json
    "EPiServer": {
      "Cms": {
        "CMPGraph": {
           "SingleKey": "SINGLE_KEY_FROM_CMP"
        }
      }
    }
  9. Or to Startup.cs
    services.Configure<CMPGraphOptions>(options =>
    {
        options.SingleKey = "YOUR_KEY_FROM_CMP";
    });

In case the new package is not installed then it would still work as before, meaning all metadata will be fetched from the CMP API.

Nov 05, 2024

Comments

Please login to comment.
Latest blogs
Block type selection doesn't work

Imagine you're trying to create a new block in a specific content area. You click the "Create" link, expecting to see a CMS modal with a list of...

Damian Smutek | Nov 4, 2024 | Syndicated blog

.NET 8 FAQ

I have previously written about .NET compatibility in general and .NET 8 in particular, see blog posts here , here and here . With the end of suppo...

Magnus Rahl | Nov 4, 2024

Dynamic packages in Commerce Connect

In Optimizely Commerce Connect, you can group different items using packages and bundles. Package: A package has one or more versions of a product...

K Khan | Nov 1, 2024