Registry / devops / rudder-typer

rudder-typer

JSON →
library1.7.5jsnpmunverified

RudderTyper is a CLI tool (current stable v1.7.5) that generates strongly-typed analytics clients for RudderStack based on your tracking plan spec. It produces compile-time error checking and autocomplete for event names, properties, and types. Supports JavaScript, Node.js, Android, and iOS targets. Key differentiators: natively integrates with RudderStack tracking plans, enables CI validation of instrumentation before deployment, and outputs typed clients that reduce runtime errors. Release cadence is irregular with bug fixes and occasional features. Maintained by RudderStack.

npm install rudder-typer
INSTALL
IMPORT
SIG · RUDDER-TYPER
R
rudder-typer
devopsjavascriptv1.7.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RudderTyperClient
import { RudderTyperClient } from 'rudder-typer';
const RudderTyperClient = require('rudder-typer').RudderTyperClient;
RudderTyper is primarily a CLI tool; runtime imports are from the generated client, not this package. This import is for programmatic usage of the generated client types.
track
client.track('event_name', { property: value });
rudderanalytics.track('event_name', { property: value });
The generated client provides methods like track, identify, page; use the generated client instance, not the raw RudderStack SDK.
identify
client.identify('userId', { trait: value });
client.identify({ userId: 'userId', traits: { trait: value } });
The generated identify method takes userId as first argument and traits as second; wrong pattern passes an object.

Initialize RudderTyper with a tracking plan, then use the generated typed client to track events.

npx rudder-typer init # Follow prompts to set up tracking plan and generate client # Then in your code: import { createClient } from './generated/rudder-typer-client'; const client = createClient({ writeKey: process.env.RUDDERSTACK_WRITE_KEY ?? '' }); client.track('Order Completed', { total: 99.99, currency: 'USD' });
rudder-typer --version
Debug
Known issues
gotchaCLI commands are npx rudder-typer, not a global install. Running without npx may cause version mismatches.
fix
Always use npx rudder-typer <command> or install globally with npm i -g rudder-typer and run rudder-typer.
affects: >=1.0.0
gotchaGenerated clients are specific to a tracking plan version. Re-running update can overwrite local changes.
fix
Version-control the generated files and plan.json. Run update only when tracking plan changes intentionally.
affects: >=1.0.0
gotchaThe init command requires a RudderStack account with a tracking plan. Without one, setup fails.
fix
Ensure you have a RudderStack workspace and tracking plan before running init.
affects: >=1.0.0
deprecatedThe `initialize` alias for the init command is deprecated.
fix
Use `init` instead of `initialize`.
affects: >=1.7.0
gotchaError 'Your workspace does not have any Tracking Plans' persists on older CLI versions (<1.6.0).
fix
Upgrade to v1.6.0+ with `npm install -g rudder-typer@latest`.
affects: <1.6.0
Errors
Common errors & fixes
Your workspace does not have any Tracking Plans
Missing tracking plan in RudderStack workspace or outdated CLI version.
fix
Verify tracking plan exists in RudderStack UI, then update CLI: npm install -g rudder-typer@latest
Error: Cannot find module 'rudder-typer'
Attempting to require rudder-typer as a runtime module instead of using CLI.
fix
Use npx rudder-typer <command> for CLI, or install the generated client package separately.
Plan.json not found. Please run 'init' or 'update' first.
Missing plan.json in working directory.
fix
Run `npx rudder-typer init` to create configuration and plan.json.
Upgrade
Version history
1.7.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
rudder-typer — npm install rudder-typer · libregistry