> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prophecy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Dependencies

> Make use of external or custom components in your projects

Dependencies allow you to reuse logic in your SQL projects, so you can build on work that's already been tested and versioned. Dependencies are scoped at the project level, and can include [packaged Prophecy projects](/data-analysis/development/extensibility/package-hub/package-hub), as well as external packages from GitHub or the dbt Hub.

Because packages can be improved over time, you can update your project dependencies whenever a new version is published. Your project will continue to use the current version until you choose to upgrade.

<img src="https://mintcdn.com/prophecy-62973bd0/Gv5A3TvHfao8H7jw/data-analysis/development/extensibility/img/sql-dependencies.png?fit=max&auto=format&n=Gv5A3TvHfao8H7jw&q=85&s=40246c8dcecef0e0497ae7b6f89886cf" alt="SQL Dependencies" width="2876" height="1594" data-path="data-analysis/development/extensibility/img/sql-dependencies.png" />

## Dependency types

There are three types of dependencies for SQL projects.

### Prophecy Project

When you import a project from the Package Hub as a dependency, you gain access to all its components, including pipelines, gems, and functions for use in your own project. If a new version of the project is [published](/data-analysis/development/versioning/version-control), you can update your dependency version to take advantage of the latest changes.

Prophecy Project dependencies have the following parameters:

| Parameter            | Description                                                                                                               |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| Project Dependencies | Choose from a dropdown list of compatible projects that are published in the Package Hub.                                 |
| Auto-upgrade         | When enabled, the package will automatically upgrade to the latest version available. No manual updates will be required. |

### GitHub

Dependencies can be saved to GitHub repositories and imported from there.

GitHub dependencies have the following parameters:

| Parameter      | Description                                                                                                                                                                                       |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Git Repository | Link to the GitHub repository containing the dependency.                                                                                                                                          |
| Revision       | Git tag, commit hash, or branch name that points to the version that you want to import.                                                                                                          |
| Sub Directory  | Path of the subdirectory in the repository that contains the dependency (if not in the root directory).                                                                                           |
| Warn unpinned  | Whether to point to your repository without specifying any version, commit, or branch. Enabling this option may result in unexpected behavior if there are changes to your latest default branch. |

### dbt Hub

Packages in the [dbt Hub](https://hub.getdbt.com/) can be used to extend typical SQL functionality. If the package contains macros, you can use them via the [Macro](/data-analysis/gems/custom/macro) gem.

dbt Hub dependencies have the following parameters:

| Parameter | Description                                        |
| --------- | -------------------------------------------------- |
| Package   | Package name or path (e.g., `dbt-labs/dbt_utils`). |
| Version   | Package version or version range.                  |

## Add a dependency to your project

To add a dependency to your project:

1. Open the project settings menu beside the project name in the project header.
2. Select **Dependencies**.
3. Click **+ Add Dependency**.
4. Choose the dependency type (Project, GitHub, or DBT Hub).
5. Fill in the required fields to import the correct package version.
6. Click **Create**.
7. Click **Reload and Save** to validate and download the new dependency.

<Note>
  Dependencies are stored at the project level within the `packages.yml` file of the project code.
</Note>

<Tip>
  You can also browse packaged projects in the [Package
  Hub](/data-analysis/development/extensibility/package-hub/package-hub) and import them from there.
</Tip>

<img src="https://mintcdn.com/prophecy-62973bd0/Gv5A3TvHfao8H7jw/data-analysis/development/extensibility/img/dbt-dependency.png?fit=max&auto=format&n=Gv5A3TvHfao8H7jw&q=85&s=40180a26971574115bcf503bcd969d8b" alt="dbt Hub dependency" width="2874" height="1620" data-path="data-analysis/development/extensibility/img/dbt-dependency.png" />

## Use dependency components in your project

When you add a dependency to your project:

* The dependency will be visible in the **Packages** section of the left sidebar. Expand a dependency to view the various functions, gems, and other components that it may contain. You can drag these components directly onto the visual canvas.

* Any gems in the package will automatically appear in the gem drawer on the canvas itself.

## Manage your project dependencies

To manage your project dependencies, there are two options:

**A)** Open your project in the Studio. Then, open the project settings menu beside the project name and select **Dependencies**.

**B)** Open your project in the Studio. Then, hover the **Packages** section of the left sidebar and click the **gear** icon.

From here, you can add, edit, update, or remove dependencies from your project.
