episerver / cms-saas-vercel-demo

Complete demo site for Optimizely SaaS CMS, fully taking all content from Optimizely Graph
https://www.optimizely.com/get-started/
Other
11 stars 61 forks source link

SaaS starter project not connecting to DXP instance #27

Closed aligilanie closed 3 months ago

aligilanie commented 3 months ago

we would like to connect your FE starter project (https://github.com/remkoj/optimizely-saas-starter) to our Optimizely DXP instance. But the starter project is feching data from "/_cms/preview2" endpoint which is not available in default CMS.

Is there way how to connect the FE project to DXP? is the "_cms/preview2" some kind of special controller? Can it be integrated into standard Optimizely CMS?

Process: Command yarn opti-cms nextjs:create inside the FE project throws an error:

ApiError: Not Found
    at catchErrorCodes (D:\Projects\brj\local_tests\optimizely-saas-starter\node_modules\@remkoj\optimizely-cms-api\dist\client\core\request.js:243:15)
    at D:\Projects\brj\local_tests\optimizely-saas-starter\node_modules\@remkoj\optimizely-cms-api\dist\client\core\request.js:285:45
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  url: 'https://jscl01mstry1j01inte.dxcloud.episerver.net/_cms/preview2/contenttypes?pageIndex=0&pageSize=100',
  status: 404,
  statusText: 'Not Found',

where https://jscl01mstry1j01inte.dxcloud.episerver.net is our DXP version. See attachement file for screenshot.

Note: We have sandboxed SaaS CMS version and it works there. But we want this functionality to be available in our CMS too.

remkoj commented 3 months ago

This demo site follows the capabilities and configuration of SaaS CMS, which has some new features (such as VisualBuilder and APIs) ahead of PaaS CMS. Once these features are available for PaaS CMS, you may configure it to match the configuration of SaaS CMS.

The code for this command is available in this repository: https://github.com/remkoj/optimizely-dxp-clients - if you need this for PaaS CMS today, my recommendation is to fork this repository and create a version of the CMS-CLI that works with the ContentManagement and ContentDefinitions API, they are quite similar, but not the same as the SaaS CMS API.