Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/medusajs/gatsby-source-medusa
Gatsby source plugin for building websites using Medusa as a data source.
https://github.com/medusajs/gatsby-source-medusa
e-commerce gatsby medusajs
Last synced: about 2 months ago
JSON representation
Gatsby source plugin for building websites using Medusa as a data source.
- Host: GitHub
- URL: https://github.com/medusajs/gatsby-source-medusa
- Owner: medusajs
- License: mit
- Created: 2021-06-28T09:44:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-08T12:18:50.000Z (over 2 years ago)
- Last Synced: 2023-03-10T17:13:09.558Z (almost 2 years ago)
- Topics: e-commerce, gatsby, medusajs
- Language: TypeScript
- Homepage:
- Size: 370 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
gatsby-source-medusa
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.
## Note
> Plugin has been moved to our [monorepo](https://github.com/medusajs/medusa), please open issues and PR's there, as this repo is no longer maintained
## 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.