Skip to main content

Nuxt Integration

Nuxt is a Vue.js based framework for building server-side rendered (SSR) web applications. It provides developers with a streamlined development experience and a set of powerful tools for building modern web applications. With Nuxt, developers can easily create dynamic, scalable, and high-performance applications that can run both on the client and the server.

One of the main benefits of Nuxt is its ability to improve the performance and SEO of web applications. By generating static HTML files at build time and serving them from a CDN, Nuxt can greatly improve the time-to-first-byte (TTFB) of web applications, resulting in faster load times and better search engine rankings. Additionally, Nuxt provides built-in support for various features such as routing, server-side rendering, and asynchronous data loading, which can help developers to create more robust and maintainable applications.

info

This guide assumes Nuxt 3 or higher, it may work with older versions but it hasn't been tested on older versions.

Integrating the SDK

Following on from the [Getting Started] guide there are several steps we need to take now that we have the SDK installed.

  • Create several API routes that use the withWineSessionMiddleware middleware to handle various steps of the Authorization Flow
  • Add some Register, Login and Logout links to the navigation
  • Add a fetch in a page inside a <script setup> block to fetch data from the WithWine API
  • Add Nuxt specific configuration to the withwine.config.json file (what we add or if we add it at all will depend on which way we decide to implement API Route Redirects)
  • Augment nuxt.config.js with the custom configuration