Snowtype configuration options
The Snowtype CLI configuration can be saved in a .json
, .js
, or .ts
file after initialization. For example: snowtype.config.json
, snowtype.config.js
, or snowtype.config.ts
. We highly recommend you keep this file in the root of your project folder.
Attributes in your configuration fileโ
igluCentralSchemas
โ
The schema tracking URLs for schemas available in Iglu Central.
repositories
โ
Local Data Structure repositories generated from the snowplow-cli.
dataStructures
โ
The schema tracking URLs for Data Structures published in the Console.
eventSpecificationIds
โ
The Event Specification IDs you wish to generate tracking code for. The Event Specification ID is a UUID that can be retrieved as the final part of the URL when visiting an event specification main page.
dataProductIds
โ
The Data Product IDs you wish to generate tracking code for. By providing the Data Product Id, Snowtype will fetch all the event specifications for the Data Product and generate code for all of them. The Data Product ID is a UUID that can be retrieved as the final part of the URL when visiting a data product main page.
organizationId
โ
The Organization ID for your Snowplow BDP account. The Organization ID is a UUID that can be retrieved from the URL immediately following the .com when visiting console.
tracker
โ
The target tracker to generate the required code for. See list of available trackers.
language
โ
The target language to generate the required code for. See list of available languages.
outpath
โ
The outpath relative to the current working directory when running the script.
options
โ
Options related to Snowtype behavior and are described by the following TypeScript type:
options?: {
/* Command related options. */
commands: {
generate?: {
/* Generate implementation instructions. */
instructions?: boolean;
/* Add runtime validations. */
validations?: boolean;
/* Disallow generation of code using schemas only deployed on DEV environment. */
disallowDevSchemas?: boolean;
/* Show deprecation warnings only when there are PROD available schema updates. */
deprecateOnlyOnProdAvailableUpdates?: boolean;
}
update?: {
/* Update your configuration file automatically and regenerate the code of the latest available update. */
regenerateOnUpdate?: boolean;
/* The maximum SchemaVer update to show an available update notification for. */
maximumBump?: "major" | "minor" | "patch";
/* The `update` command will only display updates for Data Structures that have been deployed to production environment. */
showOnlyProdUpdates?: boolean;
}
patch?: {
/* Automatically regenerate the code after a successful patch operation. */
regenerateOnPatch?: boolean;
}
}
}
Keep in mind that CLI flags take precedence over configuration file options.
Example configuration fileโ
- JSON
- JavaScript
- TypeScript
{
"igluCentralSchemas": ["iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0"],
"repositories": ["../data-structures"],
"dataStructures": ["iglu:com.myorg/custom_web_page/jsonschema/1-1-0"],
"eventSpecificationIds": [
"a123456b-c222-11d1-e123-1f123456789g"
],
"dataProductIds": [
"a123456b-c222-11d1-e123-1f12345678dp"
],
"organizationId": "a654321b-c111-33d3-e321-1f123456789g",
"tracker": "@snowplow/browser-tracker",
"language": "typescript",
"outpath": "./src/snowtype"
}
const config = {
"igluCentralSchemas": ["iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0"],
"repositories": ["../data-structures"],
"dataStructures": ["iglu:com.myorg/custom_web_page/jsonschema/1-1-0"],
"eventSpecificationIds": [
"a123456b-c222-11d1-e123-1f123456789g"
],
"dataProductIds": [
"a123456b-c222-11d1-e123-1f12345678dp"
],
"organizationId": "a654321b-c111-33d3-e321-1f123456789g",
"tracker": "@snowplow/browser-tracker",
"language": "typescript",
"outpath": "./src/snowtype"
}
module.exports = config;
type SnowtypeConfig = {
tracker:
| "@snowplow/browser-tracker"
| "@snowplow/javascript-tracker"
| "snowplow-android-tracker"
| "snowplow-ios-tracker"
| "@snowplow/node-tracker"
| "snowplow-golang-tracker"
| "@snowplow/react-native-tracker";
language: "typescript" | "javascript" | "kotlin" | "swift" | "go";
outpath: string;
organizationId?: string;
igluCentralSchemas?: string[];
repositories?: string[];
dataStructures?: string[];
eventSpecificationIds?: string[];
dataProductIds?: string[];
options?: {
commands: {
generate?: {
instructions?: boolean;
validations?: boolean;
disallowDevSchemas?: boolean;
deprecateOnlyOnProdAvailableUpdates?: boolean;
}
update?: {
regenerateOnUpdate?: boolean;
maximumBump?: "major" | "minor" | "patch";
showOnlyProdUpdates?: boolean;
}
patch?: {
regenerateOnPatch?: boolean
}
}
}
};
const config: SnowtypeConfig = {
"igluCentralSchemas": ["iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0"],
"repositories": ["../data-structures"],
"dataStructures": ["iglu:com.myorg/custom_web_page/jsonschema/1-1-0"],
"eventSpecificationIds": [
"a123456b-c222-11d1-e123-1f123456789g"
],
"dataProductIds": [
"a123456b-c222-11d1-e123-1f12345678dp"
],
"organizationId": "a654321b-c111-33d3-e321-1f123456789g",
"tracker": "@snowplow/browser-tracker",
"language": "typescript",
"outpath": "./src/snowtype"
};
export default config;