# Variable Inheritance from Packages

**URL:** <https://discourse.getdbt.com/t/variable-inheritance-from-packages/14770>\
**Category:** Help\
**Created:** [August 8, 2024, 4:26pm UTC](https://discourse.getdbt.com/t/variable-inheritance-from-packages/14770 "2024-08-08T16:26:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andyboomer](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@andyboomer](https://discourse.getdbt.com/u/andyboomer)\
**Post date:** [August 8, 2024, 4:26pm UTC](https://discourse.getdbt.com/t/variable-inheritance-from-packages/14770/1 "2024-08-08T16:26:30Z")

</div>

I am creating an importable dbt package in a private GitHub repo which consists of a set of macros. I have a small set of variables defined in the `dbt_project.yml` file for this package. These variables are accessed by the package macros using the `{{ var('<some_var>') }}` syntax.

After more carefully reading the dbt docs and trying it out, I am now seeing that the variables from the packages’ `dbt_project.yml` file are not inherited into the variables of the main project (the macros are resolved by the main project).

Most dbt packages in the packages hub don’t have vars defined in their `dbt_project.yml` files, however the `dbt-snowplow-web` package does have vars defined in their `dbt_project.yml` file that are accessed by internal project macros. For example [here](https://github.com/snowplow/dbt-snowplow-web/blob/0e4f868f6bc7c35ec154506fb48f00584c15f95a/macros/engaged_session.sql#L14). I am wondering how they get this to work? Would I just need to copy over the vars from the package into the main projects `dbt_project.yml` file or is there a better way to go about this?

Thanks!
