For example, we can get a user without passing an authentication token.
GitHub API endpoints have a cURL command that you can manually translate into a fetchJSON
call (e.g. see Get a user).
Here’s a Val that returns a GitHub user object for a given username:
https://www.val.town/embed/vtdocs.getGithubUser
You can fork it and alter it, or just call it directly like this:
https://www.val.town/embed/vtdocs.getSteve
You can also do this with octokit.js. Reminder: import npm packages by prepending the package name with npm:
.