{"id":23080622,"url":"https://github.com/chen0040/js-magento-client","last_synced_at":"2025-06-10T11:14:27.074Z","repository":{"id":57283303,"uuid":"102917462","full_name":"chen0040/js-magento-client","owner":"chen0040","description":"Magento javascript client for node.js","archived":false,"fork":false,"pushed_at":"2017-11-07T23:36:47.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-09T06:03:54.924Z","etag":null,"topics":["es6","js","magento-client","magento2"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chen0040.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-09T01:24:45.000Z","updated_at":"2018-06-08T18:38:47.000Z","dependencies_parsed_at":"2022-09-18T13:34:34.295Z","dependency_job_id":null,"html_url":"https://github.com/chen0040/js-magento-client","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/chen0040%2Fjs-magento-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjs-magento-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjs-magento-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjs-magento-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chen0040","download_url":"https://codeload.github.com/chen0040/js-magento-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjs-magento-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259064039,"owners_count":22799739,"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":["es6","js","magento-client","magento2"],"created_at":"2024-12-16T13:15:49.191Z","updated_at":"2025-06-10T11:14:27.040Z","avatar_url":"https://github.com/chen0040.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js-magento-client\n\nMagento javascript client for node.js using ES6 class\n\n# install \n\n```bash\nnpm install js-magento-client\n```\n\n# Usage\n\n### Login Api\n\n```javascript\nimport {MagentoAccountApi} from 'js-magento-client';\nimport expect from 'expect';\n\nlet url = 'magento-url';\nlet username = 'username';\nlet password = 'password';\n\nMagentoAccountApi.loginAsClient(\n      url, \n      username, \n      password)\n      .then((response) =\u003e {\n        let token = response.data;\n        expect(response.status).toEqual(200);\n        expect(token.length).toBeGreaterThan(0);\n        done();\n      }).catch(reason =\u003e {\n        console.log(reason);\n        done(new Error(reason));\n      });\n```\n\n### Root Category Api\n\n```javascript\nimport {MagentoCategoryApi} from 'js-magento-client';\nimport expect from 'expect';\n\nlet url = 'magento-url';\n\nMagentoCategoryApi.loadRootCategory(url).then(response =\u003e {\n   let rootCategory = response.data;\n   expect(rootCategory.children_data.length).toBeGreaterThan(0);\n   done();\n}).catch(reason =\u003e {\n   console.log(reason);\n   done(new Error(reason));\n});\n```\n\n### Load Products in a particular category\n\n```javascript\nimport {MagentoCategoryApi} from 'js-magento-client';\nimport expect from 'expect';\n\nlet categoryId = 19;\nlet url = 'magento-url';\n\nMagentoCategoryApi.loadProducts(url, categoryId).then(response =\u003e {\n   //console.log(response.data);\n   expect(response.data.length).toBeGreaterThan(0);\n   done();\n}).catch(reason =\u003e {\n   console.log(reason);\n   done(new Error(reason));\n})\n```\n\n### Load Product by SKU\n\n```javascript\nimport {MagentoProductApi} from 'js-magento-client';\nimport expect from 'expect';\n\nlet sku = 'product_dynamic_17';\nlet url = 'magento-url';\n\nMagentoProductApi.loadProduct(url, sku).then(response =\u003e {\n   let product = response.data;\n   console.log(product);\n   done();\n}).catch(reason =\u003e {\n   console.log(reason);\n   done(new Error(reason));\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchen0040%2Fjs-magento-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchen0040%2Fjs-magento-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchen0040%2Fjs-magento-client/lists"}