{"id":24054567,"url":"https://github.com/michaeldoye/ng2woo","last_synced_at":"2025-04-22T21:07:07.075Z","repository":{"id":71367939,"uuid":"89005818","full_name":"michaeldoye/ng2woo","owner":"michaeldoye","description":"Very simple Angular2+ wrapper for the WooCommerce API","archived":false,"fork":false,"pushed_at":"2017-04-22T12:09:48.000Z","size":19,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T21:07:00.762Z","etag":null,"topics":["angular","woocommerce-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/michaeldoye.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-21T16:57:21.000Z","updated_at":"2023-08-20T18:32:26.000Z","dependencies_parsed_at":"2023-05-25T09:15:07.624Z","dependency_job_id":null,"html_url":"https://github.com/michaeldoye/ng2woo","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"66b618b5069c436ed098f7ac20717c128ca367f0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeldoye%2Fng2woo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeldoye%2Fng2woo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeldoye%2Fng2woo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeldoye%2Fng2woo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaeldoye","download_url":"https://codeload.github.com/michaeldoye/ng2woo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250324688,"owners_count":21411946,"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":["angular","woocommerce-api"],"created_at":"2025-01-09T03:48:02.671Z","updated_at":"2025-04-22T21:07:07.055Z","avatar_url":"https://github.com/michaeldoye.png","language":"TypeScript","readme":"# ng2woo \nVery simple Angular2+ wrapper for the WooCommerce API\n\n[![GitHub version](https://badge.fury.io/gh/michaeldoye%2FWaNG.svg)](https://badge.fury.io/gh/michaeldoye%2FWaNG)\n[![dependencies Status](https://david-dm.org/michaeldoye/WaNG/status.svg)](https://david-dm.org/michaeldoye/WaNG)\n[![GitHub issues](https://img.shields.io/github/issues/michaeldoye/WaNG.svg)](https://github.com/michaeldoye/woo-wrapper/WaNG)\n[![Discord Chat](https://img.shields.io/badge/Discord-Chat-blue.svg)](https://discord.gg/xyUdZKh)\n\n## Usage\n\nImport ng2woo in any Angular application by running:\n\n```bash\n$ npm install --save ng2woo\n```\n\nInstall the WooCommerce API:\n\n```bash\n$ npm install --save woocommerce-api\n```\n\nYou will need to get the [WooCommerce credentials](https://woocommerce.github.io/woocommerce-rest-api-docs/#rest-api-keys) from your WooCommerce website.\n\nThen from your Angular `AppModule`:\n\n```typescript\n...\n// Import ng2woo\nimport { WooApiModule, WooApiService } from 'ng2woo';\n\n// Add your WooCommerce Credentials\nconst WooCommerceConfig = {\n  url: 'your_site_url',\n  consumerKey: 'ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXX',\n  consumerSecret: 'cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX',\n  wpAPI: true,\n  version: 'wc/v1'\n};\n\n@NgModule({\n  declarations: [ ... ],\n  imports: [\n    ...\n    // Specify as an import and pass in your config\n    WooApiModule.forRoot(WooCommerceConfig)\n  ],\n  // Add the Api service\n  providers: [ WooApiService ]\n})\nexport class AppModule { }\n```\n\nOnce ng2woo is imported, you can use the `WooApiService` in your components/services:\n\n```typescript\nimport { Component, OnInit } from '@angular/core';\n// Import the service\nimport { WooApiService } from 'ng2woo';\n\n\n@Component({...})\nexport class HomePage implements OnInit { \n\n  products: any;\n  // Inject the service\n  constructor(private woo: WooApiService) { }\n\n  ngOnInit(): void {\n    // Fetch all products\n    this.woo.fetchItems('products')\n      .then(products =\u003e console.log(products));\n  }\n\n}\n\n```\n\n## Methods\n\n\n### `fetchItems(itemType)`\n\n- Accepts: `string` (_required_) - the type of WooCommerce item you want to fetch (_products, orders, customers, categories_). Accepts query parameters, see the [WooCommerce Api docs](https://woocommerce.github.io/woocommerce-rest-api-docs) for a full list of query parameters.\n- Returns: `Promise`\n\n**Examples**\n\n```typescript\nthis.woo.fetchItems('products')\n  .then(products =\u003e console.log(products))\n  .catch(error =\u003e console.log(error));\n```\n\n\n## Development\n\nTo generate all `*.js`, `*.js.map` and `*.d.ts` files:\n\n```bash\n$ npm run tsc\n```\n\nTo lint all `*.ts` files:\n\n```bash\n$ npm run lint\n```\n\n## License\n\nMIT © [Michael Doye](mailto:michaeldoye[@]gmail.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeldoye%2Fng2woo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaeldoye%2Fng2woo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeldoye%2Fng2woo/lists"}