{"id":19417221,"url":"https://github.com/effector/effector-gatekeeper","last_synced_at":"2026-06-12T04:31:39.314Z","repository":{"id":103703487,"uuid":"251611432","full_name":"effector/effector-gatekeeper","owner":"effector","description":"☄️ now.sh stateless function for OAuth GitHub flow then exchange authorization code for a token","archived":false,"fork":false,"pushed_at":"2020-03-31T14:01:02.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-21T18:35:07.628Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gatekeeper-beryl.now.sh","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/effector.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-03-31T13:31:08.000Z","updated_at":"2021-10-12T14:40:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"286d3b9f-2457-4cf2-8e63-352748b7e02b","html_url":"https://github.com/effector/effector-gatekeeper","commit_stats":{"total_commits":4,"total_committers":3,"mean_commits":"1.3333333333333333","dds":0.5,"last_synced_commit":"8d52769a427478e461a14e3f90817e42f38ce54a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/effector/effector-gatekeeper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effector%2Feffector-gatekeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effector%2Feffector-gatekeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effector%2Feffector-gatekeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effector%2Feffector-gatekeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/effector","download_url":"https://codeload.github.com/effector/effector-gatekeeper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effector%2Feffector-gatekeeper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34229624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-10T13:08:11.152Z","updated_at":"2026-06-12T04:31:39.293Z","avatar_url":"https://github.com/effector.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"OAuth GitHub Gatekeeper\n=======================\n\n## API\n\n1. Exchage temporary code for a token\n\n    ```\n    GET /api/auth?code=\u003cCODE\u003e\n    ```\n\n## OAuth Steps\n\nAlso see the [documentation on Github](http://developer.github.com/v3/oauth/).\n\n1. Redirect users to request GitHub access.\n\n   ```\n   GET https://github.com/login/oauth/authorize\n   ```\n\n2. GitHub redirects back to your site including a temporary code you need for the next step.\n\n   You can grab it like so:\n\n   ```js\n   const params = new URLSearchParams(location.search)\n   const code = params.get('code')\n   ```\n\n3. Request the actual token using your instance of Gatekeeper, which knows your `OAUTH_CLIENT_SECRET`.\n\n   ```js\n   const GITHUB_GATEKEEPER_URL = process.env.NODE_ENV === 'development'\n     ? 'http://localhost:3000/api/auth'\n     : 'https://gatekeeper.YOUNAME.now.sh/api/auth'\n\n   const url = new URL(GITHUB_GATEKEEPER_URL)\n   url.searchParams.set('code', code)\n   try {\n     const res = await fetch(url)\n     if (res.ok) {\n       const {token} = await res.json()\n       console.log(token)\n     }\n   } catch (e) {\n     // bad code\n   }\n   ```\n\n## Setup your Gatekeeper\n\n1. Clone it\n\n    ```\n    git clone git@github.com:kobzarvs/github-gatekeeper.git\n    ```\n\n2. Install Dependencies\n\n    ```\n    cd gatekeeper \u0026\u0026 yarn\n    ```\n   \n3. Run local dev environment\n\n    First of all you must create `.env` file:\n    \n    ```\n    OAUTH_CLIENT_SECRET=\u003cOAUTH_CLIENT_SECRET\u003e\n    OAUTH_CLIENT_ID=\u003cOAUTH_CLIENT_ID\u003e\n    ```\n\n    ```\n    now dev\n    ```\n\n## Deploy on now.sh\n\n1. Add secrets env variables\n\n    ```\n    now secrets add OAUTH_CLIENT_SECRET \u003cOAUTH_CLIENT_SECRET\u003e \n    now secrets add OAUTH_CLIENT_ID \u003cOAUTH_CLIENT_ID\u003e\n    ``` \n\n2. Deploy service\n\n    ```\n    now\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffector%2Feffector-gatekeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feffector%2Feffector-gatekeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffector%2Feffector-gatekeeper/lists"}