Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@pgprojectx/open-commerce-sdk

Package Overview
Dependencies
Maintainers
26
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pgprojectx/open-commerce-sdk

Client library for interacting with SalesForce Open Commerce api.

latest
npmnpm
Version
2.4.0
Version published
Maintainers
26
Created
Source

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

  • 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
  • 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',
  ... }

FAQs

Package last updated on 09 Nov 2018

Did you know?

Socket

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.

Install

Related posts