Install Coveo for Sitecore JSS
Install Coveo for Sitecore JSS
Coveo will be sunsetting Coveo for Sitecore JSS in March 2023. Coveo for Sitecore JSS documentation will no longer be available after this date. We recommend Coveo for Sitecore JSS users migrate their search interfaces. The Coveo Atomic and Headless libraries let you use your preferred web application framework (for example, React, Angular, Vue.js) to build search interfaces. |
This article presents the contents of Coveo for Sitecore JSS and its installation instructions.
Coveo for Sitecore JSS consists of two parts, an NPM module and a Sitecore package (that is, the Coveo for Sitecore JSS Integration Package). The recommended version of Coveo for Sitecore to use alongside the JSS package is the March 26, 2021 release (5.0.943.3). You can find the link to download the Coveo for Sitecore JSS Integration Package in the installation instructions.
This article assumes that you’re aware of Coveo for Sitecore JSS limitations and the scope of support for Sitecore JSS. |
Integration Package Contents
The Coveo for Sitecore JSS Integration Package contains the following:
-
the
Coveo.JavascriptServices.dll
file -
the
Coveo.JavascriptServices.ImportProcessors.config
file -
the
Coveo JSS Contents Resolver
item -
Coveo Hive JSS
layout and template items
This package links imported Coveo components to a custom Coveo Rendering Contents Resolver, which uses the imported hiveDataSource
attribute to provide data to the JSS component.
Installation Instructions
-
Ensure you have already created a Sitecore JSS app. You will integrate Coveo for Sitecore JSS in your JSS app.
-
In Sitecore, open the Installation Wizard and install the Coveo for Sitecore December 2020 (or newer) release for a Sitecore 9.2 or 9.3 environment (see Install).
-
Using the Sitecore Installation Wizard, install the
Coveo.Jss.IntegrationPackage+1.X.X.XX.zip
file. -
In the Sitecore content tree, ensure that you’ve created an API key in the
/sitecore/system/Settings/Services/API Keys
folder.Notes-
The
/sitecore/system/Settings/Services/API Keys
folder is accessible in themaster
database. -
The key name can be whatever you want.
-
For testing purposes only, you can set
CORS Origin
andAllowedControllers
to*
. Keep in mind that you should never do this in a serious environment.
-
-
Ensure that you’ve configured your JSS app to link with your Sitecore instance.
Importing Coveo for Sitecore Jss Into Your Jss App
-
Ensure that you’re running at least version 12 of Node.js.
-
Run:
npm install coveoforsitecore-jss
-
Run:
npm install globalize@0.1.1
-
In your file system, in your JSS app folder, navigate to the
/sitecore/definitions/components/
folder. -
In this
/sitecore/definitions/components/
folder, create theCoveoForSitecore.sitecore.js
file. -
Using a text editor, add the following lines to the newly created
/sitecore/definitions/components/CoveoForSitecore.sitecore.js
file:import coveoforsitecore from "coveoforsitecore-jss/dist/manifest"; export default coveoforsitecore;
-
In the
scripts/generate-component-factory.js
file, after the first three require statements, add the following statement:const { coveoForSitecoreComponentFactory } = require("coveoforsitecore-jss/dist/componentFactory");
-
In the
scripts/generate-component-factory.js
file, immediately before thereturn /* eslint-disable */
line, add the following statement:coveoForSitecoreComponentFactory(imports, registrations);
-
In the
sitecore/definitions/config.js
file, after thebabelrc: false,
statement, add the following statement:ignore: [/node_modules\/(?!coveoforsitecore-jss)/]
What’s Next?
You’re now ready to configure your Coveo-powered search solution and to deploy your JSS app.