intempt.yaml
The tracking plan file: project settings, event definitions, property types, and identify and group blocks.
intempt.yaml
One file describes your whole tracking plan. intempt generate reads it to write
typed wrappers, intempt validate checks it, and intempt status compares it
against your source.
Example
version: 1
project: my-app
organization: acme
source: default
platform: browser-ts
sdk: "@intempt/browser"
output: ./src/intempt
events:
signup:
description: User creates an account
properties:
method:
type: string
required: true
enum: [email, google, apple]
referral_code:
type: string
purchase:
description: User completes a purchase
properties:
total:
type: number
required: true
currency:
type: string
required: true
payment_method:
type: string
enum: [card, paypal, bank_transfer]
identify:
properties:
email:
type: string
required: true
name:
type: stringTop-level fields
| Field | Description |
|---|---|
version | Schema version. 1 |
project | Intempt project slug |
organization | Intempt organization slug |
source | Source name events are attributed to |
platform | One of the 15 supported platforms. Decides which wrapper gets generated |
sdk | The SDK package the generated wrapper imports |
output | Directory the generated wrapper is written to |
Events
Each key under events is an event name. Each event takes an optional
description and a map of properties.
Property types
| Type | Notes |
|---|---|
string | Constrain the allowed values with enum |
number | |
integer | |
boolean | |
date | |
array | Describe the element shape with items |
object | Describe the shape with a nested properties map |
Every property also takes:
| Field | Description |
|---|---|
required | Whether the property must be present. Generated types make required properties non-optional |
enum | Allowed values, for a closed set |
description | Free text, carried into the generated code |
items | Element definition, for array |
properties | Nested definition map, for object |
Because required and enum reach the generated types, a missing property or a
value outside the enum is a compile error in your editor rather than a wrong row
you find in a report later. That is the point of generating the wrapper instead
of calling the SDK directly.
identify and group
Both take the same properties map as an event, plus an optional description.
identify describes the traits you set on a user, group the traits you set on
an account.
identify:
properties:
email:
type: string
required: true
group:
properties:
plan:
type: string
enum: [free, pro, enterprise]Validating
intempt validateChecks required fields, property types, nesting, and reserved names. Run it
before generate, and in CI if the plan is edited by more than one person.
