GitHub Integration
Learn how to enable private repository access for Nia AI
This guide explains how to set up and use GitHub integration with Nia AI, allowing secure access to your private repositories.
Overview
Nia AI supports seamless integration with GitHub, enabling you to:
-
Access and index private repositories
-
Maintain secure authentication
-
Manage repository permissions
-
Handle real-time updates
Authentication Flow
Install GitHub App
-
Navigate to your Nia AI dashboard
-
Click “Connect GitHub” button
-
You’ll be redirected to GitHub’s authorization page
Grant Permissions
Select the repositories you want to give Nia AI access to:
-
Choose specific repositories
-
Or grant access to all repositories
Verify Installation
After installation, Nia AI will:
-
Generate a unique installation token
-
Validate the connection
-
Show connected repositories in your dashboard
Repository Access
Security Model
Installation Tokens
Installation Tokens
Nia AI uses GitHub App installation tokens for authentication:
-
Tokens are automatically rotated every hour
-
Scoped to specific repositories
-
Encrypted at rest
Permission Scopes
Permission Scopes
The GitHub App requires these permissions:
-
contents: read
- Read repository contents -
metadata: read
- Read repository metadata -
issues: read
- Read repository issues (optional)
API Reference
List Repositories
Returns a list of repositories the user has granted access to.
Save Installation
Saves a new GitHub App installation for a user.
Uninstall App
Removes a GitHub App installation.
Error Handling
Common Error Codes
Code | Description | Solution |
---|---|---|
401 | Invalid installation token | Refresh token or reinstall app |
403 | Repository access denied | Check repository permissions |
404 | Repository not found | Verify repository exists and is accessible |
422 | Invalid repository format | Use owner/repo format |
Best Practices
Repository Access
-
Grant access only to needed repositories
-
Regularly review repository permissions
-
Remove unused repository access
Security
-
Never share installation tokens
-
Use branch protection rules
-
Monitor GitHub audit logs
Troubleshooting
Installation Failed
Installation Failed
If installation fails:
-
Check GitHub organization permissions
-
Verify you have admin access
-
Try reinstalling the app
Repository Not Visible
Repository Not Visible
If a repository is not visible:
-
Verify repository permissions
-
Check installation scope
-
Refresh repository list
Token Errors
Token Errors
For token-related errors:
-
Check installation status
-
Verify repository access
-
Reinstall if necessary
FAQ
How secure is the GitHub integration?
How secure is the GitHub integration?
Nia AI uses GitHub’s official App integration with:
-
Installation-specific tokens
-
Encrypted storage
-
Regular token rotation
-
Limited repository scope
Can I limit repository access?
Can I limit repository access?
Yes, you can:
-
Choose specific repositories during installation
-
Modify permissions after installation
-
Remove access at any time
What happens if I uninstall the app?
What happens if I uninstall the app?
When you uninstall:
-
All tokens are immediately revoked
-
Repository access is removed
-
Indexed data is preserved
-
You can reinstall later