You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`-g, --generateDescription`: Generate descriptions of fields (default: `false`)
28
28
-`-p, --provider <provider>`: Specify a provider (options: `openai`, `gemini`)
29
29
-`-m, --model <model>`: Specify a model (ex: `gpt-4.1-nano`, `gpt-4o-mini`, `gemini-2.0-flash-lite-001`)
30
30
-`-o, --output <output_file>`: Name of the output file (default: `tracking-schema.yaml`)
31
-
-`-c, --customFunction <function_name>`: Specify a custom tracking function
31
+
-`-c, --customFunction <function_signature>`: Specify the signature of your custom tracking function (see [instructions here](#custom-functions))
32
32
-`--format <format>`: Output format, either `yaml` (default) or `json`. If an invalid value is provided, the CLI will exit with an error.
33
33
-`--stdout`: Print the output to the terminal instead of writing to a file (works with both YAML and JSON)
34
34
35
35
🔑 **Important:** If you are using `generateDescription`, you must set the appropriate credentials for the LLM provider you are using as an environment variable. OpenAI uses `OPENAI_API_KEY` and Google Vertex AI uses `GOOGLE_APPLICATION_CREDENTIALS`.
36
36
37
-
<details>
38
-
<summary>Note on Custom Functions 💡</summary>
39
37
40
-
Use this if you have your own in-house tracker or a wrapper function that calls other tracking libraries.
38
+
### Custom Functions
41
39
42
-
We currently only support functions that follow the following format:
If you have your own in-house tracker or a wrapper function that calls other tracking libraries, you can specify the function signature with the `-c` or `--customFunction` option.
41
+
42
+
Your function signature should be in the following format:
-`EVENT_NAME` is the name of the event you are tracking. It should be a string or a pointer to a string.
48
+
-`PROPERTIES` is an object of properties for that event. It should be an object / dictionary.
49
+
- Any additional parameters are other fields you are tracking. They can be of any type. The names you provide for these parameters will be used as the property names in the output.
50
+
51
+
52
+
For example, if your function has a userId parameter at the beginning, followed by the event name and properties, you would pass in the following:
If your function follows the format `yourCustomTrackFunctionName(EVENT_NAME, PROPERTIES)`, you can simply pass in `yourCustomTrackFunctionName` to `--customFunction` as a shorthand.
0 commit comments