Skip to main content

Add integration

This section describes how to configure the Sitecore integration in order to expose content from Sitecore XM/XP to Uniform Canvas.

Configure Sitecore

Sitecore must be configured in order to expose its content to Uniform Canvas.

Configure Sitecore Services Client

Uniform uses the Sitecore Services Client (SSC) to read content from Sitecore, so SSC must be enabled and configured.

  1. If SSC is not enabled, you must enable it. The following is an example of a config file that enables SSC:
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
    <settings>
    <setting name="Sitecore.Services.AllowAnonymousUser" value="true" />
    <setting name="Sitecore.Services.AllowItemServiceAnonymousUser" value="true" />
    <setting name="Sitecore.Services.SecurityPolicy" value="Sitecore.Services.Infrastructure.Web.Http.Security.ServicesOnPolicy, Sitecore.Services.Infrastructure" />
    </settings>
    </sitecore>
    </configuration>
  2. In Sitecore, open Content Editor.
  3. Open the master database
  4. Navigate to sitecore > system > Settings > Services > API Keys
  5. Add the following item:
    • Template: API Key
    • Name: Uniform API Key
  6. Set the following field values:
    • CORS Origins: https://uniform.app
    • Allowed Controllers: Sitecore.Services.Infrastructure.*
    • Impersonation User: Name of a Sitecore user with access to site items, /sitecore/system/Languages, /sitecore/templates and /sitecore/system/Uniform (for example, sitecore\admin)
  7. Save the item.
  8. Publish the item.
  9. Note the item ID. This is your Sitecore API key. You will need this value later.
tip

We also recommend that the user sitecore\servicesAPI have permissions configured that explicitly deny access to the remaining parts of content tree. This is the account SSC uses by default for calls when an API key is not specified.

Configure Sitecore site

Canvas will read content from your Sitecore site, but some configuration is needed. This configuration comes in the form of something called site configuration. The Uniform connector on your Sitecore instance uses the site configuration to determine which Uniform functionality to enable. You must create a site configuration for your web app.

tip

Site configuration can be created using Sitecore config files or Sitecore items. These instructions use Sitecore items. The config file approach is recommended for production environments, but using Sitecore items may be easier for some users during development and testing.

  1. In Content Editor, navigate to sitecore > system > Uniform > Site Configurations
  2. Add the following item:
    • Template: Site Configuration
    • Name: website
      info

      You use website here because this example uses the default Sitecore site. If you have multiple sites on your Sitecore server you must use the appropriate site name.

  3. Add an item using the template Configure Site.
  4. Select the child item Configuration.
  5. Set the following field values:
    • Inherits: website
      info

      You use website here because this example uses the default Sitecore site. If you have multiple sites on your Sitecore server you must use the appropriate site name.

  6. Save the item.
  7. Publish the site.

Configure Uniform

Uniform must be configured to point to a Sitecore instance.

Create Uniform API key

A Uniform API key is needed for both Sitecore and the web app to communicate with Canvas. You must create a new key for your web app

  1. In Uniform, click the logo in the top-left to return to the home page.
  2. Navigate to Settings > API Keys.
  3. Click (+).
  4. Enter the following values:
    • Name: My Sitecore Project
    • Project dropdown: My Sitecore Project
  5. Select all of the permissions in the section Uniform Canvas.
  6. Click Create API Key.
  7. Note the value for Key because this is the only time it will be displayed. This is your Uniform API key.
  8. Note the value for the project My Site Project. This is your Uniform project ID.
  9. Click Close.

Add integration

In order for Canvas to be able to read content from Sitecore, you must add and configure an integration in your Uniform project.

  1. In Uniform, click the logo in the top-left to return to the home page.

  2. Navigate to the project My Sitecore Project.

  3. Navigate to Settings > Integrations.

  4. Click Sitecore.

  5. Click Add Sitecore to this project.

  6. In the Sitecore configuration screen, enter the following values:

    • URL of your Sitecore instance: The URL to the root of the Sitecore instance. This must start with https:// (unless your Sitecore instance is running on http://localhost)
    • Sitecore API key: Your Sitecore API key or any GUID if you use Sitecore 8.2
    • Site configuration name: Your Sitecore site name
  7. Click Save.

    tip

    If you see an error message, your browser developer console is the best place to start troubleshooting because the request to Sitecore is a client-side request. Any errors will appear here.

    The most common cause of errors is Sitecore Services Client (SSC) being misconfigured:

    • Verify that SSC is configured correctly using /sitecore/admin/showconfig.aspx on your Sitecore instance.
    • Verify that the user account defined in Sitecore API key has read access rights to the item /sitecore/system/Uniform/Site Configurations/website.
    • Consult with SSC documentation.
    • Contact Sitecore support regarding SSC connectivity issues.