- Making a repo private
- Reviewing the
catalog-info.yamldefinition - Registering a component (and troubleshooting 404 errors)
- Setting up a GitHub integration with a Personal Access Token (PAT)
- Generating and securing a PAT
- Restarting Backstage and importing the entity
- Viewing your newly imported component
1. Convert Your Repository to Private
Start with your Backstage example repo (e.g.,backstage-auth-service) in a public state:

- Go to Settings → Options → Change repository visibility.
- Choose Private, confirm, and authenticate if prompted.
2. Review the Catalog Definition
Ensure yourcatalog-info.yaml defines both a Component and an API:
https://raw.githubusercontent.com/<user>/backstage-auth-service/main/catalog-info.yaml)—you’ll use it to register the location in Backstage.
Make sure the raw URL points to the
main branch (or your default branch). If you rename your branch, update the URL accordingly.3. Attempt to Register the Component
Run the Backstage CLI command to register the existingcatalog-info.yaml location:
Backstage needs authentication to access private GitHub repos. Without a token, any
raw.githubusercontent.com request returns 404.4. Configure the GitHub Integration
Edit yourapp-config.yaml to allow reading from GitHub and provide your PAT via an environment variable:
| Setting | Description | Default / Example |
|---|---|---|
| host | GitHub host (public or enterprise) | github.com |
| token | Personal Access Token (via env var) | ${GITHUB_TOKEN} |
| apiBaseUrl | (Enterprise) API endpoint | https://ghe.example.net/api/v3 |
| rawBaseUrl | (Enterprise) Raw content endpoint | https://ghe.example.net/raw |
4.1 Set the Environment Variable
After generating your PAT, export it in your shell:5. Generate a GitHub Personal Access Token
- Navigate to Settings → Developer settings → Personal access tokens → Tokens (classic) → Generate new token (classic).
- Enter a name and expiration, then check the repo scope to allow reading private repos.
- Click Generate token and copy the token immediately.


| Scope | Purpose |
|---|---|
| repo | Read and write to code, commit statuses, issues |
6. Restart Backstage and Import the Component
Save your config changes, ensureGITHUB_TOKEN is exported, and restart the dev server:

7. View the Imported Component
Head over to the Catalog in Backstage, select auth-service, and explore its overview, description, and relationships: