Options
All
  • Public
  • Public/Protected
  • All
Menu

Module index

Index

References

AuthorizeValue

Re-exports AuthorizeValue

GoogleAuthValue

Re-exports GoogleAuthValue

GoogleUserValue

Re-exports GoogleUserValue

useAuthorize

Re-exports useAuthorize

useGoogleAuth

Re-exports useGoogleAuth

useGoogleUser

Re-exports useGoogleUser

Type aliases

GApiProps

GApiProps: { children: ReactNode; clientConfig: gapi.auth2.ClientConfig }

Type declaration

GApiValue

GApiValue: { clientConfig: gapi.auth2.ClientConfig; error: Error | null; isAuth2Loaded: boolean; isPlatformLoaded: boolean }

Type declaration

SignInButtonProps

SignInButtonProps: { id?: string; options?: { height?: number; longtitle?: boolean; scope?: string; theme?: "light" | "dark"; width?: number; onfailure?: any; onsuccess?: any } }

Type declaration

  • Optional id?: string

    The ID of the element in which to render the sign-in button.

  • Optional options?: { height?: number; longtitle?: boolean; scope?: string; theme?: "light" | "dark"; width?: number; onfailure?: any; onsuccess?: any }

    An object containing the settings to use to render the button.

    • Optional height?: number

      The height of the button in pixels (default: 36).

    • Optional longtitle?: boolean

      Display long labels such as "Sign in with Google" rather than "Sign in" (default: false). When you use long titles, you should increase the width of the button from its default.

    • Optional scope?: string

      The scopes to request when the user signs in (default: profile).

    • Optional theme?: "light" | "dark"

      The color theme of the button: either light or dark (default: light).

    • Optional width?: number

      The width of the button in pixels (default: 120).

    • onfailure: function
      • onfailure(reason: { error: string }): void
      • The callback function to call when sign-in fails. This function takes no arguments (default: none).

        Parameters

        • reason: { error: string }
          • error: string

        Returns void

    • onsuccess: function
      • onsuccess(googleUser: GoogleUser): void
      • The callback function to call when a user successfully signs in. This function must take one argument: an instance of gapi.auth2.GoogleUser (default: none).

        Parameters

        • googleUser: GoogleUser

        Returns void

Variables

Const GApiProvider

GApiProvider: FC<GApiProps> = ...

Loads the necessary gapi libraries. This is simply a wrapper for the various Auth Setup methods described here: https://developers.google.com/identity/sign-in/web/reference#auth_setup

You must wrap your application with GApiProvider to use any of the hooks (useAuthentication, useUsers and useAuthroize).

Const SignInButton

SignInButton: FC<SignInButtonProps> = ...

Render the default sign in button provided by gapi.signin2.render

Functions

Const useGApiContext

Generated using TypeDoc