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

app-reviews

v1.0.1

Published

This module help you to have access to latest reviews in App Store and Google Play Store

Downloads

15

Readme

App-Reviews

NPM Version Downloads

App-Reviews is a nodejs app that monitors App Store and Google Play reviews.

This project is heavily inspired by ReviewMe.

What changed?

  • Using axios instead request.
  • Refactor to have asynchronous code base.
  • Give an option to be able to use any data source e.g. Firebase Storage

Installation

npm install app-reviews

Usage

Three functions need to be define to make this library work.

const storePublishedReviewsList = async (reviews: PublishedReviews) => {
    writeFileSync("./published_reviews.json", JSON.stringify(reviews), { flag: 'w' })
}

const retrivePublishedReviewsList = async (): Promise<PublishedReviews> => {
    try {
        var source = readFileSync("./published_reviews.json", "utf8")
        return JSON.parse(source)
    } catch {
        return {}
    }
}

// by default generated messages are compatible with slack's message formatting.
const onNewMessageAvailable = async (messages: string[]) => {
    var requets = messages.map(message => axios.post(
        { SLACK_WEBHOOK },
        message)
    )
    await Promise.all(requets)
}

Config

App-Review requires a config file. A simple config looks something like:

const config = {
    apps: [
        { id: "[android-package-name]", showAppIcon: true, publisherKey: "./api-key.json" },
        { id: "[app-store-id]", showAppIcon: true, regions: ["us"] }
    ],
    storePublishedReviewsList,
    retrivePublishedReviewsList,
    onNewMessageAvailable
}

Options

  • apps: A list of apps to fetch reviews for. See App Options below

  • storePublishedReviewsList: Function to store list of latest reviews list into the data source

  • retrivePublishedReviewsList: Function to retrive list of latest reviews list from the data source

  • onNewMessageAvailable: Function that receive list of new reviews message

  • verbose: When enabled, log messages will be printed to the console

App options

  • appId: The Android app package name, or the iOS app ID.

  • regions: (iOS Only) The ISO 3166-2 regions to fetch reviews for (use all to include all regions)

  • appIcon: An image url to use for the bot avatar

  • generateMessageFromReview: (optional) Function that generate message for each review

  • showAppIcon: Determines if app icon will be displayed (overrides botIcon)

  • publisherKey: (Android Only) The path to a Google Play Publisher private key (.json file). Used for accessing the Google Play Publisher API.

Google Play Publisher Key

App-Reviews requires access to the Google Play Publisher API to fetch reviews. You need to supply App-Reviews with a Google Play Publisher API private key:

  • Go to the Google Play Developer Console -> Settings -> API Access

  • Create a Google Play Android Developer project

  • Create a Service Account with "Service Accounts" -> "Service Account User" role

  • Download the private key (.json)

  • Supply the path to the private key in the config.json