{"id":26346,"library":"rudder-typer-mattiasmts","title":"RudderTyper","description":"A CLI tool from RudderStack (v1.7.9) that generates strongly-typed analytics client libraries from a centralized tracking plan spec. Supports JavaScript, TypeScript, Node.js, Android, and iOS. Compile-time errors and intellisense help catch instrumentation mismatches before production. Integrates with the RudderStack Tracking Plans API. Released under Apache 2.0. Active development with monthly releases. Differentiator: prevents silent analytics drift and enables CI validation of event schemas.","status":"active","version":"1.7.9","language":"javascript","source_language":"en","source_url":"https://github.com/rudderlabs/rudder-typer","tags":["javascript","typescript"],"install":[{"cmd":"npm install rudder-typer-mattiasmts","lang":"bash","label":"npm"},{"cmd":"yarn add rudder-typer-mattiasmts","lang":"bash","label":"yarn"},{"cmd":"pnpm add rudder-typer-mattiasmts","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; CommonJS require will fail.","wrong":"const RudderTyper = require('rudder-typer-mattiasmts')","symbol":"RudderTyper","correct":"import { RudderTyper } from 'rudder-typer-mattiasmts'"},{"note":"RudderTyper is a code generator, not the runtime analytics SDK.","wrong":"import { RudderAnalytics } from 'rudder-typer-mattiasmts'","symbol":"RudderAnalytics","correct":"import { RudderAnalytics } from '@rudderstack/analytics-js'"},{"note":"Used programmatically to generate client code.","symbol":"generateClient","correct":"import { generateClient } from 'rudder-typer-mattiasmts'"}],"quickstart":{"code":"npx rudder-typer-mattiasmts init\n# Follow the interactive prompt to configure.\nnpx rudder-typer-mattiasmts build\nnpm install @rudderstack/analytics-js\nimport { RudderAnalytics } from '@rudderstack/analytics-js';\nimport generatedClient from './generated/rudder-typer';\nconst analytics = new RudderAnalytics();\ngeneratedClient(analytics, { writeKey: 'YOUR_WRITE_KEY' });","lang":"typescript","description":"Initializes a RudderTyper project using the CLI, configures it, builds the client, and demonstrates using it with the RudderStack JavaScript SDK."},"warnings":[{"fix":"Update to v1.6.0 or later and verify event order in tests.","message":"v1.6.0 introduced a breaking change: the generated client now sorts tracking plan choices by `createdAt` during initialization, which may alter event ordering.","severity":"deprecated","affected_versions":"<1.6.0"},{"fix":"Use `npx rudder-typer-mattiasmts init` only in a TTY. For CI, preconfigure a `ruddertyper.yml` and run `build`.","message":"The CLI `init` command only supports interactive mode; non‑interactive environments will hang.","severity":"gotcha","affected_versions":"*"},{"fix":"Install the appropriate RudderStack SDK for your platform.","message":"Generated clients require a separate runtime analytics SDK (e.g., `@rudderstack/analytics-js` for browser).","severity":"gotcha","affected_versions":"*"},{"fix":"Run `rm -r ~/.ruddertyper` to clear cache before `update` if changes are not appearing.","message":"The `plan.json` file is cached locally; calling `update` may not reflect the latest tracking plan if the cache is stale.","severity":"deprecated","affected_versions":"<=1.7.9"},{"fix":"Check the generated index file and adjust imports relative to your project structure.","message":"TypeScript users must manually ensure the generated `.ts` files include the correct import paths after moving or copying the generated directory.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Update to latest version (`npx rudder-typer-mattiasmts@latest`) and verify API token with `npx rudder-typer-mattiasmts token`.","cause":"CLI version <1.6.2 or incorrect API token.","error":"Your workspace does not have any Tracking Plans"},{"fix":"Run `sudo chown -R $USER ~/.ruddertyper` or change the config path in ruddertyper.yml.","cause":"Missing write permissions to the config directory.","error":"Error: EACCES: permission denied, open '~/.ruddertyper/token'"},{"fix":"Run `npx rudder-typer-mattiasmts build` first, or use `init` to create the initial plan.","cause":"The `update` command was run before a plan was generated.","error":"Could not find a plan.json. Run `npx rudder-typer build` first."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}