Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baroshem/nuxt-medusa
🛍️ Medusa module for Nuxt
https://github.com/baroshem/nuxt-medusa
ecommerce javascript medusa nuxt typescript vue
Last synced: 20 days ago
JSON representation
🛍️ Medusa module for Nuxt
- Host: GitHub
- URL: https://github.com/baroshem/nuxt-medusa
- Owner: Baroshem
- License: mit
- Created: 2023-02-23T07:18:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-14T19:08:33.000Z (5 months ago)
- Last Synced: 2024-10-10T16:41:49.046Z (about 1 month ago)
- Topics: ecommerce, javascript, medusa, nuxt, typescript, vue
- Language: TypeScript
- Homepage: https://nuxt-medusa.vercel.app
- Size: 823 KB
- Stars: 132
- Watchers: 2
- Forks: 10
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Nuxt Medusa
[![nuxt-medusa](./docs/public/cover.jpeg)](https://nuxt-medusa.vercel.app)
[![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/baroshem/nuxt-medusa?file=.stackblitz%2Fnuxt.config.ts)
- [đź“– Â Documentation](https://nuxt-medusa.vercel.app)
- [🎥  Intro video](https://www.youtube.com/watch?v=EuakPz8M7CM)
- [✨  Release Notes](https://github.com/baroshem/nuxt-medusa/releases)## Features
- Nuxt 3 ready
- Wrapper around `@medusajs/medusa-js`
- Handy composables like `useMedusaClient`
- Usage in API server routes with `serverMedusaClient`
- TypeScript support## Quick Setup
1. Add `nuxt-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.products.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/nuxt-medusa/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/nuxt-medusa[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-medusa.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/nuxt-medusa[license-src]: https://img.shields.io/npm/l/nuxt-medusa.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://npmjs.com/package/nuxt-medusa