Skip to main content

Posts

Showing posts from February, 2023

Using GitHub REST API to display your repositories with Angular

This post covers the authentication to GitHub REST API with fine-grained personal access token, sending the request to GitHub server with Octokit library, and displaying the list of your repositories in Angular component. Instructions on how to create the token can be found in GitHub documentation and will not be covered in this post.  Photo by Douglas Lopes on Unsplash    Handling your token in Angular app Before moving any application or a page that uses sensitive information such as passwords or tokens into a production, you need to be aware that sensitive data cannot be hidden from a client (user) if it is stored in the application. The best way for production use is to serve the token from a back-end or a proxy server. There are plenty of examples on how to do that, for now we will store the token in the app, so that we can focus on authentication and pulling the data from the GitHub server. Store the token in a config file Once you have created your G...