
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
lin3s-sylius-shop-api-client
Advanced tools
JavaScript client on top of SyliusShopApiPlugin to build integrations with ease.
JavaScript client on top of SyliusShopApiPlugin to build integrations with ease.
Download the package:
$ npm install lin3s-sylius-shop-api-client
$ yarn add lin3s-sylius-shop-api-client
Import the client:
import
:import createSyliusApiClient from 'lin3s-sylius-shop-api-client';
require()
:const createSyliusApiClient = require('lin3s-sylius-shop-api-client');
Initialize the client
const api = createSyliusApiClient({
baseUrl: 'localhost',
channel: 'default',
cookieDomain: '.myapp.com',
locale: 'en_US',
cartCookieExpiration: 604800000,
userCookieExpiration: 2592000000,
cartTokenCookie: 'cart-token',
})
For example to use the productsByTaxonSlug
using the parameters as described in the API docs bellow ({slug}
=
an object containing slug property and its value):
const products = api.taxon.productsByTaxonSlug({slug: 'some-slug'});
Adding custom endpoints
In case a new endpoint is created in shop-api you can still use the configuration of the client. Your custom function will receive the config via parameters and it must return a function. This function has to be passed in the constructor. An example:
import axios from 'axios';
// You can make use of requestConfig helpers and session values
import createSyliusShopApiClient, {requestConfig} from 'lin3s-sylius-shop-api-client';
const myCustomEndpoint = config => () => new Promise(resolve => {
axios.get(`${config.baseUrl}/shop-api/my-custom-endpoint`)
.then(response => resolve(response.data));
});
const api = createSyliusApiClient({
baseUrl: 'localhost',
channel: 'default',
locale: 'en_US',
customEndpoints: {
myCustomEndpoint
}
});
// Usage
const response = api.custom.myCustomEndpoint();
api.Session.Cart.remove();
api.cart
Method | Params | Status |
---|---|---|
api.cart.pickup | ~ | ✅ |
api.cart.summary | {cartId} (optional) | ✅ |
api.cart.drop | ❌ | |
api.cart.addItem | {productCode, variantCode, quantity} | ✅ |
api.cart.addItems | [{productCode, variantCode, quantity}] | ❌ |
api.cart.changeItemQuantity | ✅ | |
api.cart.removeItem | {orderItemId} | ✅ |
api.cart.estimatedShippingCost | ❌ | |
api.cart.addCoupon | ✅ | |
api.cart.removeCoupon | ✅ |
api.checkout
Method | Params | Status |
---|---|---|
api.checkout.summary | ❌ | |
api.checkout.address | {shippingAddress, billingAddress} | ✅ |
api.checkout.chooseShippingMethod | {shipmentId, methodCode} | ✅ |
api.checkout.choosePaymentMethod | {paymentId, methodCode} | ✅ |
api.checkout.availableShippingMethods | ~ | ✅ |
api.checkout.availablePaymentMethods | ~ | ✅ |
api.checkout.complete | {notes} | ✅ |
api.product
Method | Params | Status |
---|---|---|
api.product.bySlug | {slug} | ✅ |
api.product.byCode | ❌ | |
api.product.reviewsBySlug | ❌ | |
api.product.reviewsByCode | ❌ | |
api.product.addReviewBySlug | ❌ | |
api.product.addReviewByCode | ❌ |
api.taxon
Method | Params | Status |
---|---|---|
api.taxon.all | ✅ | |
api.taxon.byCode | ❌ | |
api.taxon.productsByTaxonCode | ❌ | |
api.taxon.productsByTaxonSlug | {slug} | ✅ |
api.user
Method | Params | Status |
---|---|---|
api.user.register | {email, firstname, lastname, plainPassword} | ✅ |
api.user.resendVerificationLink | ❌ | |
api.user.verifyAccount | ❌ | |
api.user.requestPasswordReset | {email} | ✅ |
api.user.passwordReset | {password} | ✅ |
api.user.login | {_username, _password} | ✅ |
api.user.me | ~ | ✅ |
FAQs
JavaScript client on top of SyliusShopApiPlugin to build integrations with ease.
The npm package lin3s-sylius-shop-api-client receives a total of 0 weekly downloads. As such, lin3s-sylius-shop-api-client popularity was classified as not popular.
We found that lin3s-sylius-shop-api-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.