# gatsby-source-medusa

> Gatsby source plugin for building websites using Medusa Commerce as a data source

Latest version **0.1.5** (published 2024-07-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatsby-source-medusa
pnpm add gatsby-source-medusa
yarn add gatsby-source-medusa
bun add gatsby-source-medusa
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score; popular repo.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2024-07-18 |
| First published | 2021-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 4 |
| Unpacked size | 33.4 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 36827 |
| Author | Kasper Kristensen |
| Maintainers | sebrindom, oliverjuhl, kasperfk |
| Keywords | gatsby, gatsby-plugin, gatsby-source, gatsby-source-medusa, medusa, medusa-commerce |

## Links

- npm: https://www.npmjs.com/package/gatsby-source-medusa
- Repository: https://github.com/medusajs/medusa
- Homepage: https://github.com/medusajs/medusa#readme
- Issues: https://github.com/medusajs/medusa/issues
- npm.io page: https://npm.io/package/gatsby-source-medusa

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^0.24.0
- [gatsby-core-utils](https://npm.io/package/gatsby-core-utils.md) ^3.3.0
- [gatsby-plugin-image](https://npm.io/package/gatsby-plugin-image.md) ^2.3.0
- [gatsby-source-filesystem](https://npm.io/package/gatsby-source-filesystem.md) ^4.3.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.1.5 (latest) — 2024-07-18
- 0.1.5-snapshot-20240718083016 (snapshot) — 2024-07-18
- 0.1.5-next-20240430121402 (next) — 2024-04-30
- 0.1.4-beta-20230705211101 (beta) — 2023-07-05
- 0.1.1-product-import.0 (product-import) — 2022-08-23
- 0.0.0-klarna-shipping-fix-20220718161248 (klarna-shipping-fix) — 2022-07-18
- 0.1.1-nxt.129 (nxt) — 2022-07-11
- 0.1.1-fix-1749.225 (fix-1749) — 2022-06-29
- 0.0.50-dev.107 (dev) — 2022-03-18
- 0.0.46-qs-client.26 (qs-client) — 2022-02-01
- 0.1.5-snapshot-20240426112214 — 2024-04-26
- 0.1.5-next-20240108145510 — 2024-01-08
- 0.1.5-snapshot-20240108132634 — 2024-01-08
- 0.1.5-snapshot-20240108125919 — 2024-01-08
- 0.1.5-snapshot-20240108123637 — 2024-01-08
- … 99 more at https://npm.io/package/gatsby-source-medusa/versions

## README

<p align="center">
  <a href="https://www.medusajs.com">
    <img alt="Medusa" src="https://user-images.githubusercontent.com/7554214/129161578-19b83dc8-fac5-4520-bd48-53cba676edd2.png" width="100" />
  </a>
</p>
<h1 align="center">
  gatsby-source-medusa
</h1>
<p align="center">
Medusa is an open-source headless commerce engine that enables developers to create amazing digital commerce experiences. This is a Gatsby source plugin for building websites using Medusa as a data source.
</p>
<p align="center">
  <a href="https://github.com/medusajs/medusa/blob/master/LICENSE">
    <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Medusa is released under the MIT license." />
  </a>
  <a href="https://github.com/medusajs/medusa/blob/master/CONTRIBUTING.md">
    <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat" alt="PRs welcome!" />
  </a>
  <a href="https://discord.gg/xpCwq3Kfn8">
    <img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Discord Chat" />
  </a>
  <a href="https://twitter.com/intent/follow?screen_name=medusajs">
    <img src="https://img.shields.io/twitter/follow/medusajs.svg?label=Follow%20@medusajs" alt="Follow @medusajs" />
  </a>
</p>

## Note

We're not actively maintaining this repository. So, it may not work as expected with the latest versions of Medusa. Contributions are highly appreciated.**

## Quickstart

This takes you through the minimal steps to see your Medusa data in your Gatsby site's GraphiQL explorer.

### 1. Installation

Install the source plugin to your Gatsby project using your favorite package manager.

```shell
npm install gatsby-source-medusa
```

```shell
yarn add gatsby-source-medusa
```

### 2. Configuration

Add the plugin to your `gatsby-config.js`:

```js:title=gatsby-config.js
require("dotenv").config()

module.exports = {
  plugins: [
    {
      resolve: "gatsby-source-medusa",
      options: {
        storeUrl: process.env.MEDUSA_URL,
        authToken: process.env.MEDUSA_AUTH_TOKEN //This is optional
      },
    },
    ...,
  ],
}
```

The plugin accepts two options `storeUrl` and `authToken`. The `storeUrl` option is required and should point to the server where your Medusa instance is hosted (this could be `localhost:9000` in development). The `authToken` option is optional, and if you add it the plugin will also source orders from your store.

## You should now be ready to begin querying your data

You should now be able to view your stores `MedusaProducts`, `MedusaRegions`, `MedusaCollections`, and `MedusaOrders` (if enabled) in your Gatsby site's GraphiQL explorer.

---
_Source: https://npm.io/package/gatsby-source-medusa · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
