A Reflekt project is a directory of folders and files. Tracking plans are defined in the tracking-plans/ folder, while templated dbt packages are generated in the dbt-packages folder.

, , , and  are files for Python env management (not Reflekt specific).

.venv/, .envrc, poetry.lock, and pyproject.toml are files for Python env management (not Reflekt specific).

Project Configuration

Every Reflekt project has a reflekt_project.yml, setting project wide configurations. Such as:

The example below illustrates and describes the available configuration parameters:

# reflekt_project.yml - generated by 'reflekt init'

# Configurations are REQUIRED unless flagged by an # OPTIONAL comment
# Be sure to replace the auto-generated values in this file with your values
# Uncomment configurations flagged with an # OPTIONAL comment to use them

name: default_project                   # Set by 'reflekt init'. Reflekt project name

config_profile: default_profile         # Set by 'reflekt init'. Config profile in reflekt_config.yml
# config_path: [directorypath]          # OPTIONAL - overrides default path '~/.reflekt/reflekt_config.yml'

tracking_plans:                         # Tracking plan configurations
  warehouse:                            # Warehouse configuration - tells Reflekt where to find event data
    database:                           # Database configuration
      example-segment-plan: db_name       # Specify database where event data is loaded for each plan
      example-avo-plan: db_name
    schema:                             # Schema configuration
      example-segment-plan:             # Configuration for events in tracking plan 'example-plan'
        - schema: schema_name           # Specify schema where event data is loaded
      example-avo-plan:                 # Configuration for events in tracking plan 'example-plan-two'
        - schema: bad_schema_name       # A poorly named schema
          schema_alias: schema_name     # OPTIONAL - rename 'bad_schema_name' -> 'schema_name' when templating dbt package

	avo:                                  # Avo config
		branches:                           # Branches config
      # Default branch is 'main
			staging: AbC12DeFG                # Provide branch ID for other Avo branches (see Avo docs: <https://www.avo.app/docs/public-api/export-tracking-plan>)

  events:                               # Event configurations
    naming:                             # Naming convention config
      case: title                       # title|snake|camel
      allow_numbers: false              # true|false
      reserved: []                      # Reserved event names (casing matters)

    expected_metadata:                  # OPTIONAL metadata configuration
      # Define a schema for expected event metadata. Tested when running:
      #     reflekt test --name <plan-name>
      code_owner:                       # Define metadata parameter name
        required: true                  # code_owner must be included under 'metadata:' for all events
        type: string                    # Data type of metadata
        allowed:                        # Allowed metadata values
          - Jane
          - John
      priority:                         # Since 'required:' not defined, 'priority' is optional metadata parameter
        type: int
        allowed: [1, 2]

  properties:                           # Event Property configurations
    naming:                             # Naming convention config
      case: snake                       # title|snake|camel
      allow_numbers: false              # true|false
      reserved: []                      # Reserved property names (casing matters)
    data_types:                         # Allowed property data types. Available types listed below.
      - string
      - integer
      - boolean
      - number
      - object
      - array
      - any
      - 'null'                          # Specify null type in quotes

dbt:                                    # dbt configurations
  templater:                            # Configuration for Reflekt dbt package templater
    sources:                            # Configuration for dbt source
      prefix: _src_reflekt_             # Prefix for dbt sources

    models:                             # Configuration for dbt models
      prefix: reflekt_                  # Prefix for dbt models
      materialized: view                # view|incremental
      # incremental_logic: |            # OPTIONAL (if 'materialized: incremental')
      #  {%- if is_incremental() %}
      #  where received_at >= ( select max(received_at_tstamp)::date from {{ this }} )
      #  {%- endif %}

    docs:                               # Configuration for dbt docs
      prefix: _reflekt_                 # Prefix for dbt docs
      id_tests:                         # Include docs test on ID column (e.g. event_id)?
        not_null: true
        unique: true
      in_folder: false                  # Write docs in 'docs/' folder?