# GitLab Code References

## How the GitLab integration works

The Statsig GitLab Integration lets you find [Feature Gate](https://docs.statsig.com/feature-flags/overview) and [Dynamic Config](https://docs.statsig.com/dynamic-config/overview) references within your codebase on the Statsig Console. The integration uses the GitLab API to access only Feature Gate or Dynamic Config references and doesn't store any sensitive information.

## Configure GitLab code references

Create a new GitLab access token, either [project](https://docs.gitlab.com/user/project/settings/project_access_tokens/) or [personal](https://docs.gitlab.com/user/profile/personal_access_tokens/), with the `read_api` scope.

Then, log in to the Statsig Console and navigate to the GitLab Code References integration on the Integrations page.
Find this in *Project Settings > Integrations Tab > GitLab Code References*.

The integration provides instructions on how to enable GitLab Code References.

{% figure %}
![GitLab integration configuration interface](https://docs.statsig.com/images/gitlab_code_references/gitlab_integration.png)
{% /figure %}

After you enter your token and organization name, Statsig verifies it can access repositories and notifies you of any problems.

Navigate to the Feature Gates or Dynamic Configs pages on the Statsig Console and select a gate or dynamic config. Under the *Diagnostics* tab, select the **View Code References** link to see your code references.

{% figure %}
![Feature gate diagnostics page with GitLab code references link](https://docs.statsig.com/images/gitlab_code_references/feature_gate_view.png)
{% /figure %}

Code References appear based on the feature gate or dynamic config page you're on. You can filter Code References by repository and file extension.

{% figure %}
![GitLab code references table listing files and repositories](https://docs.statsig.com/images/gitlab_code_references/code_references.png)
{% /figure %}
