nuxt-medusa

Medusa module for Nuxt
4,034
Install
npm install nuxt-medusa
Latest Version:1.0.0
Vue:3
License:MIT
Last Updated:Nov 25, 2024
Links: npm
Maintainer: baroshem

Nuxt Medusa

npm version npm downloads License

Medusa module for Nuxt.

Features

  • Nuxt 3 ready
  • Wrapper around @medusajs/js-sdk
  • Handy composables like useMedusaClient
  • Usage in API server routes with serverMedusaClient
  • TypeScript support

Quick Setup

  1. Add nuxt-medusa dependency to your project
npx nuxi@latest module add medusa
  1. Create .env file with following MEDUSA_URL variable:
MEDUSA_URL=<YOUR_MEDUSA_URL> # By default http://localhost:9000

And that's it! You can now fetch data from Medusa in Nuxt ✨

<script setup lang="ts">
  const client = useMedusaClient();
  const { products } = await client.store.product.list();
</script>

If you are encountering problems with CORS from Medusa, make sure that process.env.STORE_CORS in medusa-config.js file is pointing to your local Nuxt project. By default, Medusa has CORS set for http://localhost:8000 while Nuxt is running by default on http://localhost:3000

Development

# Install dependencies
yarn

# Generate type stubs
yarn dev:prepare

# Develop with the playground
yarn dev

# Build the playground
yarn dev:build

# Run ESLint
yarn lint

# Run Vitest
yarn test
yarn test:watch

# Release new version
yarn release

Related Packages

@nuxtjs/medusa

Medusa module for Nuxt

6,000
nuxt-define

One utility function for module authors to define compiler constants for all bui...

13,412,511
@lg2/nuxt3-module-create-dato-map

nuxt3-module-create-dato-map

2,869 0
nuxt-csurf

Nuxt Cross-Site Request Forgery (CSRF) Prevention

6,263,746 91
@bg-dev/nuxt-naiveui

Unofficial Naive UI module for Nuxt

144,316 187

Version History

Version Released Vue License
1.0.0 ^3.0 MIT
0.5.0 ^3.0 MIT
0.4.0 ^3.0 MIT
0.3.4 ^3.0 MIT
0.3.3 ^3.0 MIT
Pre-releases (1)
Version Released Vue License
1.0.0-rc.1 ^3.0 MIT