Tracking Plan Codegen
Code Generation (Codegen) for Tracking Plans is now available to all RudderStack users, including those on the free plan. A Tracking Plan outlines the structure of an event, specifying property names, data types, required fields, and their nesting. Codegen takes this contract and generates a code snippet that engineers can directly paste into their projects, eliminating the need for manual schema translation that often leads to errors.
These errors can manifest as mismatched keys, incorrect data types, or missing required properties, which typically surface as violations of the Tracking Plan, broken destination mappings, or inaccurate data in the warehouse. The generated snippet contains the complete properties object structure, precise property keys, example values suited to each property's data type, nested objects formatted as objects, and inline comments for optional properties.
Currently, Codegen supports the JavaScript SDK, with plans to expand support to other languages. While Codegen provides a fast and accurate method for obtaining a copy-paste snippet, it does not maintain synchronization with changes to the Tracking Plan after instrumentation. For teams seeking full type safety and IDE autocompletion, RudderTyper leverages the same Tracking Plan contract to generate and maintain typesafe functions. More details about Codegen are available in the Tracking Plan Codegen documentation.
Written by urgent.news from Brooks Patterson's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.