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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@corsair-dev/googleanalytics

v0.1.0

Published

Google Analytics plugin for Corsair

Readme

@corsair-dev/googleanalytics

GA4 Admin API, Data API, and Measurement Protocol.

Authentication

OAuth 2 (oauth_2).

  1. In the Google Cloud Console, enable Google Analytics Admin API and Google Analytics Data API.
  2. Create a Web application OAuth client. Add the Corsair callback as a redirect URI.
  3. Give Corsair the client ID and secret. The flow requests:
    • https://www.googleapis.com/auth/analytics for Data API reports
    • https://www.googleapis.com/auth/analytics.edit for Admin API reads and writes. The bare analytics scope is not enough for Admin calls.

Corsair refreshes the access token and retries once on 401.

measurementProtocol.sendEvents and validateEvents take an api_secret from Admin, Data Streams, Measurement Protocol API secrets, plus either measurementId (web) or firebaseAppId (app).

Endpoints

| Domain | Operations | | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | accounts | get, list, listV1Beta, listSummaries, getDataSharingSettings, provisionAccountTicket | | properties | get, list, listFiltered, update, createRollup, getAttributionSettings, getDataRetentionSettings, getGoogleSignalsSettings, getPropertyQuotasSnapshot | | dataStreams | list, listMeasurementProtocolSecrets, listEventCreateRules, listSKAdNetworkConversionValueSchemas | | customDimensions | create, get, list, archive | | customMetrics | create, list | | keyEvents | get, list | | conversionEvents | list | | audiences | get, list | | audienceExports | create, get, list, query | | audienceLists | create, get, list, query | | recurringAudienceLists | create, get, list | | calculatedMetrics | list | | channelGroups | list | | expandedDataSets | create, list | | links | listGoogleAds, listBigQuery, listFirebase, listAdSense, listDV360Advertiser, listDV360Proposals, listSearchAds360 | | reports | run, runRealtime, runPivot, runFunnel, batchRun, batchRunPivot, checkCompatibility, getMetadata | | reportTasks | create, get, query, list | | reportingData | listAnnotations, listSubpropertyEventFilters, listSubpropertySyncConfigs | | measurementProtocol | sendEvents, validateEvents |

Provider quirks

  • dataStreams.listMeasurementProtocolSecrets returns secretValue. It is a write so readonly agent mode cannot dump stream secrets.
  • properties.list (v1alpha, deprecated) needs a filter like parent:accounts/{account} or firebase_project:projects/{project}.
  • Admin API name / parent values are full resource names, e.g. properties/123 or properties/123/customDimensions/456. A bare numeric ID 404s. Reports (property) and properties.update also accept 123.
  • Measurement Protocol needs exactly one of measurementId or firebaseAppId.
  • validateEvents hits the debug collect path and does not record hits.
  • Data API quotas are per property. batchRun* burns them fast; check properties.getPropertyQuotasSnapshot.