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