Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@atoms-studio/commercelayer-sdk
Advanced tools
[![Build Status](https://github.com//atoms-studio/commercelayer-sdk/workflows/Node.js%20CI/badge.svg)](https://github.com/atoms-studio/commercelayer-sdk/actions) [![codecov](https://codecov.io/gh/atoms-studio/commercelayer-sdk/branch/main/graph/badge.svg?
A lightweight, opinionated CommerceLayer SDK built for fast delivery of e-commerce functionalities.
The official CommerceLayer SDK is a great multi-purpose library that covers a lot of scenarios, however we realized that in every project we worked on we had to
reimplement a lot of functionalities tied to the e-commerce workflow: token refresh, token caching, multi-market switch, etc.
This library aims to speed-up development by creating a thinner and easier interface with the CommerceLayer API and provide utilities to deal with the aforementioned problems.
All supported resources are strongly typed and provide code autocompletion for attributes and relationships, decreasing time spent reading the CommerceLayer API documentation.
Combining Authentication and API into a single library allows for automatic refresh of tokens when a request fails due to an expired token.
Tokens are cached by their scope and expiration date, avoiding rate limiting errors when generating static pages or making a lot of concurrent requests.
Switch between multiple markets and automatically create new auth tokens for that market.
npm i @atoms-studio/commercelayer-sdk
yarn add @atoms-studio/commercelayer-sdk
import { init, Auth, Orders, Skus } from '@atoms-studio/commercelayer-sdk'
init({
host: '<your cl domain>.commercelayer.io',
clientId: '<your cl client id>,
})
await Auth.setMarket(1234)
const order = await Orders.create()
const sku = await Skus.findBy({
code: '12345678,
include: ['prices'],
})
await LineItems.create(
{
sku_code: sku.code,
quantity: 1,
},
{},
{
order,
},
)
FAQs
![npm (scoped)](https://img.shields.io/npm/v/@atoms-studio/commercelayer-sdk) ![npm](https://img.shields.io/npm/dm/@atoms-studio/commercelayer-sdk) [![Build Status](https://github.com//atoms-studio/commercelayer-sdk/workflows/Node.js%20CI/bad
The npm package @atoms-studio/commercelayer-sdk receives a total of 23 weekly downloads. As such, @atoms-studio/commercelayer-sdk popularity was classified as not popular.
We found that @atoms-studio/commercelayer-sdk 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.