Linking npm registry as a source
Let AI connect your sources for you
Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

This source is currently in alpha. The interface and available tables may change.
Pull daily download counts and published-version metadata for npm packages into the PostHog data warehouse. This lets you join npm analytics with your product data in queries, insights, and dashboards.
npm's read APIs are public, so no credentials are required.
Adding a data source
- Go to the sources tab of the data pipeline section in PostHog.
- Click + New source and then click Link next to npm registry.
- Enter the package names you want to track – one per line or comma-separated. Scoped packages like
@scope/nameare supported. - Click Next.
- Select the tables you want to sync, set the sync method and frequency, then click Import.
Once the syncs are complete, you can start using npm data in PostHog.
Available tables
| Table | Description | Sync method |
|---|---|---|
Downloads | Daily download counts per configured package, from the npm downloads-counts API. | Incremental |
Versions | Published version metadata (publish time, dist-tags, license, tarball URL) per configured package, from the npm registry API. | Full refresh |
Incremental tables sync only new or updated records on each run. Full refresh tables reload all data on each sync.
The Versions table is always full refresh because the npm registry API has no server-side "changed since" filter.
Sync limitations
- Maximum 100 packages per source.
- Download data only goes back to 2015-01-10 (the earliest date the npm downloads API supports). Downloads are fetched in 540-day windows, so the first sync of a long-lived package can take a while.
- The
Versionstable re-fetches the full registry document for each package on every sync. Packages with a large number of published versions may produce large responses.
Configuration
| Option | Type | Required |
|---|---|---|
Package names | textarea | Yes |
Supported tables
| Table | Description | Sync method | Incremental field | Primary key |
|---|---|---|---|---|
Downloads | Daily download counts per configured package, from the npm downloads-counts API. | Incremental, Full refresh | day | package, day |
Versions | Published version metadata (publish time, dist-tags, tarball, license) per configured package, from the npm registry API. | Full refresh | — | package, version |