Snowtype (Code generation) - automatically generate code for Snowplow tracking SDKs
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
Tracker | Language/s |
---|---|
@snowplow/browser-tracker | javascript, typescript |
@snowplow/node-tracker | javascript, typescript |
@snowplow/react-native-tracker | typescript |
@snowplow/javascript-tracker | javascript |
snowplow-golang-tracker | go |
snowplow-ios-tracker | swift |
snowplow-android-tracker | kotlin |
snowplow-flutter-tracker | dart |
snowplow-java-tracker | java |
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
- Yarn
- pnpm
npm install --save-dev @snowplow/snowtype
yarn add --dev @snowplow/snowtype
pnpm add --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.
- npm
- Yarn
- pnpm
npx @snowplow/snowtype init
# Same as
npx snowtype init
yarn @snowplow/snowtype init
# Same as
yarn snowtype init
pnpm @snowplow/snowtype init
# Same as
pnpm snowtype init
We will show example commands using npm/npx
but it should work the same with any other package manager.