Skip to main content

Add Uniform integration

Adding the Sitecore XM/XP integration to your Uniform project adds new parameter types that you can add to your Uniform Canvas components.

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.

Add integration

  1. In Uniform, open your project.

  2. Navigate to the Integrations tab.

  3. Scroll to the section Browse Integrations.

  4. Click Sitecore.

  5. Click Add to project.

    add-integration-to-project
  6. Enter the required values.

  7. Enter the required fields.

    FieldDescription
    URL of your Sitecore instanceThe URL to the root of the Sitecore instance. This must start with https:// (unless your Sitecore instance is running on http://localhost).
    Sitecore API keyYour Sitecore API key (or any GUID if you use Sitecore 8.2).
    Site configuration nameYour Sitecore site name. This is the name of the `site` defined in a Sitecore config file. (This value is not case-sensitive.)
    settings-page-initial
  8. Click Save.

Next steps

Explore the new parameter types that are available when you configure components using Uniform Canvas.