Skip to content

fix(analytics-node): export NodeClient and NodeOptions from Types namespace#1759

Open
budde377 wants to merge 1 commit into
amplitude:mainfrom
budde377:patch-1
Open

fix(analytics-node): export NodeClient and NodeOptions from Types namespace#1759
budde377 wants to merge 1 commit into
amplitude:mainfrom
budde377:patch-1

Conversation

@budde377
Copy link
Copy Markdown

@budde377 budde377 commented May 15, 2026

Summary

Closes #1758.

The @amplitude/analytics-node package's Types namespace re-exports a curated list from @amplitude/analytics-core but omits NodeClient and NodeOptions. This is asymmetric with @amplitude/analytics-browser's Types namespace, which does re-export the equivalent BrowserClient, BrowserConfig, and BrowserOptions.

As a result, code that references amplitude.Types.NodeClient or amplitude.Types.NodeOptions silently resolves to any. The most visible victim is the Ampli code generator (Runtime node.js:typescript-ampli-v2), which emits generated clients of the form:

import * as amplitude from '@amplitude/analytics-node';

export type NodeClient = amplitude.Types.NodeClient;   // resolves to `any`
export type NodeOptions = amplitude.Types.NodeOptions; // resolves to `any`

Those generated files ship with // @ts-nocheck, which hides the breakage from the typechecker, so downstream consumers lose type safety with no warning.

This PR adds the two symbols to packages/analytics-node/src/types.ts, restoring symmetry with the browser package and making amplitude.Types.NodeClient / amplitude.Types.NodeOptions resolve to their real types.

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: no (purely additive type re-export)

Note

Low Risk
Low risk: this only expands public type re-exports for the Node package and does not change runtime behavior.

Overview
Exports NodeClient and NodeOptions from packages/analytics-node/src/types.ts, making these core Node-specific types available via the analytics-node package's public types surface.

Reviewed by Cursor Bugbot for commit 66d26ce. Bugbot is set up for automated code reviews on this repo. Configure here.

@budde377 budde377 changed the title Add NodeClient and NodeOptions to types fix(analytics-node): export NodeClient and NodeOptions from Types namespace May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

analytics-node: Types namespace omits NodeClient and NodeOptions (asymmetric with analytics-browser)

1 participant