Skip to main content

Snowtype (Code generation) - automatically generate code for Snowplow tracking SDKs

info
This documentation only applies to Snowplow BDP. See the feature comparison page for more information about the different Snowplow offerings.

Snowtype is a code generation tool that automates the creation of type-safe tracking code for Snowplow SDKs. Snowtype connects directly to your data structures and event specifications. This eliminates manual instrumentation work and ensures that your tracking code is compliant with the schemas and produces high quality data.

Snowtype streamlines the development workflow by providing several key advantages:

  • Type safety enforcement: Generates strongly-typed code that validates events and entities at compile time, preventing schema violations before data reaches your pipeline.
  • Automated code generation: Converts event specifications into production-ready SDK code, reducing implementation time from weeks to days.
  • Integrated documentation: Syncs inline code documentation with your data structures and products, maintaining consistency between design and implementation.
  • Development workflow integration: Fits seamlessly into CI/CD processes, enabling GitOps-style data product management and automated updates when schemas evolve.
  • Reduced maintenance overhead: Automatically updates tracking code when data structures change, eliminating the need for manual synchronization across multiple codebases.

Supported trackers

TrackerLanguage/s
@snowplow/browser-trackerjavascript, typescript
@snowplow/node-trackerjavascript, typescript
@snowplow/react-native-trackertypescript
@snowplow/javascript-trackerjavascript
snowplow-golang-trackergo
snowplow-ios-trackerswift
snowplow-android-trackerkotlin
snowplow-flutter-trackerdart
snowplow-java-trackerjava

Prerequsites

To use Snowtype, you must have Node.js (>=@18) installed.

Installation

Navigate to your project and install Snowtype using your favorite package manager:

npm install --save-dev @snowplow/snowtype

Executing commands

Installing Snowtype will also create a local executable snowtype which you can use with npx, yarn or pnpm directly when on your project's directory.

npx @snowplow/snowtype init
# Same as
npx snowtype init

We will show example commands using npm/npx but it should work the same with any other package manager.

On this page

Want to see a custom demo?

Our technical experts are here to help.