1.1.0 • Published 2 years ago

yotpo-react v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Yotpo React

Wrapper for the Yotpo widget to collect the product reviews in reactjs based website.

Installation

npm install yotpo-react

Usage

import the yotpo react widget as:

import YotpoWidget from 'yotpo-react';

//Load the widget anywhere in your components
<YotpoWidget
    productId='PRODUCT_ID'
    productName='PRODUCT_TITLE'
    productUrl='PRODUCT_URL'
    productImageUrl='PRODUCT_IMAGE_SRC'
    productPrice='PRODUCT_PRICE'
    apiKey='YOUR_YOTPO_API_KEY'
/>

Getting the product reviews states

Product specific states can be fetched through YotpoProductReviewStates as:

import {YotpoProductReviewStates} from 'yotpo-react';

const productReviewStates = YotpoProductReviewStates({'PRODUCT_ID','YOUR_YOTPO_API_KEY'});
AttributeDescription
productReviewStates.total_reviewsTotal product reviews count
productReviewStates.average_scoreEverage review score
productReviewStates.total_organic_reviewsTotal organic reviews count
productReviewStates.organic_average_scoreEverage organic review score
1.1.0

2 years ago

1.0.0

2 years ago