Typewriter is a compiler that generates strongly typed analytics clients from Segment Protocols tracking plans, ensuring type safety and compile-time validation for event and property names. Version 9.2.0 requires Node >=18 and is actively maintained by Segment. It supports multiple languages including JavaScript (browser and Node), Swift, Kotlin, and React Native. Key differentiators include integration with Segment's centralized tracking plans, CI-based analytics validation to catch instrumentation mismatches before deployment, and customizable code generation with prefixes/suffixes. The package ships TypeScript types and is distributed as an oclif CLI tool. Release cadence is frequent with multiple minor versions per year.
npm install typewriterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize a new Typewriter project, configure with a Segment tracking plan, and generate a typed analytics client using npx.
Use npx typewriter@7 build for legacy support; update to supported Segment SDKs.
Regenerate clients with npx typewriter build after upgrading to v9.
Replace Segment Config API Token with a Public API Token in typewriter.yml or environment.
Use npx typewriter build --token <PUBLIC_TOKEN> --path <PLAN_PATH> for non-interactive mode (requires v9.1.0+).
Upgrade to v8.0.5 or later to resolve the issue.
Re-run typewriter init and adapt imports to new paths; custom prefixes/suffixes can be configured in typewriter.yml.
Run `npx typewriter init` first in your project root to generate the config, then run build from the same directory.
Upgrade to typewriter >=8.0.5. If fixed, regenerate the client with `npx typewriter build`.
Obtain a Public API Token from Segment workspace settings and pass via `--token` flag or `TYPEWRITER_TOKEN` env variable.
Use non-interactive mode with `npx typewriter build --token YOUR_TOKEN --path plan.json`. Add `--no-interactive` if available.