@field123/client-shopper
Description
EPCC for JavaScript shopper Client for Node.js, Browser and React Native.
Installing
To install the this package, simply type add or install @field123/client-shopper
using your favorite package manager:
npm install @field123/client-shopper
yarn add @field123/client-shopper
pnpm add @field123/client-shopper
Getting Started
Module imports
The EPCC SDK uses clients and commands.
To send a request, you only need to import the client creator function createshopperClient
and
the command creator functions you need, for example createGetAllHierarchiesCommand
:
Syntax
const {
createshopperClient,
createGetAllHierarchiesCommand
} = require('@field123/client-shopper')
import {
createshopperClient,
createGetAllHierarchiesCommand
} from '@field123/client-shopper'
Usage
To send a request, you:
- Create a client with configuration (e.g. credentials).
- Create a command with any required input parameters.
- Call
send
operation on client with command object as the first argument.
const client = createshopperClient({
credentials: fromKeys({
clientId: '...'
})
})
const params = {
}
const command = createGetAllHierarchiesCommand(params)
Sending command
try {
const data = await client.send(command)
} catch (error) {
}
Support command creators for ShopperClient
- createGetAllHierarchiesCommand
- createGetAllNodesCommand
- createGetAllProductsCommand
- createGetHierarchyByIdCommand
- createGetHierarchyChildNodesCommand
- createGetHierarchyNodesCommand
- createGetHierarchyProductsCommand
- createGetNodeByIdCommand
- createGetNodeChildNodesCommand
- createGetNodeProductsCommand
- createGetProductByIdCommand
- createGetShopperCatalogCommand