> ## Documentation Index
> Fetch the complete documentation index at: https://personal-ce79cb71.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Auth API — List GitHub Repos and Installation Status

> Reference for the BugViper auth endpoints that list accessible GitHub repositories and check whether the BugViper GitHub App is installed and linked.

In addition to the login and session endpoints covered in [Authentication](/api-reference/authentication), BugViper provides endpoints to list your GitHub repositories and check your GitHub App installation status. Both endpoints require a valid Firebase ID Token and are typically called immediately after sign-in to determine which repositories are available and whether the GitHub App needs to be installed.

***

## GET /api/v1/auth/github/repos

Returns the list of GitHub repositories accessible to the authenticated user. BugViper uses this list to let you select which repositories to connect and review.

**Authentication required:** Yes

```bash theme={null}
curl https://your-domain.com/api/v1/auth/github/repos \
  -H "Authorization: Bearer <token>"
```

### Response

Returns an array of repository objects.

<ResponseField name="name" type="string">
  Short repository name (e.g., `my-project`).
</ResponseField>

<ResponseField name="full_name" type="string">
  Full repository identifier in `owner/repo` format (e.g., `alicesmith/my-project`).
</ResponseField>

<ResponseField name="description" type="string | null">
  Repository description as set on GitHub.
</ResponseField>

<ResponseField name="language" type="string | null">
  Primary programming language detected by GitHub (e.g., `Python`, `TypeScript`, `Go`). `null` if GitHub has not detected a language.
</ResponseField>

<ResponseField name="stargazers_count" type="number">
  Number of GitHub stars.
</ResponseField>

<ResponseField name="private" type="boolean">
  Whether the repository is private (`true`) or public (`false`).
</ResponseField>

<ResponseField name="default_branch" type="string">
  Name of the repository's default branch (e.g., `main`, `master`).
</ResponseField>

<ResponseField name="html_url" type="string">
  URL to the repository's GitHub page.
</ResponseField>

**Example response**

```json theme={null}
[
  {
    "name": "my-project",
    "full_name": "alicesmith/my-project",
    "description": "A sample project",
    "language": "TypeScript",
    "stargazers_count": 42,
    "private": false,
    "default_branch": "main",
    "html_url": "https://github.com/alicesmith/my-project"
  }
]
```

<Warning>
  This endpoint returns `HTTP 400` if no GitHub access token is stored for the user. Make sure you have called `POST /api/v1/auth/login` at least once with a valid GitHub token before calling this endpoint.
</Warning>

***

## GET /api/v1/auth/installation

Returns whether the BugViper GitHub App is installed and linked to the current user account. Call this endpoint after sign-in to decide whether to prompt the user to install the app before they can receive reviews.

**Authentication required:** Yes

```bash theme={null}
curl https://your-domain.com/api/v1/auth/installation \
  -H "Authorization: Bearer <token>"
```

### Response

<ResponseField name="linked" type="boolean">
  `true` if the GitHub App is installed and successfully linked to the authenticated user's account, `false` otherwise.
</ResponseField>

<ResponseField name="installationId" type="number | null">
  The GitHub App installation ID associated with the user's account, or `null` if the app is not yet installed.
</ResponseField>

<ResponseField name="githubUsername" type="string | null">
  The GitHub username associated with this account.
</ResponseField>

<ResponseField name="settingsUrl" type="string | null">
  A direct link to the GitHub App installation settings page. Present when `linked` is `true`; `null` otherwise.
</ResponseField>

**Example response — linked**

```json theme={null}
{
  "linked": true,
  "installationId": 12345678,
  "githubUsername": "alicesmith",
  "settingsUrl": "https://github.com/settings/installations/12345678"
}
```

**Example response — not linked**

```json theme={null}
{
  "linked": false,
  "installationId": null,
  "githubUsername": "alicesmith",
  "settingsUrl": null
}
```

<Note>
  If `linked` is `false`, direct the user to install the BugViper GitHub App from the dashboard's **Settings** page. After installation, call this endpoint again to confirm the link was established successfully.
</Note>
