Check out a free preview of the full Advanced GraphQL course:
The "Github Token Setup" Lesson is part of the full, Advanced GraphQL course featured in this preview video. Here's what you'd learn in this lesson:

Scott shows how to generate private Github token to be able to query the Github API in following exercises.

Get Unlimited Access Now

Transcript from the "Github Token Setup" Lesson

[00:00:00]
>> Scott Moss: So if you run the Yarn dev command, you're probably gonna get an error. It's asking you to put some type of token. That's because we're gonna be using the GitHub API in this course. So you need to supply the repo with a GitHub token. If you look at the .env-sample file.

[00:00:16]
>> Scott Moss: You'll see this right here, it says GITHUB_TOKEN, add-your-github-token-here. So you can just copy this.
>> Scott Moss: And add this to another file called .env. I'm not gonna click on it because my token is in there. Make another file called .env and paste the contents of .env-sample in there.

[00:00:38] That's the first step. The second step is to actually go to GitHub, go into settings, Developer settings. Create a new token with public repo access and paste that token in there, and then that's it. So I'm just gonna walk through GitHub how you would do that. So if you go to GitHub,

[00:01:01]
>> Scott Moss: You click on your Profile here. You click on Settings. You click on Developer Settings, and you click on Personal Access Tokens, and then you just click on Generate New Token. Once you click on that, give it a name, you can call it whatever you want. [COUGH] And the only one you need to check is public_repo, that's it.

[00:01:22] You don't need to check anything else. In fact, I wouldn't check anything else, it's not safe. And again, add that to your .env file, with the same syntax here, GITHUB_TOKEN equals that token. And don't worry, that .env file is not checked in the Git, which is why you probably don't have one, so you gotta make it.