Angular JSS for SitecoreAI
The JSS single-page application (SPA) built with Angular is designed to be fully compatible with SitecoreAI, incorporating several key add-ons and features to streamline the development process and enable seamless integration.
Sitecore JSS Angular App for SitecoreAI is currently in public beta. If you encounter any issues or bugs, please submit a new issue in the JSS GitHub Repo.
The Angular SitecoreAI integration consists of two parts:
Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.
-
SitecoreAI Angular - simplifies connecting the application to SitecoreAI and integration with multiple composable Sitecore products. Provides out-of-the-box helper components.
-
XM Cloud Proxy - allows integration between SitecoreAI and JSS SPAs, and enables editing, personalization, and component A/B/n testing.
Features supported
-
Context ID - the
SITECORE_EDGE_CONTEXT_IDenvironment variable simplifies setting up and configuring SitecoreAI solutions. It's a unified identifier that maps to all your configured resources, such as content, sites, files, forms, and integration settings. -
SitecoreAI Pages editing integration - full integration with Pages - the dynamic visual page editor of SitecoreAI.
-
SitecoreAI proxy personalization - with embedded personalization and component A/B/n testing.
-
Forms support - consume and post SitecoreAI forms in JSS apps. Using Forms, marketers can create forms, collect data, and analyze form performance.
-
Internationalization (i18n).
Features not supported
-
Multisite.
-
The SitecoreAI Components Application.
-
BYOC components.
-
SXA sitemap, redirects, and error pages.
-
Sitecore Experience Editor.
Getting started
Development
When building and running your app in connected (development) mode the proxy application is not needed.
Execute the following commands:
The following features are not supported in development mode:
-
Personalization
-
Server-side rendering (SSR)
-
Editing
Production
To build and run in production mode, your Angular app must be installed in a directory parallel to your Node XM Cloud proxy.
Execute the following commands for your Angular app:
Then, for the proxy app:
For additional information on how to set up and run a SPA app in production mode against a SitecoreAI instance, check the spa-starters monorepo in the XM Cloud Foundation Starter Kit.
Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.
Environment variables
The following environment variables can be used to configure Angular apps. You can use the .env file located in the root of the app or set these directly in the environment, for example in containers.
|
Parameter |
Description |
|---|---|
|
|
Your SitecoreAI Proxy hostname is needed to build the app and execute the client-side requests against the proxy server. Default value |
|
|
Your SitecoreAI Proxy server path is needed to build the app. The build output will be copied to the XM Cloud Proxy application path. Default value |
|
|
The Context ID, which covers many system configurations, is required for connecting to the SitecoreAI back end. This is a SitecoreAI system environment variable. When the application runs on the XM Cloud editing host, this value is always set to the preview Context ID. |
|
|
The API key for |
|
|
The API hostname, needed to build the application. This should be used in combination with |
|
|
Your GraphQL Edge endpoint. This is optional. By default, the endpoint is calculated using the resolved Sitecore API hostname + the graphQLEndpointPath defined in your |
|
|
The name of your site. This variable overrides the |
|
|
The default language of your app. The default value is |
|
|
Optional. Debug level for the application. Set the DEBUG environment variable to |
Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.