Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

HomeDev guideRecipesAPI Reference
Dev guideUser GuidesLegal TermsNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev guide

CMS + CMP/DAM + Graph

How to integrate Optimizely Content Management System with Optimizely Content Marketing Platform and Optimizely Graph.

Optimizely Content Management System (CMS) can fetch data from Optimizely Content Marketing Platform (CMP) asset metadata when integrated with Optimizely Graph. If you use CMP, you also have access to Optimizely Graph and can fetch metadata from it instead of relying on the CMP API.

The Graph integration provides better performance than using the CMP REST API to fetch meta data, and it also allows other use cases like querying for images, videos, renditions, folders and more.

📘

Note

Starting in November 2024, you should use the Optimizely Graph-supported version of this integration for optimal performance.

The Graph integration requires v2.0.0 or later of EPiServer.Cms.WelcomeIntegration.UI and EPiServer.Cms.WelcomeIntegration.Graph.

In December 2024, the Optimizely.Graph.Client 1.4.0 release introduced TransformActionBehaviour that lets you query both CMS and DAM in the same scope using different SingleKey.

Install and configure

  1. Install or Update the EPiServer.Cms.WelcomeIntegration.UI package to version 2.0.0 or later.

  2. Install EPiServer.Cms.WelcomeIntegration.Graph.

  3. Ensure there is services.AddDAMUi() call in Startup.cs.

  4. Add services.AddDAMGraphIntegration(); call to Startup.cs.

  5. If you do not already have a CMS-to-Graph integration, then add this configuration in appsettings.json. You can keep the AppKey, Secret and SingleKey as dummy values because they are not used by the DAM integration. If you already have Graph for CMS configured, leave the values as-is.

    "Optimizely": {  
      "ContentGraph": {  
        "GatewayAddress": "https://cg.optimizely.com",  
        "AppKey": "APPKEY",  
        "Secret": "SECRET",
        "SingleKey": "SINGLE_KEY",
        "TransformActionBehaviour": "Clone"
      }  
    }
    

  6. Please note in the example below that TransformActionBehaviourneeds to be configured to Cloneif you plan on using Graph indexed content from CMS as well as indexed assets from DAM. In the case that you use both sources the SingleKeywill differ between them and the configuration needs to be cloned. If CMS content is not indexed or queried then there is no need for this.

  7. The CMP+Graph integration uses a different schema and a separate SingleKey. Configure the following code in appsettings.json.

    "EPiServer": {  
      "Cms": {  
        "CMPGraph": {  
           "SingleKey": "SINGLE_KEY_FROM_CMP"  
        }  
      }  
    }
    

    Or in Startup.cs.

    services.Configure<CMPGraphOptions>(options => {  
      options.SingleKey = "SINGLE_KEY_FROM_CMP";  
    });
    
    

    📘

    Getting the CMP Graph Single Key

    If your CMP/DAM instance has Graph-enabled, you can find the key on the Misc tab under the Organization settings in CMP. The Single Key is the value of the auth query parameter of the URL listed under Content Graph Settings/DAM.

    The tab "Misc" under Organizational settings, showing the Graph configuration fields.

    If you do not see Content Graph Settings, contact Optimizely Support to enable it. Provide the name and SSO ID for your CMP instance (you can find the SSO ID under the General tab of the Organization settings.

Query Graph Data

The CMS+ CMP/DAM integration queries Optimizely Graph for metadata automatically, and you do not need to understand the schema or create your own GraphQL queries to use it. However, you have access to the Graph and can query it using your favorite GraphQL client. The following example lists images with a public Url in the folder Hotels.

Graph query for all public images in the Hotels folder.