Authorization header. This page explains how the auth flow works, how to obtain a token, and documents every endpoint in the /api/v1/auth/ group.
How Authentication Works
- Sign in with GitHub — The user visits the BugViper
/loginpage (or a GitHub OAuth popup in the dashboard). They authorize the BugViper OAuth app, and GitHub returns a short-lived access token. - Call
/api/v1/auth/login— BugViper’s frontend sends that GitHub access token toPOST /api/v1/auth/login. The API fetches the user’s GitHub profile and creates or updates their BugViper user record. - Firebase issues an ID Token — Firebase generates a signed JWT (the ID Token) tied to the authenticated user. This token is valid for 1 hour and can be silently refreshed by the Firebase SDK.
- Pass the token on every request — Include the token as a Bearer credential in the
Authorizationheader for every protected endpoint.
Passing the Token
Here is an example using curl:Token Expiry and Refresh
Firebase ID Tokens expire after 1 hour. The BugViper frontend refreshes them automatically using the Firebase SDK’s token refresh mechanism. For server-side or scripted integrations, callgetIdToken(/* forceRefresh= */ true) on the Firebase user object before each batch of requests to ensure the token is still valid.
Auth Endpoint Reference
POST /api/v1/auth/login
Register a new user or sign in an existing one. Pass the GitHub OAuth access token obtained from GitHub’s OAuth flow. The API fetches the user’s GitHub profile and creates or updates the corresponding BugViper user record. Returns the full user profile.string
required
The GitHub OAuth access token obtained after the user completes the GitHub OAuth flow. Starts with
gho_ for classic tokens.POST /api/v1/auth/ensure
Ensures the authenticated user’s record exists. Call this on returning sessions when you already hold a valid Firebase ID Token but do not have a fresh GitHub access token — for example, when the page reloads and Firebase silently re-authenticates. No request body is required. The API identifies the user from theAuthorization header alone.
/auth/login).
Use
/api/v1/auth/ensure instead of /api/v1/auth/login for session restores. It is faster because it only verifies the existing user record without making an additional GitHub API call.GET /api/v1/auth/me
Returns the authenticated user’s profile. Use this to verify the current token is valid and to retrieve profile data without going through the login flow again.string
Firebase user ID. Uniquely identifies the user across all BugViper services.
string
The user’s email address as provided by GitHub.
string
The user’s display name from their GitHub profile.
string
The user’s GitHub username (e.g.,
alicesmith).string
URL to the user’s GitHub avatar image.
string
ISO 8601 timestamp of when the user account was first created in BugViper.
number | null
The GitHub App installation ID linked to this user’s account.
null if the GitHub App has not been installed yet.string
GitHub account type —
"User" or "Organization".string
The repository selection scope chosen when installing the GitHub App —
"all" or "selected".GET /api/v1/auth/github/repos
Returns the list of GitHub repositories accessible to the authenticated user. This is the same repository list you see when connecting repos in the BugViper dashboard.string
Short repository name (e.g.,
my-project).string
Full repository name including the owner (e.g.,
alicesmith/my-project).string | null
Repository description as set on GitHub.
string | null
Primary programming language detected by GitHub.
number
Number of GitHub stars.
boolean
Whether the repository is private.
string
Name of the repository’s default branch (e.g.,
main or master).string
URL to the repository’s GitHub page.
GET /api/v1/auth/installation
Returns the GitHub App installation status for the currently authenticated user. Use this to determine whether the user has installed the BugViper GitHub App and linked it to their account — a prerequisite for receiving PR review webhooks.boolean
true if the BugViper GitHub App is installed and successfully linked to this user’s account. false if the app has not been installed or the installation could not be resolved.number | null
The GitHub App installation ID. Present when
linked is true; null otherwise.string | null
The GitHub username associated with this account.
string | null
A direct link to the GitHub App installation settings page (
https://github.com/settings/installations/{installationId}). Present when linked is true; null otherwise.If
linked is false, direct the user to install the BugViper GitHub App from the dashboard’s Settings page. Once installed, the next call to /api/v1/auth/installation will automatically attempt to link the pending installation to the user’s account.