@7nohe/play-console-report-client
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@7nohe/play-console-report-client

Node.js library for getting report data from Google Play Console

Install

$ npm install @7nohe/play-console-report-client

Usage

import { createClient } from "@7nohe/play-console-report-client";

const client = createClient({
  projectId: '<YOUR-PROJECT-ID>',
  credentials: {
    client_email: '<YOUR-CLIENT-EMAIL>',
    private_key: '<YOUR-PRIVATE-KEY>',
  },
});

const run = async () => {
  const statisticsReports = await client.getStatisticsReports({
    reportMonth: "202207",
    bucketName: '<YOUR-BUCKET-NAME>',
    packageName: '<YOUR-PACKAGE-NAME>',
  });
  console.log(statisticsReports); 
}

run();

credentials

You can get credential information (client_email and private_key) from a service account key.

Here is a guide to creating a service account key.

Also, you need to enable Google Play Developer API.

bucketName

You can find your bucket name in Play Console.

Click Download reports Reports, and select Reviews, Statistics, or Financial.

You can copy your Google Cloud Storage URI by clicking the Copy Cloud Storage URI button next to the corresponding section header on the Download reports pages.

copy-cloud-storage-uri

Your Google Cloud Storage URI should look like this.

gs://<YOUR-BUCKET-NAME>/stats/installs/

Accessing to Google Cloud resources without using a service account key

If your environment supports OpenID Connect (OIDC), we recommend using Workload identity federation.

You will be able to access GCP resources without storing credentials in your environment.

import { createClient } from "@7nohe/play-console-report-client";

const client = createClient({
  projectId: '<YOUR-PROJECT-ID>',
  // No credentials required.
});

API Documentation

Currently, only Statistics Reports API is available.

declare const createClient: (clientOptions: ClientOptions) => {
    getStatisticsReports: (options: GetStatisticsReportsOptions) => Promise<StatisticsReportData[]>;
};

Package Sidebar

Install

npm i @7nohe/play-console-report-client

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

7.79 kB

Total Files

6

Last publish

Collaborators

  • 7nohe