> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Linking npm registry as a source Canonical URL: https://posthog.com/docs/data-pipelines/sources/npm-registry > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://app.posthog.com` (app host for links). ## On this page - [Adding a data source](#adding-a-data-source) - [Available tables](#available-tables) - [Sync limitations](#sync-limitations) - [Configuration](#configuration) - [Supported tables](#supported-tables) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d) 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. `npx @posthog/wizard warehouse` ![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png) ![](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)Let AI connect your sources for you 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 1. Go to the [sources tab](https://app.posthog.com/data-management/sources) of the data pipeline section in PostHog. 2. Click **\+ New source** and then click **Link** next to npm registry. 3. Enter the **package names** you want to track – one per line or comma-separated. Scoped packages like `@scope/name` are supported. 4. Click **Next**. 5. 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](https://github.com/npm/registry/blob/master/docs/download-counts.md). | Incremental | | `Versions` | Published version metadata (publish time, dist-tags, license, tarball URL) per configured package, from the npm [registry API](https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md). | Full refresh | | `VersionDownloads` | Download counts per published version over the last 7 days, per configured package, from the npm [downloads-counts API](https://github.com/npm/registry/blob/master/docs/download-counts.md). Each sync replaces the table with the current rolling 7-day window. | 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. The `VersionDownloads` table joins onto the `Versions` table on `package` and `version`. ## 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 `Versions` table 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 | | `VersionDownloads` | Downloads per published version over the last 7 days, per configured package, from the npm downloads-counts API. | Full refresh | — | package, version |