More Premium Hugo Themes Premium Nuxt Themes

Medusa

Medusa module for Nuxt

Medusa

Medusa module for Nuxt

Author Avatar Theme by nuxt-modules
Github Stars Github Stars: 168
Last Commit Last Commit: Mar 4, 2025 -
First Commit Created: Feb 6, 2025 -
default image

Overview

Nuxt Medusa is a module for Nuxt that serves as a wrapper around @medusajs/js-sdk, providing convenient features like useMedusaClient and allowing for usage in API server routes with serverMedusaClient. It is Nuxt 3 ready and supports TypeScript.

Features

  • Nuxt 3 ready: Compatible with the latest version of Nuxt.
  • Wrapper around @medusajs/js-sdk: Provides a convenient wrapper for the Medusa JavaScript SDK.
  • Handy composables: Includes useful composables like useMedusaClient for easier integration.
  • Usage in API server routes: Allows for usage in API server routes with serverMedusaClient.
  • TypeScript support: Supports TypeScript for more robust development.

Installation

To install Nuxt Medusa, follow these steps:

  1. Add the @nuxtjs/medusa dependency to your project.
npm install @nuxtjs/medusa
  1. Create a .env file with the following MEDUSA_URL variable.
  2. Ensure the process.env.STORE_CORS in medusa-config.js file points to your local Nuxt project, especially if encountering CORS issues.
process.env.STORE_CORS = 'http://localhost:3000';
  1. You can now fetch data from Medusa in Nuxt.

Summary

Nuxt Medusa is a useful module for Nuxt that simplifies interaction with the Medusa JavaScript SDK. With features like handy composables and support for TypeScript, it provides an easy way to integrate Medusa into your Nuxt project. The quick setup process makes it convenient to get started and use Medusa for fetching data seamlessly.