Deploying a Next.js Store on SAP Commerce Cloud (Hybris)

Deliver a sub-second Next.js website on SAP Commerce Cloud (Hybris) with Layer0

Next.js is an open-source React-based isomorphic framework for SSR applications. To ensure blazingly-fast page loads, Next.js automatically splits code and dynamically generates the HTML every time a new request comes in with the use of a server. Key benefits of Next.js include: built-in server-side rendering, automatic code splitting, page caching and route prefetching, file-system routing, and CSS-in-JavaScript styling. 

SAP Commerce Cloud, formerly known as Hybris, is a highly customizable eCommerce platform with a robust content management system. The platform offers two proprietary frontends: Spartacus and Hybris B2C Accelerator theme. Hybris B2C Accelerator theme is a Responsive frontend solution, and Spartacus is a headless frontend solution. SAP Commerce's Spartacus is new, so there are few proof points in production. Moreover, Spartacus is geared specifically for the SAP Commerce Cloud platform, so you remain locked into the platform's ecosystem, and it does not support SSR out of the box. Unlike SAP Hybris, which is a Java based application that typically runs on a Java server like Tomcat, Spartacus SSR is Angular JavaScript that runs on Node.js. As a result, supporting SSR with Spartacus requires running and maintaining a Node.js servers.

SAP Commerce Cloud offers a REST based API called Omni Commerce Connect (OCC) that can be used to implement shopping, account management, checkout, and even administration flows in a  application. However, many enterprise  sites have significantly customized their controller logic and those customizations may need to be re-created in client side code or in the separate OCC controllers. This can add additional effort when migrating to an OCC based solution like Spartacus. Synthetic APIs can reduce this workload, which can be found on Layer0, along with AMP and SSR technology to optimize website speed for websites running on the platform.

Layer0 lets you deliver your Next.js storefront on SAP Commerce Cloud in sub-second speeds. The average website on Layer0 see median speeds of 320ms loads, as measured by Largest Contentful Paint (LCP). But Layer0 is much more than merely a website accelerator. It is a Jamstack platform for eCommerce. Layer0 makes websites faster for users and simpler for frontend developers. The platform was built specifically for large-scale, database-driven websites such as eCommerce and Travel and included the following benefits: 

  • Jamstack for eCommerce via pre and just-in-time rendering
  • Zero latency networking via prefetching of data from your product catalog APIs
  • An edge that can be configured natively in your Next.js app (CDN-as-JavaScript)
  • Edge rules that can be run locally, in pre-prod and production environments  
  • Automated, full-stack preview URLs from GitHub, GitLab, or Bitbucket with every new branch and push
  • Performant split tests at the edge and A/B tests that do not slow down the site, canary deploys, and personalization
  • Serverless JavaScript that is much easier and more reliable than AWS Lambda

With Layer0, your Next.js SAP Commerce Cloud store will run in sub-second speeds and your developers will be empowered to control edge caching and reduce rework using the various developer productivity tools that come with the platform. 

Check out Annie Selke, a SAP Commerce Cloud website on Layer0. This mid-sized retailer is outranking eCommerce giants like Amazon, Wayfair, and Williams-Sonoma for key phrases in the search engines on Layer0 with 300ms average page loads.

Layer0 is also a contributor to React Storefront (RSF), an open source PWA framework built on Next.js, which powers over billion dollars in eCommerce revenue across multiple big name brands. Beyond functionality provided by Next.js, such as server-side rendering, RSF adds the following benefits: Automatic AMP; eCommerce UI component library; Predictive prefetching and caching; Lazy hydration, instant back navigation, skeletons; CMS platform connectors; eCommerce platform connectors; Session & cart management

If you're currently using Next.js, use the this guide to deploy your Next.js application on Layer0 and get sub-second loads in as little as 1 hour of work. 

Deploy in minutes

Moovweb XDN works with all frontends
Deploy freeTakes 2 minutes