{"id":19226861,"url":"https://github.com/thisisjuke/medusa-source-shopify-json","last_synced_at":"2025-04-21T00:32:57.299Z","repository":{"id":63855874,"uuid":"571240683","full_name":"Thisisjuke/medusa-source-shopify-json","owner":"Thisisjuke","description":"Migrate your Shopify products 🛍️ to MedusaJS 🐙 using .JSON files ! 🎉","archived":true,"fork":false,"pushed_at":"2022-11-27T16:19:47.000Z","size":158,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T16:19:34.690Z","etag":null,"topics":["ecommerce","javascript","medusa-plugin","medusajs","migrate-shopify","shopify"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Thisisjuke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-27T16:02:43.000Z","updated_at":"2024-10-24T08:46:01.000Z","dependencies_parsed_at":"2022-11-27T17:48:21.378Z","dependency_job_id":null,"html_url":"https://github.com/Thisisjuke/medusa-source-shopify-json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thisisjuke%2Fmedusa-source-shopify-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thisisjuke%2Fmedusa-source-shopify-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thisisjuke%2Fmedusa-source-shopify-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thisisjuke%2Fmedusa-source-shopify-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thisisjuke","download_url":"https://codeload.github.com/Thisisjuke/medusa-source-shopify-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249980885,"owners_count":21355520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecommerce","javascript","medusa-plugin","medusajs","migrate-shopify","shopify"],"created_at":"2024-11-09T15:20:40.466Z","updated_at":"2025-04-21T00:32:57.026Z","avatar_url":"https://github.com/Thisisjuke.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Medusa Source Shopify JSON\n\nPlugin that allows users to source Medusa using a Shopify store or JSON of products coming from Shopify.\n\nIt's a fork from `medusa-source-shopify` : https://github.com/medusajs/medusa/tree/master/packages/medusa-source-shopify\n\n## Context: what's the difference?\n\n- I need something smoother and more simple than `updated_at_min` coming from cache: [Original repo method `getAndUpdateBuildTime_`](https://github.com/medusajs/medusa/blob/master/packages/medusa-source-shopify/src/services/shopify.js#L104).\n- For dev purposes or just to migrate Shopify one time: I want to be able to use JSON files like `products.json`.\n- It's always better if I can dodge working with `Shopify Private Applications` 🐱 !\n\n## Install the plugin\n\nNavigate to your Medusa server (the API, not the admin dashboard) in your terminal, and install the plugin.\n\n```zsh\n$ cd my-medusa-server\n$ yarn add medusa-source-shopify-json\n```\n\n## Fetch from a local JSON\n\n### Download your products\n\n\u003e 💡 `MY_STORE_NAME` is the name of your store.\n\n- Go to: `https://MY_STORE_NAME.myshopify.com/admin/api/unstable/products.json`\n- Save this JSON in a `.json` file, like in `./products.json`\n\nDo the same with these 3 urls:\n- custom_collections : `https://MY_STORE_NAME.myshopify.com/admin/api/unstable/custom_collections.json`\n- smart_collections : `https://MY_STORE_NAME.myshopify.com/admin/api/unstable/smart_collections.json`\n- collects_path : `https://MY_STORE_NAME.myshopify.com/admin/api/unstable/collects_path.json`\n\n\u003e 💡 You now have created 4 files inside your applications.\n\n### Add the plugin to your configuration\n\n```js\nconst plugins = [\n  // other plugins...\n  {\n    resolve: `medusa-source-shopify-json`,\n    options: {\n      json: {\n        products_path: \"./products.json\",\n        custom_collections_path: \"./custom_collections.json\",\n        smart_collections_path: \"./smart_collections.json\",\n        collects_path: \"./collects.json\"\n      }\n    }\n  }\n];\n```\n\n## Fetch directly your products from Shopify\n\n### Create a Shopify app\n\nNavigate to your Shopify dashboard, and then go to `Apps` and click the `Develop apps for your store` button at the bottom of the page.\nAfter navigating to the `App development` page, click the `Create an app` in the top right corner.\n\nThis should open a modal where you can choose a name for your app. Write a name and click `Create app`.\n\nYou should then click the button that says `Configure Admin API scopes`. Scroll down to `Products` and select the `read_products` scope, and then save your changes.\n\nGo back to overview and click `Install app`. This should generate a token, that you should write down as you can only view it once : it's your `password`.\n\n### Add the plugin to your configuration\n\nUpdate your `medusa-config.js` with the following:\n\n```js\n//Shopify keys\nconst SHOPIFY_STORE_URL = process.env.SHOPIFY_STORE_URL || \"\";\nconst SHOPIFY_API_KEY = process.env.SHOPIFY_API_KEY || \"\";\n\nconst plugins = [\n  // other plugins...\n  {\n    resolve: `medusa-source-shopify-json`,\n    options: {\n      domain: SHOPIFY_STORE_URL,\n      password: SHOPIFY_API_KEY,\n      updated_after: \"2021-01-01\"\n    }\n  }\n];\n```\n\nYou should then add `SHOPIFY_STORE_URL` and `SHOPIFY_API_KEY` to your `.env`.\n\n```env\nSHOPIFY_API_KEY=\u003cyour_secret_shopify_key\u003e\nSHOPIFY_STORE_URL=\u003cyour_store_name\u003e\n```\n\nThe `SHOPIFY_API_KEY` is the token that we generated in the previous step.\n\n`SHOPIFY_STORE_URL` is the name of your store (don't add `myshopify.com` in this variable).\nYou can view the name in the url of your Shopify dashboard, which has the following format `\u003cyour_store_name\u003e.myshopify.com`.\n\n`updated_after` overwrite the autogenerated date from build to fetch all products starting a date.\n```js\nupdated_after: '2022/10/10' //this will fetch products modified since the 10th October of 2022.\n```\n\nIf you want to disable this feature and fetch things independently of the date, set it to `false`.\n\n```js\nupdated_after: false;\n```\n\nIf your remove it, it does like the default behavior:\n\n\u003e The plugin stores everytime it is run, and will use this timestamp to only fetch products, collections and collects that have been updated in Shopify since the last time it pulled data.\n\n## Run your server\n\nAfter setting everything up you can now run your server\n\n```zsh\n$ yarn start\n```\n\nand the plugin will handle the rest.\n\n## Note / Limitations\n\n### `Product/Collection` relations (`Collect`)\n\n**(this is the same limitation as in the official plugin)**\n\nShopify supports products being part of more than one collection, but Medusa does not support this. For this reason a product will only be part of the first collection it has a relation to in Medusa. The plugin processes Shopify product/collection relations in the following order:\n\n1. Custom collections\n2. Smart collections\n\nThis means that if product `X` is part of custom collection `Y` and smart collection `Z` in Shopify, it will only be added to custom collection `X` in Medusa.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisisjuke%2Fmedusa-source-shopify-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthisisjuke%2Fmedusa-source-shopify-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisisjuke%2Fmedusa-source-shopify-json/lists"}