---
title: GitLab Code References
description: "Connect Statsig with GitLab to surface code references for feature gates and dynamic configs, so you can see exactly where each flag is used."
product: general
token_estimate: 509
---
# GitLab Code References

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## 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.

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

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.

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

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.

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

