
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
react-google-auth
Advanced tools
Simple higher order component to load google js api, show login and handle sign in and sign out
Simple higher order component to load google js api, show login and handle sign in and sign out.
The gapi
object becomes available as a global as per normal Google's Javascript API behaviour.
yarn add react-google-auth
or npm install react-google-auth
import React from 'react';
import ReactGoogleAuth from 'react-google-auth';
function Example(props) {
console.log("gapi exists", gapi);
return <div>
<h1>App goes here</h1>
<button onClick={props.onSignOutClick}>Sign out</button>
</div>;
}
function Loader(props) {
return <div>Loading...</div>;
}
function SignIn(props) {
if(props.initializing) {
return <div className="Text Text-emphasis">Initializing...</div>;
}
if(props.error) {
console.log('Error', props.error);
return <div className="Text Text-strong">Error!</div>;
}
return <div>
<button className="Button Button-primary" onClick={props.onSignInClick}>Sign in</button>
{props.signingIn && <div>Signing in...</div>}
</div>;
}
export default ReactGoogleAuth({
clientId: "828692616521-a30cidgltv5cfhg8fbi344i9sqquj138.apps.googleusercontent.com",
discoveryDocs: ["https://sheets.googleapis.com/$discovery/rest?version=v4"],
loader: Loader,
scope: "https://www.googleapis.com/auth/spreadsheets",
signIn: SignIn
})(Example);
FAQs
Simple higher order component to load google js api, show login and handle sign in and sign out
The npm package react-google-auth receives a total of 4 weekly downloads. As such, react-google-auth popularity was classified as not popular.
We found that react-google-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.