1.0.0 • Published 3 years ago

@gigsters/google-auth v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@gigsters/google-auth

Ionic capacitor plugin

Install

npm install @gigsters/google-auth
npx cap sync

API

signIn()

signIn() => Promise<GoogleUser | undefined>

Returns: Promise<GoogleUser>


signOut()

signOut() => Promise<any>

Returns: Promise<any>


initialize(...)

initialize(options?: Partial<InitOptions> | undefined) => void
ParamType
optionsPartial<InitOptions>

addListener('userChanged', ...)

addListener(eventName: 'userChanged', listenerFunc: (googleUser: GoogleUser) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
ParamType
eventName'userChanged'
listenerFunc(googleUser: GoogleUser) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


removeAllListeners()

removeAllListeners() => Promise<void>

renderButton()

renderButton() => void

Interfaces

GoogleUser

PropType
idTokenstring
idstring
namestring
emailstring
photoUrlstring
firstNamestring
lastNamestring
accessTokenstring

InitOptions

PropTypeDescriptionDefault
grantOfflineAccessbooleanSet if your application needs to refresh access tokens when the user is not present at the browser. In response use serverAuthCode key !!! Currently unsupported !!!false

PluginListenerHandle

PropType
remove() => Promise<void>

Type Aliases

Partial

Make all properties in T optional

{ P in keyof T?: TP; }