
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
bigcommerce-store-api
Advanced tools
This is a simple BigCommerce API client library written in Typescript, it allows developers to interact with the BigCommerce platform. By using this library, developers can easily integrate their applications with BigCommerce stores, enabling them to access and manipulate store data such as products, orders, customers, and more.
npm install bigcommerce-store-api
import BigCommerceStoreApi from 'bigcommerce-store-api';
const apiClient = new BigCommerceStoreApi({
storeHash: 'storeHash',
accessToken: 'accessToken',
});
const response = await apiClient.v3.products.getProducts({
limit: 10,
});
if (response.status === 'success') {
console.log(response.data);
} else {
console.log(response.errors);
}
const responseProduct = await apiClient.v3.products.getProduct(1234);
if (responseProduct.status === 'success') {
console.log(responseProduct.data);
} else {
console.log(responseProduct.errors);
}
If you need to directly call the get
, post
put
delete
methods with a custom URL and custom parameter, you can get the apiClient.request
object and call the corresponding method. For example:
apiClient.request.put({
path: 'v3/catalog/products',
contentType: 'application/json',
body: [
{ id: 123, name: 'New Product Name' },
{ id: 456, name: 'New Product Name' }
],
query: {
include_fields: ['name'],
},
});
bigcommerce-store-api will not throw an error, instead it return error details in response
const response = await apiClient.v3.products.getProduct(1234);
if (response.status === 'error') {
console.log(response.errors);
}
But for program safety, I recommend implementing a try catch to ensure your code is not interrupted by a library bug. For example:
const response = await productApi
.getProducts()
.catch(error => {
console.log(error);
});
if (response) {
console.log(response);
}
// or
try {
const response = await productApi.getProducts();
console.log(response);
} catch (error) {
console.log(error);
}
FAQs
BigCommerce Store API Client
We found that bigcommerce-store-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.