1

Can we implement the API only mode in JSS with a plain react application.? or do we need to have react app created through the JSS.

Also trying to see a sample app or steps to do the API only mode but i don't fidn anything in the documentation https://jss.sitecore.net/

It would be helpful if someone guide on this..

Thank in advance..

1 Answer 1

4

Using API-only mode does not require usage of any of the JSS npm packages. In API-only mode, your app is interacting directly with one or more of the Sitecore headless APIs, e.g. Layout Service, GraphQL, etc... For instance, if you want data from Layout Service, you would use the xhr/fetch client of choice and make requests directly to the Layout Service endpoint.

That said, if you are consuming Layout Service data in your React app, you'll likely find a lot of value in using the @sitecore-jss/sitecore-jss-react package, specifically the Placeholder component and the field helper components, e.g. Image, Text, etc... All of those components are designed to help render Layout Service data and reduce boilerplate code in your own app.

There are setup steps outlined for API-only mode here: https://jss.sitecore.net/docs/fundamentals/application-modes#api-only-mode

4
  • Thank You Adam.. Hope API only mode doesn't support the Experience Editor by default, Is there a work-around to enable this in API mode.? Commented Nov 2, 2018 at 17:08
  • 1
    Unfortunately no. Experience Editor requires server-side rendering of your app in order to function properly.
    – Adam Weber
    Commented Nov 2, 2018 at 17:17
  • Thank You Adam for your quick response.. if we use SSR mode then Experience Editor works.? Because i guess that i have seen somewhere that the Experience Editor works only with the integration mode. Commented Nov 5, 2018 at 21:03
  • 2
    Experience Editor only works in Integrated mode because Experience Editor is a Sitecore application that requires a Sitecore instance. Experience Editor does not work in Headless SSR (proxy) mode.
    – Adam Weber
    Commented Nov 6, 2018 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.