I thinks this is done simply with getServerSideProps() Official Docs. It's as simple as it says really: "If you export an async function called getServerSideProps from a page, Next.js will pre-render this page on each request using the data returned by getServerSideProps"