{"id":19312101,"url":"https://github.com/bigcommerce/bigcommerce-api-node","last_synced_at":"2025-10-10T15:41:10.278Z","repository":{"id":56797090,"uuid":"466204609","full_name":"bigcommerce/bigcommerce-api-node","owner":"bigcommerce","description":"A node module for authentication and communication with the BigCommerce API","archived":false,"fork":false,"pushed_at":"2024-04-17T05:43:18.000Z","size":914,"stargazers_count":11,"open_issues_count":9,"forks_count":17,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-09-09T14:47:35.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/bigcommerce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-03-04T17:01:28.000Z","updated_at":"2025-07-01T09:19:06.000Z","dependencies_parsed_at":"2024-11-10T00:32:59.897Z","dependency_job_id":"c358dd5e-7a33-4db8-9620-b941c32c2645","html_url":"https://github.com/bigcommerce/bigcommerce-api-node","commit_stats":{"total_commits":23,"total_committers":7,"mean_commits":"3.2857142857142856","dds":0.6086956521739131,"last_synced_commit":"215a5335bf25ae31685bdbc8822db3748d86e6a8"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bigcommerce/bigcommerce-api-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigcommerce","download_url":"https://codeload.github.com/bigcommerce/bigcommerce-api-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004571,"owners_count":26083736,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-10T00:32:51.612Z","updated_at":"2025-10-10T15:41:10.247Z","avatar_url":"https://github.com/bigcommerce.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bigcommerce for Node.js\n\nA node module for authentication and communication with the BigCommerce API.\n\n## Installation (In Development)\n\n1. Clone this repository: `git clone git@github.com:bigcommerce/bigcommerce-api-node.git`\n2. Navigate into the cloned repository: `cd bigcommerce-api-node`\n3. Run [npm link](https://docs.npmjs.com/cli/v8/commands/npm-link): `npm link`\n\nNow, you can navigate into the directory of some other package (e.g., [sample-app-nodejs](https://github.com/bigcommerce/sample-app-nodejs)) and run `npm link bigcommerce-api-node` which will then allow you to use and test this package as if it was downloaded from NPM.\n\n## Type Generation\n\nThe `bigcommerce-api-node` package automatically generates Typescript types from the Open API spec `.yml` files that power our [public API documentation](https://developer.bigcommerce.com/). While making contributions to the `bigcommerce-api-node` package, you may find it necessary to re-generate types from the spec. \n\nIn order to do so, simply run: \n\n```sh\nnpm run generate\n```\n\nThis command will: \n\n1. Run `npm run init` to compile the `TypeGenerator.ts` class\n2. Run `dist/generate/TypeGenerator.js` to generate types\n3. Run `npm build` to build the types into the distributed Node.js package\n\n## Usage\n\nFirst, import the package into your project:\n\n```js\nimport BigCommerce from '@bigcommerce/api-nodejs';\n```\n\nThen, create a BigCommerce object with configuration options relevant to your use case.\n### The BigCommerce Object\n\nThe main `BigCommerce` import is an object that contains properties for different use cases of the BigCommerce Node Client. The properties available are described below:\n\n* `Auth`: This class can be instantiated and used to handle the OAuth flow that begins when a merchant clicks **Install** on a single-click app.\n* `Rest`: This class can be instantiated and used to make API requests to the BigCommerce Public REST API.\n\n## OAuth\n\nThe `bigcommerce-api-node` package can be used to handle the OAuth flow that begins when a merchant clicks **Install** on a single-click app.\n\nFirst, create a BigCommerce object with `clientId`, `clientSecret`, and `authCallback` as required configuration options:\n\n```js\nconst bigcommerceAuth = new BigCommerce.Auth({\n  clientId: 'YOUR_CLIENT_ID',\n  clientSecret: 'YOUR_CLIENT_SECRET',\n  authCallback: 'https://yourapplication.com/auth',\n});\n```\n\nThe `bigcommerceAuth` object created above exposes two public methods: `authorize` and `verifyJWT`.\n\nThe `authorize` method takes one parameter — an object containing string values for `code`, `scope`, and `context`, which are provided by the GET request to your store when a merchant installs your app.\n\n```js\nconst payload = await bigcommerceAuth.authorize({code, scope, context});\n```\n\nThe object stored in the `payload` variable above will contain the following key/value pairs:\n\n```js\n{\n  access_token: '123abc',\n  scope: 'store_v2_orders etc.',\n  user: {\n    id: 12345,\n    username: 'user.email@example.com',\n    email: 'user.email@example.com',\n  },\n  context: 'stores/{STORE_HASH}',\n  account_uuid: 'uuid-string'\n}\n```\n\nThe `verifyJWT` method can be used to verify and return the payload returned by the `load`, `uninstall`, and `remove User` callbacks. Each event triggers a GET request from BigCommerce to your app's callback endpoints containing a `signed_payload_jwt` as a query parameter. Once you parse the `signed_payload_jwt` from the request parameters, you can pass it to the `verifyJWT` method as follows:\n\n```js\nconst payload = bigcommerceAuth.verifyJWT(signed_payload_jwt);\n```\n\nThe object stored in the `payload` variable above will contain the following key/value pairs:\n\n```js\n{\n  aud: 'YOUR_CLIENT_ID',\n  iss: 'bc',\n  iat: 1646844813,\n  nbf: 1646844808,\n  exp: 1646931213,\n  jti: 'uuid-value',\n  sub: 'stores/{STORE_HASH}',\n  user: { id: 1470672, email: 'user.email@example.com' },\n  owner: { id: 1470672, email: 'owner.email@example.com' },\n  url: '/'\n}\n```\n\n## REST\n\nThe `bigcommerce-api-node` package can be used to communicate with the BigCommerce Public REST API.\n\n```js\nconst bigcommerceRest = new BigCommerce.Rest({\n  storeHash: 'yourStoreHash',\n  accessToken: 'yourStoreAccessToken',\n})\n\n// bigcommerceRest.\u003cresource_name\u003e.\u003cmethod_name\u003e\n```\n\nEach method returns a `Promise` that resolves to a response containing the resource data.\n\n```js\nbigcommerceRest.v2.orders\n  .list({ limit: 5 })\n  .then(orders =\u003e console.log(orders))\n  .catch(err =\u003e console.error(err));\n```\n\nSome resources contain a `listAll()` method which returns an [Iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#iterators) allowing you to loop through every single resource available, with pagination handled for you.\n\n```js\nfor await (const order of bigcommerceRest.v2.orders.listAll()) {\n  console.log(order);\n}\n```\n\n## Rate Limiting Management\nThe `RestClient` class provides information on its status in relation to the BigCommerce API rate limiter. The available information includes:\n* `msToReset`: Time (in milliseconds) until rate limiting window resets\n* `nextWindowTime`: `Date` object for the start of the next rate limiting window\n* `windowSize`: Total size of the current rate limiting window\n* `requestsRemaining`: Number of requests remaining in the current window before rate limiting is enforced\n* `requestsQuota`: Total requests allowed per window\n\nThis information is updated on every request. It can be accessed via the `rateLimitManager` property and used to avoid receiving a `429` error from the server.\n```js\nbigcommerceRest.rateLimitManager.status  // \u003c-- { msToReset, windowSize, requestsRemaining, requestsQuota }\n```\n\n`RestClient` can be optionally configured to delay requests until the next rate limiting window when a minimum request threshold is met. \n```js\n  const bigcommerceRest = new BigCommerce.Rest({\n    storeHash: STORE_HASH,\n    accessToken: ACCESS_TOKEN,\n    rateLimitConfig: {\n      enableWait: true,\n      minRequestsRemaining: 10,\n    },\n```\n\nAdditionally, a custom callback can be provided with optional params object to be run when the request threshold is met.\n```js\n  const limitCallback = params =\u003e console.log(params.message);\n\n  const bigcommerceRest = new BigCommerce.Rest({\n    storeHash: STORE_HASH,\n    accessToken: ACCESS_TOKEN,\n    rateLimitConfig: {\n      enableWait: false,\n      minRequestsRemaining: 10,\n      callbackParams: { message: 'request threshold reached' },\n      callback: limitCallback  // \u003c-- function called with callbackParams when minRequestsRemaining threashold is met\n    },\n```\n\n### Available Resources and Methods\n* v2\n  * v2.orders\n    * `get(orderId)`: Get an Order\n    * `update(orderId, data)`: Update an Order\n    * `archive(orderId)`: Archive an Order\n    * `count()`: Get a Count of Orders\n    * `list([params])`: Get All Orders\n    * `listAll([params])`: Get All Orders (Paginated)\n    * `create(data)`: Create an Order\n    * `archiveAll()`: Archive All Orders\n  * v2.orders.orderCoupons\n    * `list(orderId[, params])`: List Order Coupons\n    * `listAll(orderId[, params])`: List Order Coupons (Paginated)\n  * v2.orders.orderProducts\n    * `list(orderId[, params])`: List Order Products\n    * `listAll(orderId[, params])`: List Order Products (Paginated)\n    * `get(orderId, productId)`: Get an Order Product\n  * v2.orders.orderTaxes\n    * `list(orderId[, params])`: Get All Order Taxes\n    * `listAll(orderId[, params])`: Get All Order Taxes (Paginated)\n  * v2.orders.orderStatus\n    * `list()`: Get All Order Statuses\n    * `get(statusId)`: Get a Single Order Status\n  * v2.orders.orderShipments\n    * `list(orderId[, params])`: Get Order Shipments\n    * `listAll(orderId[, params])`: Get Order Shipments (Paginated)\n    * `create(orderId, data)`: Create Order Shipment\n    * `deleteAll(orderId)`: Delete All Order Shipments\n    * `count(orderId)`Get a Count of Order Shipments\n    * `get(orderId, shipmentId)`: Get a Shipment\n    * `update(orderId, shipmentId, data)`: Update a Shipment\n    * `delete(orderId, shipmentId)`: Delete an Order Shipment\n  * v2.orders.orderShippingAddresses\n    * `list(orderId[, params])`: Get Order Shipping Addresses\n    * `listAll(orderId[, params])`: Get Order Shipping Addresses (Paginated)\n    * `get(orderId, addressId)`: Get a Shipping Address\n    * `update(orderId, addressId, data)`: Update a Shipping Address\n  * v2.orders.orderMessages\n    * `list(orderId[, params])`: Get Order Messages\n    * `listAll(orderId[, params])`: Get Order Messages (Paginated)\n  * v2.orders.orderShippingQuotes\n    * `list(orderId, addressId)`: Get Order Shipping Quotes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigcommerce%2Fbigcommerce-api-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigcommerce%2Fbigcommerce-api-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigcommerce%2Fbigcommerce-api-node/lists"}