### Getting Started: Install Uniform Connector Source: https://docs.uniform.dev/sitecore/whats-new/docs Instructions for installing the Uniform Connector. This is a crucial step in the 'Getting Started' guide for integrating Uniform with your project. ```bash # Example installation command using npm npm install @uniformdev/cli @uniformdev/connector ``` -------------------------------- ### Getting Started: Jamstack for Sitecore MVC Tutorial Source: https://docs.uniform.dev/sitecore/whats-new/docs Tutorial for setting up Jamstack with Sitecore MVC. This guide is part of the 'Getting Started' section. ```csharp // Example C# code for Sitecore MVC integration (details omitted as per source) // This would involve MVC specific configurations and Sitecore integration points. ``` -------------------------------- ### Getting Started: Jamstack for Sitecore JSS (Next.js) Tutorial Source: https://docs.uniform.dev/sitecore/whats-new/docs Tutorial for setting up Jamstack with Sitecore JSS using Next.js. This guide is part of the 'Getting Started' section. ```javascript // Example Next.js code for Sitecore JSS integration (details omitted as per source) // This would involve Next.js specific configurations and Sitecore JSS components. ``` -------------------------------- ### How to Run Custom Deployment Commands Source: https://docs.uniform.dev/sitecore/whats-new/docs This guide explains how to run custom deployment commands. It is part of the 'How to guides' for deployment. ```bash # Example of running a custom deployment script ./scripts/deploy.sh ``` -------------------------------- ### How to Serve Dynamic Content from Sitecore Source: https://docs.uniform.dev/sitecore/whats-new/docs This guide explains how to serve dynamic content from Sitecore. It is part of the 'How to guides' for deployment. ```csharp // Example C# code snippet for Sitecore integration (details omitted as per source) // This would typically involve Sitecore APIs for content retrieval. ``` -------------------------------- ### How to Create a Site Configuration Source: https://docs.uniform.dev/sitecore/whats-new/docs Guide on how to create a site configuration. This is a fundamental step in setting up Uniform for a project. ```json { "site": { "name": "my-new-site", "baseUrl": "https://example.com" } } ``` -------------------------------- ### Start Docker Application with Compose Source: https://docs.uniform.dev/sitecore/optimize/getting-started/cdn/akamai/local-dev-environment Execute this command to start the entire Docker application, including all configured containers, using Docker Compose. ```bash .\Compose.ps1 ``` -------------------------------- ### Start Next.js Development Server Source: https://docs.uniform.dev/sitecore/deploy/getting-started/sitecore-jss-nextjs-tutorial Run this command to start the Next.js development server. This enables hot reloading for instant feedback on code changes. ```bash npm run dev ``` -------------------------------- ### How to Deploy to Cloudflare Workers (Development) Source: https://docs.uniform.dev/sitecore/whats-new/docs This guide provides instructions for deploying to Cloudflare Workers in a development environment. It is part of the 'How to guides' for deployment. ```bash # Example development command (specifics may vary) wrangler dev ``` -------------------------------- ### Start Uniform Service Source: https://docs.uniform.dev/sitecore/deploy/how-tos/how-to-deploy-to-akamai-netstorage Run this command in the terminal from your Uniform service's root folder to start the service. ```bash npm run start ``` -------------------------------- ### Install Sitecore JSS CLI Source: https://docs.uniform.dev/sitecore/deploy/getting-started/sitecore-jss-nextjs-tutorial Installs the Sitecore JSS CLI globally. Recommended for managing Sitecore JSS projects. ```bash npm i @sitecore-jss/sitecore-jss-cli -g ``` -------------------------------- ### How to Deploy to Cloudflare Workers (Production) Source: https://docs.uniform.dev/sitecore/whats-new/docs This guide provides instructions for deploying to Cloudflare Workers in a production environment. It is part of the 'How to guides' for deployment. ```bash # Example deployment command (specifics may vary) wrangler publish ``` -------------------------------- ### Example Sitecore Campaign Query String Source: https://docs.uniform.dev/sitecore/optimize/reference/tracking/configuration An example of a Sitecore campaign query string parameter that can be added to a URL for tracking. ```text sc_camp=5704C80F7DD3491393C9B2AF1D485801 ``` -------------------------------- ### Azure Storage Connection Details Example Source: https://docs.uniform.dev/sitecore/deploy/how-tos/how-to-configure-media-sync-azure Example format for Azure Storage connection details including container name, connection string, and primary endpoint. ```text container name: your_container_nameconnection string: DefaultEndpointsProtocol=https;AccountName=mvcsitedemoaccount;AccountKey=xndvf_some_letters_and_numbers_Wia6CA==;EndpointSuffix=core.windows.netprimary endpoint: https://mvcsitedemoaccount.z6.web.core.windows.net/ ``` -------------------------------- ### Install react-jotform-embed Source: https://docs.uniform.dev/sitecore/deploy/how-tos/how-to-setup-sitecore-forms Install the Jotform embed package for React applications. Use '--legacy-peer-deps' if encountering peer dependency issues. ```bash npm install react-jotform-embed --legacy-peer-deps ``` -------------------------------- ### Filter Configuration Example Source: https://docs.uniform.dev/sitecore/optimize/reference/integration/sitecore-xdb/historical-data An example of how to configure filters in Sitecore XML configuration to specify which historical data to expose. ```APIDOC ## Filter Configuration Filters are configured in Sitecore config under `uniform > xdb > activity > filters` to determine which data from Sitecore Xdb to expose. ### Example Filter Structure ```xml {6EE47820-3747-4BA8-88BE-4E9BDA8F22EC} {968897F1-328A-489D-88E8-BE78F4370958} {8FFB183B-DA1A-4C74-8F3A-9729E9FCFF6A} {5E31CCE2-78F7-4C16-83E2-E701B7B14AD5} ``` ### Site Selectors Filters can specify which Sitecore sites to read data from. #### Include all sites ```xml ``` #### Include sites by name ```xml ``` #### Include sites using wildcards ```xml ``` ``` -------------------------------- ### How to Track Custom Visit Activity Source: https://docs.uniform.dev/sitecore/whats-new/docs This guide provides instructions on how to track custom visit activity using the Uniform tracker. It includes examples of using tracker event handlers in MVC sites. ```javascript import { Tracker } from "@uniformdev/tracker"; const tracker = new Tracker({ projectId: "YOUR_PROJECT_ID", }); // Example of tracking a custom event: tracker.track('customEvent', { detail: 'some value' }); ``` -------------------------------- ### How to Configure Multilingual Sites Source: https://docs.uniform.dev/sitecore/whats-new/docs Guide on configuring multilingual sites. This includes details on site configurations and adjusting FetchHost. ```json { "site": { "name": "mysite", "hostName": "localhost", "language": "en" } } ``` -------------------------------- ### Render Service Example URIs Source: https://docs.uniform.dev/sitecore/deploy/reference/api-reference Examples of URIs for the Render Service, showing requests with and without additional query parameters like 'uniform_datasource'. ```http https:///uniform/api/content/website/render/ff024edd-44fb-42ef-9ecd-1e8daf706386/a7ab411c-f894-4142-b069-48ef67431d36?token=12345 ``` ```http https:///uniform/api/content/website/render/ff024edd-44fb-42ef-9ecd-1e8daf706386/a7ab411c-f894-4142-b069-48ef67431d36?token=12345&uniform_datasource=f39aa710-4231-45f8-a075-975bb41099a7 ``` -------------------------------- ### Akamai Purge Service Configuration Example Source: https://docs.uniform.dev/sitecore/optimize/getting-started/cdn/akamai/cache-purge Example of an Akamai API URL for cache purging. Ensure you prepend 'https://' to the provided host value. ```text https://akab-0000000000000000-0000000000000000.luna.akamaiapis.net ``` -------------------------------- ### Start Docker Registry Container Source: https://docs.uniform.dev/sitecore/optimize/getting-started/cdn/akamai/local-dev-environment Starts a Docker container to host a Docker image registry on port 6000. Adjust the port if it's already in use. ```bash docker run -d -p 6000:6000 --name registry registry:2 ``` -------------------------------- ### Multilingual Site Configurations Example Source: https://docs.uniform.dev/sitecore/deploy/how-tos/how-to-create-site-configuration Define multiple Site Configurations for the same Sitecore site definition to support different content languages. ```xml ``` -------------------------------- ### How to Adjust FetchHost Source: https://docs.uniform.dev/sitecore/whats-new/docs Instructions on how to adjust the FetchHost setting for site configurations, relevant for multilingual site setups. ```json { "site": { "name": "mysite", "fetchHost": "api.example.com" } } ``` -------------------------------- ### Map Service Configuration with Include/Exclude Rules Source: https://docs.uniform.dev/sitecore/deploy/reference/api-reference Example configuration for the Map Service, demonstrating how to define include and exclude rules using item IDs. ```xml ``` -------------------------------- ### Sitecore MVC Tutorial Error Example Source: https://docs.uniform.dev/sitecore/deploy/getting-started/sitecore-mvc-tutorial This is an example of a connection error that may occur if certificate validation fails when connecting to a Sitecore instance over HTTPS with a self-signed certificate. ```json { "message": "reason: unable to verify the first certificate", "type": "system", "errno": "UNABLE_TO_VERIFY_LEAF_SIGNATURE", "code": "UNABLE_TO_VERIFY_LEAF_SIGNATURE" } ``` -------------------------------- ### Sitecore Interaction as Uniform Visit Source: https://docs.uniform.dev/sitecore/optimize/reference/integration/sitecore-xdb/historical-data Example of a Sitecore interaction exposed as a Uniform visit, showing core interaction properties. ```json { "id": "2f840848-3287-43e8-9f03-49aec64822ee", "visitorId": "4f59ebcc-f921-4c8d-a296-85565c1db8e0", "start": "2020-01-02T08:00:00.000Z", "end": "2020-01-02T8:15:00.000Z", "updated": "2020-01-02T8:15:00.000Z", "data": {} } ``` -------------------------------- ### How to Migrate from MVC to React Source: https://docs.uniform.dev/sitecore/whats-new/docs Guide on migrating a project from an MVC architecture to a React-based frontend. This is part of the 'How To's' for deployment. ```javascript // Example React code snippet (details omitted as per source) // This would involve setting up React components and potentially a new routing strategy. ``` -------------------------------- ### Run Sitecore JSS Next.js SSR Server Source: https://docs.uniform.dev/sitecore/deploy/getting-started/sitecore-jss-nextjs-tutorial Build the application and start the SSR server for previewing or troubleshooting. This command runs both build and start-server. ```bash npm run build npm run start-server ``` ```bash npm start ``` -------------------------------- ### Handle Invalid GUIDs in XML Configuration Source: https://docs.uniform.dev/sitecore/optimize/how-tos/integration/sitecore-xdb/historical-data When an invalid GUID is specified for a template ID in the historical data service configuration, Uniform will log an error and ignore the invalid entry. This example shows the configuration with an invalid ID and the resulting log message. ```xml xxxx ``` ```log 14260 07:00:00 ERROR == UNIFORM == HistoricalDataSettings - The specified value is not a valid guid. (value: xxxx) ``` ```xml ``` -------------------------------- ### Clone Starter Repo Source: https://docs.uniform.dev/sitecore/deploy/getting-started/sitecore-mvc-tutorial Clone the starter repository to begin setting up your Sitecore MVC site with Next.js. ```bash git clone https://github.com/uniformdev/sitecore-mvc-nextjs-starterkit ``` -------------------------------- ### Sitecore 'Attempt by method' Server Error Source: https://docs.uniform.dev/sitecore/whats-new/upgrade-guide This server error typically arises during the installation of the Uniform package. It suggests a configuration issue during the service collection setup. ```text Attempt by method 'Uniform.UpmSscServiceConfigurator.Configure(Microsoft.Extensions.DependencyInjection.IServiceCollection)' to access method 'Uniform.Assert.ArgumentNotNull(System.Object, System.String)' failed. ``` -------------------------------- ### Programmatic Akamai Cache Purge Source: https://docs.uniform.dev/sitecore/optimize/how-tos/cdn/akamai/cache-purge Trigger Akamai cache purge operations using the Uniform API. This example demonstrates how to get dependent pages for an item and then send a purge command. ```csharp //Get an item from somewhere...Sitecore.Data.Items.Item item = null; //Get the home item for the site.var homeItem = Sitecore.Context.Site.GetHomeItem(Sitecore.Context.Database); //Get the dependent pages for the item.var args = new Uniform.Pipelines.GetDependentPages.GetDependentPagesArgs(item, homeItem); Uniform.Pipelines.GetDependentPages.GetDependentPagesPipeline.Run(args); //Get the item ids for the dependent pages.var itemIds = args.DependentPages.Select(i => i.ID); //Get the component that sends cache purge commands to Akamai.var provider = new Uniform.Cache.AkamaiCacheProvider(); //Send the cache purge command.var args2 = new Uniform.Cache.PurgeArgs("my-site", Sitecore.Context.Database, itemIds); var results = provider.Purge(args2); ``` -------------------------------- ### How to Deploy to Netlify Source: https://docs.uniform.dev/sitecore/whats-new/docs Instructions for deploying your project to Netlify. This is part of the 'How To's' for deployment. ```bash # Example Netlify deployment command (details omitted as per source) # This might involve Netlify CLI or CI/CD configurations. ``` -------------------------------- ### Complete .env File Configuration Source: https://docs.uniform.dev/sitecore/deploy/getting-started/sitecore-mvc-tutorial This example shows a complete .env file including settings for Sitecore connection and handling self-signed certificates for HTTPS connections. Ensure these are correctly configured for your environment. ```env # the Sitecore endpoint where Uniform Connector is installed and configuredUNIFORM_API_URL=http://your-sitecore-host# the value of the Uniform.API.Token setting specified in Sitecore config file.UNIFORM_API_TOKEN=12345#if you are running on https, this variable is also needed, otherwise you'll receive "Unable to verify leaf-signature" errors:NODE_TLS_REJECT_UNAUTHORIZED=0 ``` -------------------------------- ### Clone Starter Repository Source: https://docs.uniform.dev/sitecore/deploy/getting-started/sitecore-jss-nextjs-tutorial Clones the Sitecore JSS Next.js starter kit repository from GitHub. ```bash git clone https://github.com/uniformdev/sitecore-jss-nextjs-starterkit ``` -------------------------------- ### How to Configure Preview on Netlify Source: https://docs.uniform.dev/sitecore/whats-new/docs Instructions for configuring preview deployments on Netlify. This is part of the 'How To's' for deployment. ```bash # Example Netlify configuration for preview deployments (details omitted as per source) # This might involve netlify.toml settings or environment variables. ``` -------------------------------- ### Serve Static Exported Site Source: https://docs.uniform.dev/sitecore/deploy/getting-started/sitecore-mvc-tutorial Use 'npx serve out' to start a static file server on the '/out' folder. This command serves the statically exported content from localhost:5000, allowing you to preview the deployed site. ```bash npx serve out ``` -------------------------------- ### Enable Static Website Hosting Source: https://docs.uniform.dev/sitecore/deploy/how-tos/how-to-deploy-to-azure-blob-storage Enables static website hosting on your storage account, specifying the index and 404 documents. ```bash az storage blob service-properties update --account-name --static-website --404-document 404/index.html --index-document index.html ``` -------------------------------- ### Uniform Map API Response Example Source: https://docs.uniform.dev/sitecore/deploy/getting-started/sitecore-jss-nextjs-tutorial Example JSON response from the Uniform Map API, indicating page structure and metadata. ```json { "isPage":true, "lastModified":"2021-02-19T17:21:56", "children":{ "about":{ "isPage":true, "lastModified":"2021-02-19T17:10:30", "children":{ }, "name":"About", "id":"f9e9b998-3fcc-4a2d-905e-fa2a35091d8e", "template":"Page" } }, "name":"Home", "id":"041c8a04-1760-42a2-81a3-53ca4ae1f705", "template":"Page"} ``` -------------------------------- ### Configure CORS for GET Requests Source: https://docs.uniform.dev/sitecore/deploy/how-tos/how-to-deploy-to-azure-blob-storage Adds CORS support to the storage account, allowing GET requests from any origin. This is necessary for web access. ```bash az storage cors add --account-name --services b --methods GET --origins '*' ``` -------------------------------- ### How to Configure FullDeploymentRules (v4.0.1 only) Source: https://docs.uniform.dev/sitecore/whats-new/docs Instructions for configuring FullDeploymentRules, specific to version 4.0.1. This is part of the 'How To's' for deployment. ```json { "deploymentRules": { "full": true } } ``` -------------------------------- ### How to Deploy to Azure Blob Storage Source: https://docs.uniform.dev/sitecore/whats-new/docs Instructions for deploying your project artifacts to Azure Blob Storage. This is part of the 'How To's' for deployment. ```bash # Example command for uploading to Azure Blob Storage (details omitted as per source) # This might use Azure CLI or SDKs. ``` -------------------------------- ### Custom publish command execution log Source: https://docs.uniform.dev/sitecore/deploy/how-tos/how-to-run-custom-deployment-commands This log excerpt shows the Uniform service initializing the CustomPublishProvider and executing the configured custom command. It highlights how the `__DIR__` variable is replaced with the actual temporary directory path during deployment. ```log 07/02-12:26:31 info: Initializing CustomPublishProvider 07/02-12:26:31 info: Initializing CustomPublishProvider with command: npx ncp __DIR__ out && echo "Deployed successfully" ``` ```log 07/02-12:26:47 info: Deploying C:\...\jss-site-next\.temp\h (CustomPublishProvider) ``` -------------------------------- ### Page Service Example URIs Source: https://docs.uniform.dev/sitecore/deploy/reference/api-reference Examples of URIs for the Page Service, demonstrating requests for the 'Home' page and a 'Contact Us' page using its path or item ID. ```http https:///uniform/api/content/website/page ``` ```http https:///uniform/api/content/website/page/contact-us ``` ```http https:///uniform/api/content/website/page/{A2ECFDD7-7380-4252-BF21-F002DF3A8C46} ``` -------------------------------- ### Configure Site Configurations for Multilingual Sites Source: https://docs.uniform.dev/sitecore/deploy/how-tos/how-to-configure-multilingual-sites Define separate site configurations for each language, specifying deployment service URLs and environment variables like the site name and storage connection strings. This example shows configurations for 'habitat-en-ca' and 'habitat-en-fr'. ```xml http://localhost:3000 habitat-en-ca ... CONNECTION_STRING_FOR_EN-CA_SITE http://localhost:3000 habitat-en-fr ... CONNECTION_STRING_FOR_EN-FR_SITE ``` -------------------------------- ### How to Configure Incremental Content Sync Source: https://docs.uniform.dev/sitecore/whats-new/docs Instructions for configuring Incremental Content Sync. This is part of the 'How To's' for deployment. ```json { "sync": { "incremental": true, "strategy": "content" } } ``` -------------------------------- ### Filter Single Campaign with Start Date Source: https://docs.uniform.dev/sitecore/optimize/reference/integration/sitecore-xdb/historical-data Retrieve interactions for a specific campaign that started on or after a specified date. The date format must be a supported .NET format specifier. ```xml {6EE47820-3747-4BA8-88BE-4E9BDA8F22EC} ``` -------------------------------- ### Install Cloudflare Wrangler CLI Source: https://docs.uniform.dev/sitecore/optimize/getting-started/cdn/cloudflare/site-configuration Install the Cloudflare Wrangler CLI globally using npm to manage Cloudflare Workers. This command also logs you into your Cloudflare account. ```bash npm install @cloudflare/wrangler -g wrangler login ``` -------------------------------- ### How to Add a Deployment Service to a Site Configuration Source: https://docs.uniform.dev/sitecore/whats-new/docs Instructions on adding a deployment service to an existing site configuration. This links your site to a specific deployment provider. ```json { "site": { "name": "my-site", "deploymentService": { "provider": "netlify", "url": "https://api.netlify.com/api/v1/sites" } } } ``` -------------------------------- ### Filter Page Events with Start and End Dates Source: https://docs.uniform.dev/sitecore/optimize/reference/integration/sitecore-xdb/historical-data Retrieve page events that started on or after a specific date and ended on or before another date. Page events are configured under the 'events' section. ```xml {9775F496-295D-4D9D-B2E2-C6742FE8EC09} ``` -------------------------------- ### Example Edge Context Debug Script Block Source: https://docs.uniform.dev/sitecore/optimize/reference/personalization/edge/context This is an example of the script block generated when Edge Context debug mode is enabled in an MVC view. It contains JSON with context variables. ```html ``` -------------------------------- ### Configure Full Deployment Rules in Sitecore Source: https://docs.uniform.dev/sitecore/deploy/how-tos/how-to-configure-incremental-static-site-generation Add full deployment rules to your site configuration to trigger static site generation when specific items are modified. This example shows how to include an Item ID rule. ```xml ... ``` -------------------------------- ### ESI Conditional Logic Example Source: https://docs.uniform.dev/sitecore/optimize/reference/personalization/edge/personalization-logic This example shows a basic conditional statement in ESI language. It compares the value retrieved from the ESI_CONTEXT_personalization_rules dictionary for a specific rendering ID against a rule ID. ```esi $(ESI_CONTEXT_personalization_rules{'RENDERING ID'})=='RULE ID' ``` -------------------------------- ### Filter Page Views by Item/Template and Start Date Source: https://docs.uniform.dev/sitecore/optimize/reference/integration/sitecore-xdb/historical-data Retrieve page views for a specific item or template, starting from a specified date. This allows for targeted retrieval of historical page view data. ```xml {C7A0E9A5-F64E-4614-AAD1-9B1B87C1EFC0} {C7A0E9A5-F64E-4614-AAD1-9B1B87C1EFC0} ``` -------------------------------- ### Navigate to Worker Directory and Install Uniform ESI Package Source: https://docs.uniform.dev/sitecore/optimize/getting-started/cdn/cloudflare/site-configuration Change into the newly created worker directory and install the Uniform ESI package for Cloudflare. This package provides Edge Side Includes functionality for the worker. ```bash cd my-worker npm i @uniformdev/esi-edge-cloudflare ``` -------------------------------- ### Configure .env for Sitecore Connection Source: https://docs.uniform.dev/sitecore/deploy/getting-started/sitecore-mvc-tutorial Set up the .env file with connection details for your Sitecore instance and Uniform Connector. Ensure UNIFORM_API_URL and UNIFORM_API_TOKEN are correctly set. ```env # the Sitecore endpoint where Uniform Connector is installed and configuredUNIFORM_API_URL=http://your-sitecore-host# the value of the Uniform.API.Token setting specified in Sitecore config file.UNIFORM_API_TOKEN=12345 ``` -------------------------------- ### Get Sitecore Context Source: https://docs.uniform.dev/sitecore/optimize/getting-started/front-end/jss/react/optimize-only Retrieve the Sitecore context within your layout component before returning its JSX. ```javascript const { sitecoreContext } = useSitecoreContext(); ``` -------------------------------- ### Create Azure App Service Plan Source: https://docs.uniform.dev/sitecore/deploy/how-tos/how-to-host-static-export-service-in-azure-devops Create a Linux-based App Service plan for hosting your web application. The SKU 'B1' is used here, but can be adjusted based on performance and cost requirements. ```bash az appservice plan create --name UniformAppServicePlan --resource-group UniformResources --is-linux --sku B1 ``` -------------------------------- ### How to Control Next.js Threads Source: https://docs.uniform.dev/sitecore/whats-new/docs Guide on controlling Next.js threads during deployment. This is part of the 'How To's' for deployment. ```javascript // Example configuration for controlling Next.js threads (details omitted as per source) // This might involve environment variables or build script configurations. ``` -------------------------------- ### Fetch Host Debug Log Source: https://docs.uniform.dev/sitecore/deploy/how-tos/how-to-create-site-configuration Example of a debug log message showing the URI being fetched by the Page Service. ```log INFO == UNIFORM == Fetching URI: http://mvc-sc.unfrm.space/uniform/api/content/mvcsite/map?uniform_token=12345 ```