npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fera-js

v3.0.0-beta.18

Published

Display and collect customer reviews, photos and videos on your website.

Downloads

27

Readme

Introduction

Fera.js is a JavaScript SDK to collect and display customer reviews, photos and videos on your site.

Installation

You can either install with the CDN footer script or install with npm/yarn (ESM).

Prerequisites

  1. Signup at https://app.fera.ai/signup
  2. Grab your public API key from your Fera account API keys section

Method 1: CDN Bundle (JS + CSS)

This one-shot bundle will include all configuration cached by our global CDNs and the base CSS as configured in your Fera acocunt:

<script src="https://cdn.fera.ai/js/fera.bundle.js?api_key=PUT_YOUR_API_KEY_HERE" id="fera_js_bundle"></script>

(replace PUT_YOUR_API_KEY_HERE with your API key)

Just include it before the ending body tag - that's it!

Method 2: CDN With Separate CSS and JS

  1. Include <script src="https://cdn.fera.ai/js/fera.js?api_key=PUT_YOUR_API_KEY_HERE"></script> (replace PUT_YOUR_API_KEY_HERE with your API key)
  2. Include <link href="https://cdn.fera.ai/js/fera.css?api_key=PUT_YOUR_API_KEY_HERE"> (replace PUT_YOUR_API_KEY_HERE with your API key)
  3. That's it!

Method 3: NPM/Yarn (ESM)

npm install fera-js

Yarn:

yarn add fera-js

Then import whatever you want to use. If you want to import everything use:

import Fera from 'fera-js';

const fera = new Fera({
  config: {
    apiKey: "PUT_YOUR_API_KEY_HERE",
    // This needs to point to the node_modules/fera-js/dist/ folder.
    // We publish the latest stable version to cdn.fera.ai/dist/ so this is optional
    // assetBaseUrl: "https://cdn.fera.ai/dist/",
  }
});

fera.once('ready', () => {
    // PUT YOUR CUSTOM CODE HERE
});

Usage

Widgets & Components

Product Reviews Widget

Show product reviews component (widget) in your page:

<fera-reviews product="YOUR_PRODUCT_ID_OR_DATA"></fera-reviews>

Product Rating Widget

Show product rating (stars) component (widget) in your page:

<fera-rating product="YOUR_PRODUCT_ID_OR_DATA"></fera-rating>

Write Review Button

From the HTML, if you're using Fera API:

Show product review modal

<button onclick="fera.showContentSubmitter({ product: YOUR_PRODUCT_ID_OR_DATA })">Write Product Review</button>

Show store/business/company review modal

<button onclick="fera.showContentSubmitter()">Write Store Review</button>

API Client

You can use the api client to access Fera data from the Public API.

(window.fera = window.fera || []).push("once", "ready", (fera) => {
    fera.api.reviews({limit: 10, offset: 0, sort: "created_at", order: "desc"})
        .then((({ product, reviews, meta }) => console.log("Fetched 10 reviews:", reviews))
});