RudderTyper v2
Beta
Learn about RudderTyper v2 and how it generates type-safe client bindings from your Tracking Plans.

This feature is in
Public Beta as part of RudderStack’s
Early Access Program, where we work with early users and customers to test new features and get feedback before making them generally available.
RudderTyper v2 leverages the Rudder CLI functionality to generate type-safe client bindings from your Tracking Plans, enabling compile-time type safety and a better developer experience when instrumenting your applications. By generating native code that matches your Tracking Plan’s event definitions, you can catch errors at compile time rather than runtime.

RudderTyper v2 supports generating Kotlin bindings for Android and JVM platforms, and Swift bindings for iOS.
RudderTyper v2 is the actively maintained version and will receive all future updates. For the older npm-based version that supports JavaScript, TypeScript, Java, and Objective-C, see RudderTyper v1.
Key features
This section highlights the key features of RudderTyper v2.
Type-safe event tracking
- Generate strongly-typed Kotlin classes and Swift structs that match your Tracking Plan’s event structure
- Compile-time validation ensures your code matches your Tracking Plan definitions
- IntelliSense support for autocomplete and type checking in your IDE
- Kotlin: Generate bindings for both Android and JVM platforms
- Swift: Generate bindings for iOS applications
- Support for all standard RudderStack event types:
track, identify, screen, and group
Customizable code generation
CLI integration
- Generate bindings directly from your Tracking Plans using Rudder CLI
- Browse and select Tracking Plans interactively
- Simple command-line interface for code generation
Limitations
Although the generated bindings leverage language features (Kotlin and Swift) to ensure compile-time type safety and compliance with Tracking Plan rules, the following scenarios cannot be handled at compile time:
Validating property rules
Rules like regular expressions or length constraints on values cannot be enforced at compile time because the value is only available at runtime. The only exception to this is enum constraints, which are modeled as enum types (Kotlin enum classes or Swift enums with raw values), restricting which values can be assigned to respective properties.
Object properties with additional properties
Properties of Object type typically allow objects of any shape to be passed as values. RudderTyper represents this as the JsonObject type in Kotlin or [String: Any] in Swift, which can represent any object.
If those properties are used in a Tracking Plan event rule, you can define nested properties for them to restrict the shape of the object property. In that context, you can define whether additional properties (to those mentioned as nested properties) are allowed or not.
While RudderTyper can represent object shapes that don’t allow additional properties, it cannot do the same for object shapes that allow them. These are represented as if additional properties are not allowed.
Get started
Questions? We're here to help.
Join the RudderStack Slack community or email us for support