1

We've got a Sitecore headless project using NextJS. I've setup an rss feed using the OOTB Sitecore RSS functionality and it seems to be generating the correct xml when I view it through EE or preview.

The issue we have is that our front end is a JSS application using NextJs. If I navigate to the rss url using the front end it just renders a blank page. My initial thought was a rewrite to the backend url in the NextJS application but that returns a not found 302 error.

Is there a simple way (something built in to JSS?) to have the rss feeds be visible from the front end in a JSS NextJS application?

3
  • Generally speaking, sitemap generation should be helpful in figuring this out: sitecore.stackexchange.com/search?q=sitemap+nextjs. Please confirm if you are using SXA? Nov 8, 2023 at 23:32
  • Please also confirm if you are using SSG. Nov 8, 2023 at 23:40
  • Thanks, I'll look into sitemap, should have thought of that. We aren't using SXA and are using SSG for all pages by default, but do have some other routes on SSR. Nov 8, 2023 at 23:46

2 Answers 2

1

The OOTB RSS feed functionality is MVC only. It is not supported in headless JSS. If you want an RSS feed, you need to implement the functionality yourself in the head application.

0

There is a simple way: given some URL path to an existing MVC RSS feed, the idea would be for your head to fetch the RSS response from Sitecore behind the scenes and return that as the response.

There are numerous approaches:

  1. If you have a reverse proxy in front of Sitecore and your head application, you can route requests to specific paths directly to Sitecore. In the case of a head hosted on Vercel, that would be your Middleware.
  2. Use the NextJS API as wrapper to fetch the content of the RSS endpoint.
  3. You can also look into adding a page under /pages or modifying the [[...path]].ts slug file.

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.