Socket
Book a DemoInstallSign in
Socket

@pgprojectx/bazaarvoice-sdk

Package Overview
Dependencies
Maintainers
33
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pgprojectx/bazaarvoice-sdk

API wrapper for BazaarVoice

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
7
-30%
Maintainers
33
Weekly downloads
 
Created
Source

@pgprojectx/bazaarvoice-sdk

API wrapper for BazaarVoice

Table of Contents

  • Install
  • Usage
  • Notes

Install

# For JavaScript usage
npm install --save-exact @pgprojectx/bazaarvoice-sdk

# For CLI usage
npm install --global @pgprojectx/bazaarvoice-sdk

Usage

const bazaarvoice = require('@pgprojectx/bazaarvoice-sdk');

const client = bazaarvoice({
  host: 'https://api.bazaarvoice.com',
  apiVersion: '5.4',
  apiKey: 'apiKey'
});

// Get Product Reviews
const reviews = await client.getProductReviews('000123645678901');
console.log(reviews);
// {
//   "reviewCount": Number,
//   "reviews": Array,
//   "rating": Number
// }

Configuration Files

Create an rc file to set defaults, so you don't have to pass a host, apiKey, and apiVersion flag to every command.

# ~/.bazaarvoicerc
host = https://api.bazaarvoice.com
apiKey = your-api-key
apiVersion = 5.4

@pgprojectx/bazaarvoice-sdk will walk the directory tree looking for rc files, so you can create one in the root of your project's directory to make the CLI context aware.

Commands

Get Product Reviews

Retrieve product review information for a specified product. The results are written to stdout

> bazaarvoice-sdk get-product-reviews -h
bazaarvoice-sdk get-product-reviews [productId]

Get product reviews for a product ID

Options:
  --version          Show version number                               [boolean]
  --host, --apiHost  BazaarVoice API hostname                         [required]
  --apiKey           API key for BazaarVoice                          [required]
  --apiVersion       BazaarVoice API version                          [required]
  --productId        Product ID
  --raw              Return full response data
  -h                 Show help                                         [boolean]

Notes

BazaarVoice does not return 404s for non-existing products. So default responses will result in the following object

{
  "reviewCount": 0,
  "reviews": [],
  "rating": false
}

Keywords

api

FAQs

Package last updated on 11 Oct 2019

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.