@amplience/sap-product-browser
v1.0.0
Published
[![Amplience Dynamic Content](header.png)](https://amplience.com/dynamic-content)
Downloads
13
Maintainers
Keywords
Readme
SAP product browser lib
This project is a small client library for communicating with SAP commerce cloud(C4Hana) Hybris.
Building
Build locally:
$ npm install
$ npm run-script build
Usage
This lib contains a client product-service
with the following functions to retrieve products from hybris:
search
: this requires acatalogue
and aquery
to retrieve a paginated list of products.getByCode
: this uses acatalogue
and a productcode
to retrieve a single product. Both functions use thedefaultImageOptions
to find a default image url and attach to the product this will be defaulted todefaultNotFoundImage
if none are found.
Constructor params
host
: URL of deployed Hybris instance.basPath
: path to Hybris API.defaultNotFoundImage
: URL to default image if no image available from product.authTokenSupplier
: Function to return auth token (can be null if no auth needed).defaultImageOptions
:format
: defaulted to 'thumbnail'.type
: defaulted to 'PRIMARY'.