@pgprojectx/open-commerce-sdk

2.4.0 • Public • Published

open-commerce-sdk

Client library for interacting with SalesForce Open Commerce api.

Installation

npm install @pgprojectx/open-commerce-sdk

Usage

const ocSDK = require('@pgprojectx/open-commerce-sdk');
OpenCommerceSDK.ApiClient.instance = new OpenCommerceSDK.ApiClient({ basePath: basePath, clientId: clientId });

const productApi = new OpenCommerceSDK.Product();

development

  1. Set environment variables appropriate to running a Open Commerce deployment (see olay-api-serverless/config).

NOTE: If you do not set your environment properly, the repl will not start:

λ ./src/repl.js
> init()
missing env OC_API_HOST
missing env OC_CLIENT_ID
Error: invalid config, abort
  1. Start the repl via ./src/repl.js. Once the repl starts, you may init(), this loads two references on the repl context: config and oc:
> init()
> ProductApi
ProductApi.getProduct('075609195518').then(d => data = d);
> data
{ _v: '17.8',
  _type: 'product',
  ... }

Readme

Keywords

none

Package Sidebar

Install

npm i @pgprojectx/open-commerce-sdk

Weekly Downloads

0

Version

2.4.0

License

ISC

Unpacked Size

43.5 kB

Total Files

16

Last publish

Collaborators

  • lucasfrazier
  • mitchell0625
  • boggsey
  • btrane
  • joshuarose
  • mattgj
  • johndavidback
  • nogorilla
  • pgalchemy-ops