{"id":25232944,"url":"https://github.com/bradeac/usegapi","last_synced_at":"2025-06-18T20:34:04.703Z","repository":{"id":34994375,"uuid":"194728734","full_name":"bradeac/useGapi","owner":"bradeac","description":"React Hook for using Gapi (Google's SignIn Javascript authentication client)","archived":false,"fork":false,"pushed_at":"2023-01-04T02:48:28.000Z","size":2230,"stargazers_count":0,"open_issues_count":45,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-06T07:07:29.689Z","etag":null,"topics":["gapi","gapi-client","hooks-api-react","react","react-hooks","reactjs"],"latest_commit_sha":null,"homepage":null,"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/bradeac.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}},"created_at":"2019-07-01T19:03:37.000Z","updated_at":"2019-12-29T10:38:01.000Z","dependencies_parsed_at":"2023-01-15T11:45:25.972Z","dependency_job_id":null,"html_url":"https://github.com/bradeac/useGapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bradeac/useGapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradeac%2FuseGapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradeac%2FuseGapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradeac%2FuseGapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradeac%2FuseGapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradeac","download_url":"https://codeload.github.com/bradeac/useGapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradeac%2FuseGapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260629558,"owners_count":23038946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gapi","gapi-client","hooks-api-react","react","react-hooks","reactjs"],"created_at":"2025-02-11T13:37:21.844Z","updated_at":"2025-06-18T20:33:59.673Z","avatar_url":"https://github.com/bradeac.png","language":"JavaScript","readme":"# usegapi\n\n\u003e React Hook for using Gapi (Google\u0026#x27;s SignIn Javascript authentication client)\n\n[![NPM](https://img.shields.io/npm/v/usegapi.svg)](https://www.npmjs.com/package/usegapi) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Install\n\n```bash\nnpm install --save usegapi\n```\n\n## Prerequisites\n- Add a `REACT_APP_GOOGLE_CLIENT_ID` environment variable to your .env file,\ncontaining your Google client ID.  \n\n- Choose the OAuth scope(s) for the Google API that you will want to access.  \nThis scope will be passed to the hook as a parameter.\n\nIf you don't have a Google client ID, go to https://console.developers.google.com  \nList of scopes: https://developers.google.com/identity/protocols/googlescopes  \n\n## Usage\n\n```jsx\nimport React from 'react'\nimport useGapi from 'usegapi'\n\nconst Login = () =\u003e {\n    // using the readonly youtube scope for this example\n    // response will either contain the user data or an error object\n\n    const response = useGapi('https://www.googleapis.com/auth/youtube.readonly')\n\n    return (\n        \u003c\u003e\n            // mandatory div. use this exact same id !!!\n            \u003cdiv id='google-signin-button'/\u003e\n        \u003c/\u003e\n    )\n}\n```\n\n## License\n\nMIT © [bradeac](https://github.com/bradeac)\n\n---\n\nThis hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradeac%2Fusegapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradeac%2Fusegapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradeac%2Fusegapi/lists"}