Based on the information provided in the extracts, you can use Next.js's getServerSideProps function to fetch data from your CMS server-side. However, please note that in the Edge Runtime, you do not have access to the response object. If you need access to the response object, you should continue to use the Node.js runtime, which is the default runtime. You can explicitly set the runtime on a per-page basis by modifying the config source (https://nextjs.org/docs/pages/building-your-application/data-fetching/get-server-side-props).
export const config = {
runtime: 'nodejs',
}
export const getServerSideProps = async () => {}
As for adding a class name to the <body> tag based on the response, you can do this in your custom _document.js file. However, please note that customizing renderPage is advanced and only needed for libraries like CSS-in-JS to support server-side rendering. This is not needed for built-in styled-jsx support source (https://nextjs.org/docs/pages/building-your-application/routing/custom-document).