GitHub credentials
You can use these credentials to authenticate the following nodes:
- GitHub
- GitHub Trigger
- GitHub Document Loader: this node doesn't support OAuth.
Prerequisites
Create a GitHub (opens in a new tab) account.
Supported authentication methods
- API access token: Use this method with any GitHub nodes.
- OAuth2: Use this method with GitHub and GitHub Trigger nodes only; don't use with GitHub Document Loader.
Related resources
Refer to GitHub's API documentation (opens in a new tab) for more information about the service.
Using API access token
To configure this credential, you'll need a GitHub (opens in a new tab) account.
There are two steps to setting up this credential:
Refer to the sections below for detailed instructions.
Generate personal access token
Recommended access token type: n8n recommends using a personal access token (classic). GitHub's fine-grained personal access tokens are still in beta and can't access all endpoints.
To generate your personal access token:
- If you haven't done so already, verify your email address with GitHub. Refer to Verifying your email address (opens in a new tab) for more information.
- Open your GitHub profile Settings (opens in a new tab).
- In the left navigation, select Developer settings (opens in a new tab).
- In the left navigation, under Personal access tokens, select Tokens (classic).
- Select Generate new token > Generate new token (classic).
- Enter a descriptive name for your token in the Note field, like
n8n integration. - Select the Expiration you'd like for the token, or select No expiration.
- Select Scopes for your token. For most of the n8n GitHub nodes, add the
reposcope.- A token without assigned scopes can only access public information.
- Refer to
- Select Generate token.
- Copy the token.
Refer to Creating a personal access token (classic) (opens in a new tab) for more information. Refer to Scopes for OAuth apps (opens in a new tab) for more information on GitHub scopes.
Set up the credential
Then, in your n8n credential:
- If you aren't using GitHub Enterprise Server, don't change the GitHub server URL.
- If you're using GitHub Enterprise Server (opens in a new tab), update GitHub server to match the URL for your server.
- Enter your User name as it appears in your GitHub profile.
- Enter the Access Token you generated above.
Using OAuth2
If you're self-hosting n8n, create a new GitHub OAuth app (opens in a new tab):
- Open your GitHub profile Settings (opens in a new tab).
- In the left navigation, select Developer settings (opens in a new tab).
- In the left navigation, select OAuth apps.
- Select New OAuth App.
- If you haven't created an app before, you may see Register a new application instead. Select it.
- Enter an Application name, like
n8n integration. - Enter the Homepage URL for your app's website.
- If you'd like, add the optional Application description, which GitHub displays to end-users.
- From n8n, copy the OAuth Redirect URL and paste it into the GitHub Authorization callback URL.
- Select Register application.
- Copy the Client ID and Client Secret this generates and add them to your n8n credential.
Refer to the GitHub Authorizing OAuth apps documentation (opens in a new tab) for more information on the authorization process.