{"id":20942180,"url":"https://github.com/getstation/electron-google-oauth2","last_synced_at":"2025-04-09T07:09:53.291Z","repository":{"id":32433535,"uuid":"133370969","full_name":"getstation/electron-google-oauth2","owner":"getstation","description":"A Google OAuth2 module for your Electron app","archived":false,"fork":false,"pushed_at":"2023-10-05T18:06:29.000Z","size":83,"stargazers_count":81,"open_issues_count":11,"forks_count":39,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-02T05:08:36.111Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"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/getstation.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-14T14:10:54.000Z","updated_at":"2025-02-04T17:52:54.000Z","dependencies_parsed_at":"2024-06-18T20:13:39.602Z","dependency_job_id":"e8a7e77c-033e-4382-b859-8e2b1a48b163","html_url":"https://github.com/getstation/electron-google-oauth2","commit_stats":{"total_commits":36,"total_committers":10,"mean_commits":3.6,"dds":0.4722222222222222,"last_synced_commit":"a2108de81ff76012b2d5bf4d2ee6632348f8f160"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getstation%2Felectron-google-oauth2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getstation%2Felectron-google-oauth2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getstation%2Felectron-google-oauth2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getstation%2Felectron-google-oauth2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getstation","download_url":"https://codeload.github.com/getstation/electron-google-oauth2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994122,"owners_count":21030050,"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":[],"created_at":"2024-11-18T23:24:10.424Z","updated_at":"2025-04-09T07:09:53.276Z","avatar_url":"https://github.com/getstation.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @getstation/electron-google-oauth2\n\u003e Library that manages Google OAuth2 authentication for your [Electron](http://electron.atom.io) app.\n\n## Install\n```\n// npm\n$ npm install --save @getstation/electron-google-oauth2\n// yarn\n$ yarn add @getstation/electron-google-oauth2\n```\n\n## Usage\n\n### Access Token\n```typescript\nimport ElectronGoogleOAuth2 from '@getstation/electron-google-oauth2';\n\napp.on('ready', () =\u003e {\n  const myApiOauth = new ElectronGoogleOAuth2(\n    'CLIENT_ID',\n    'CLIENT_SECRET',\n    ['https://www.googleapis.com/auth/drive.metadata.readonly']\n  );\n\n  myApiOauth.openAuthWindowAndGetTokens()\n    .then(token =\u003e {\n      // use your token.access_token\n    });\n});\n```\n\n### Refresh Token\n```typescript\nimport ElectronGoogleOAuth2 from '@getstation/electron-google-oauth2';\n\napp.on('ready', () =\u003e {\n  const myApiOauth = new ElectronGoogleOAuth2(\n    'CLIENT_ID',\n    'CLIENT_SECRET',\n    ['https://www.googleapis.com/auth/drive.metadata.readonly']\n  );\n  \n  const refreshToken = \\\\ Read the saved refresh token\n  \n  if(refreshToken) {\n    myApiOauth.setTokens({ refresh_token: refreshToken });\n  } else {\n    myApiOauth.openAuthWindowAndGetTokens()\n      .then(token =\u003e {\n        // save the token.refresh_token secured to use it the next time the app loading\n        // use your token.access_token\n      });\n  }\n});\n```\n\n### Use custom successRedirectURL\n```js\nconst myApiOauth = new ElectronGoogleOAuth2(\n  'CLIENT_ID',\n  'CLIENT_SECRET',\n  ['https://www.googleapis.com/auth/drive.metadata.readonly']\n  { successRedirectURL: 'https://google.com' },\n);\n```\n\n### Requires with plain JavaScript\n\n```js\nconst ElectronGoogleOAuth2 = require('@getstation/electron-google-oauth2').default;\nnew ElectronGoogleOAuth2(CLIENT_ID, CLIENT_SECRET, SCOPES_LIST);\n```\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetstation%2Felectron-google-oauth2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetstation%2Felectron-google-oauth2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetstation%2Felectron-google-oauth2/lists"}