Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nuxt-modules/medusa
🛍️ Medusa module for Nuxt
https://github.com/nuxt-modules/medusa
ecommerce javascript medusa nuxt typescript vue
Last synced: 5 days ago
JSON representation
🛍️ Medusa module for Nuxt
- Host: GitHub
- URL: https://github.com/nuxt-modules/medusa
- Owner: nuxt-modules
- License: mit
- Created: 2023-02-23T07:18:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-22T04:47:42.000Z (about 1 month ago)
- Last Synced: 2025-02-09T14:13:39.191Z (12 days ago)
- Topics: ecommerce, javascript, medusa, nuxt, typescript, vue
- Language: TypeScript
- Homepage: https://nuxt-medusa.vercel.app
- Size: 2.47 MB
- Stars: 157
- Watchers: 2
- Forks: 12
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Nuxt Medusa
[](https://medusa.nuxtjs.org)
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href][Medusa](https://medusajs.com) module for Nuxt.
- [▶️  Play online](https://stackblitz.com/github/nuxt-modules/medusa?file=.stackblitz%2Fnuxt.config.ts)
- [đź“– Â Documentation](https://medusa.nuxtjs.org)
- [🎥  Intro video](https://www.youtube.com/watch?v=EuakPz8M7CM)
- [✨  Release Notes](https://github.com/nuxt-modules/medusa/releases)## 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 `@nuxtjs/medusa` dependency to your project
```bash
npx nuxi@latest module add medusa
```2. Create .env file with following `MEDUSA_URL` variable:
```bash
MEDUSA_URL= # By default http://localhost:9000
```And that's it! You can now fetch data from Medusa in Nuxt ✨
```vue
const client = useMedusaClient();
const { products } = await client.store.product.list();```
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
```bash
# 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
```[npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/medusa/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/@nuxtjs/medusa[npm-downloads-src]: https://img.shields.io/npm/dm/@nuxtjs/medusa.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/medusa[license-src]: https://img.shields.io/npm/l/@nuxtjs/medusa.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://npmjs.com/package/@nuxtjs/medusa