Server Rendering a GitHub Repo
Create a GitHub Personal Access Token
In this app, we are going to fetch files inside a GitHub repository using the GitHub API. To do that, we need to create a token. Creating a GitHub Personal Access Token (PAT) is the simplest way do that.
You can create it from the GitHub's account settings page. Here's how to do it:
When you are creating a GitHub PAT, you need to select a scope. Here we need the repo scope only. When you choose the repo scope, your token can read & write any GitHub repository you can access.
Now create a file called .env.local and add the following content:
GITHUB_PAT=<Enter the GitHub PAT you copied>