{"id":23763813,"url":"https://github.com/tomashubelbauer/github-serverless-app","last_synced_at":"2026-04-26T20:32:11.762Z","repository":{"id":107986138,"uuid":"172560495","full_name":"TomasHubelbauer/github-serverless-app","owner":"TomasHubelbauer","description":"A GitHub based application with no server component","archived":false,"fork":false,"pushed_at":"2022-04-14T20:23:23.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-01T16:42:08.596Z","etag":null,"topics":["github","oauth","serverless"],"latest_commit_sha":null,"homepage":"https://tomashubelbauer.github.io/github-serverless-app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TomasHubelbauer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-02-25T18:23:03.000Z","updated_at":"2022-04-16T14:06:26.000Z","dependencies_parsed_at":"2023-05-15T00:15:32.757Z","dependency_job_id":null,"html_url":"https://github.com/TomasHubelbauer/github-serverless-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TomasHubelbauer/github-serverless-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgithub-serverless-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgithub-serverless-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgithub-serverless-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgithub-serverless-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomasHubelbauer","download_url":"https://codeload.github.com/TomasHubelbauer/github-serverless-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgithub-serverless-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32312263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T19:15:34.056Z","status":"ssl_error","status_checked_at":"2026-04-26T19:15:15.467Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","oauth","serverless"],"created_at":"2024-12-31T22:13:36.742Z","updated_at":"2026-04-26T20:32:11.755Z","avatar_url":"https://github.com/TomasHubelbauer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Serverless Application\n\nIn this repository I am exploring to see whehter it is possible to develop a GitHub Application\n(one that appears in the GitHub Marketplace) which would be just a basic GitHub Pages hosted\nstatic site.\n\nGitHub Apps are given permissions using OAuth and there are client-only OAuth flows, so in\ntheory this should work as long as GitHub provides a way to use one of those. This is a stream\nof thoughts kind of a document where I add information as I progress with the experiment. If you\nonly want to find out what the result it, scroll all the way below and if there is a resolution,\nyou'll find it there.\n\nYou can find the GitHub Pages hosted static site of this repository at this link:\n\nhttps://tomashubelbauer.github.io/github-serverless-app/\n\nThe starting point to learn about GitHub App development is available at this link:\n\nhttps://developer.github.com/apps/\n\nTurns out GitHub differentiates between GitHub Apps and OAuth Apps. Hopefully the distinction\nis not that one can only be built with a real backend. I know what they call \"OAuth Apps\"\n(basically any client of the GitHub API) can be built using only frontend technologies, because\nI have built such apps before.\n\nFrom the descriptions of the differences found at the following link:\n\nhttps://developer.github.com/apps/about-apps/\n\nIt looks like GitHub Apps are supoosed to be mostly tooling around a single repository and\na major part of their function is to act on webhooks. For my purposes (listing and categorizing\nusers repositories), it seems as though an OAuth App is a better fit.\n\nAdditionally, a developer may choose to just write a script of sorts, which uses the GitHub PAT\n(personal access token) to carry out any work impersonating the users within the granted scopes.\nThis is not at its face value that useful here, but we could built just a regulat static site\nhosted on GitHub Pages and obtain the token for it storing it in local storage thus allowing\naccess to the GitHub API without constant reauthorization.\n\nIn the draft of the application files prepared in this repository, I will try to prototype\nusing the PAT authorization and remembering the user's session.\n\nThe application needs to be registered first at:\n\nhttps://github.com/settings/applications/new\n\nIn order to obtain a `client_id`. This one's `client_id` is `a215a59b08486dd4079b`.\n\nThe app registration requires a valid callback URL for the authentication flow, which cannot\nbe a file URL, but a static file server can be used and `localhost` is allowed. In order to\ntest this application locally without having to deploy to GitHub Pages first each time,\nserve it using:\n\n```powershell\nnpx serve\n# Set the GitHub application registration a callback URL value of `http://localhost:5000`\n# Use http://localhost:5000 to access the local deployment of the site\n```\n\nThe authorization flow involves exchanging a temporary code for an access token based on a\nclient ID and a client secret. The client secret should never be leaked, which is impossible\nwithout a server-to-server call, so in this scenario - since I will be the only one using this\napplication - I am going to keep the client secret in the local storage of the machines where\nI will be using the application and will not be including it in the application's deployment.\n\nIn a scenario where the application was supposed to be used by other users, an OAuth server\ncomponent to carry out the flow using S2S communication would have been required.\n\nI hit a problem when calling `POST https://github.com/login/oauth/access_token` whereby a\nCORS error prevents my client code from making that call. The following SO answer:\n\nhttps://stackoverflow.com/a/14709863/2715716\n\nFrom a GitHub support specialist implies a solution, which I have attempted (renamed all\nthe fields to the localhost application URL) to no avail. I am guessing the localhost URL\nmight be an issue so I will try again with the GitHub Pages URL.\n\nThe OAuth application URL: https://github.com/settings/applications/993810\nThere is no risk of exposing the ID as the application is only accessible to me.\n\nAlternatively, a combination of ID and secret might be an usable alternative:\n\nhttps://developer.github.com/v3/#oauth2-keysecret\n\nSurprisingly, this method doesn't appear to work either, but not due to CORS, but instead\nit reports \"authorization required\" even with the `client_id` and `client_secret` params\nincluded. Maybe it is locked to server to server calls only, which would be understandable,\nbut unfortunate seeing as I can't make the code exchange one work.\n\nI have contacted GitHub support with a request for assistence.\n\n## To-Do\n\n### Figure out next steps\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomashubelbauer%2Fgithub-serverless-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomashubelbauer%2Fgithub-serverless-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomashubelbauer%2Fgithub-serverless-app/lists"}