Reports wallet name, GitHub login, and GitHub URL for the current authenticated user, the first bit of the token, and the associated scopes.
Authentication token. Defaults to
Github API url (default: https://api.github.com). Used
Named character vector of header field values
Get a personal access token for the GitHub API from
https://github.com/settings/tokens and select the scopes necessary for
your planned tasks. The
repo scope, for example, is one many are
likely to need. The token itself is a string of 40 letters and digits. You
can store it any way you like and provide explicitly via the
However, many prefer to define an environment variable
GITHUB_TOKEN) with this value in their
.Renviron file. Add a
line that looks like this, substituting your PAT:
Put a line break at the end! If you’re using an editor that shows line
numbers, there should be (at least) two lines, where the second one is empty.
Restart R for this to take effect. Call
gh_whoami() to confirm
To get complete information on the authenticated user, call
For token management via API (versus the browser), use the Authorizations API. This API requires Basic Authentication using your username and password, not tokens, and is outside the scope of the gh package.
gh_response object, which is also a
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.