1.0.0 • Published 3 years ago
@gigsters/google-auth v1.0.0
@gigsters/google-auth
Ionic capacitor plugin
Install
npm install @gigsters/google-auth
npx cap sync
API
signIn()
signOut()
initialize(...)
addListener('userChanged', ...)
removeAllListeners()
renderButton()
- Interfaces
- Type Aliases
signIn()
signIn() => Promise<GoogleUser | undefined>
Returns: Promise<GoogleUser>
signOut()
signOut() => Promise<any>
Returns: Promise<any>
initialize(...)
initialize(options?: Partial<InitOptions> | undefined) => void
Param | Type |
---|---|
options | Partial<InitOptions> |
addListener('userChanged', ...)
addListener(eventName: 'userChanged', listenerFunc: (googleUser: GoogleUser) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
Param | Type |
---|---|
eventName | 'userChanged' |
listenerFunc | (googleUser: GoogleUser) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
removeAllListeners()
removeAllListeners() => Promise<void>
renderButton()
renderButton() => void
Interfaces
GoogleUser
Prop | Type |
---|---|
idToken | string |
id | string |
name | string |
email | string |
photoUrl | string |
firstName | string |
lastName | string |
accessToken | string |
InitOptions
Prop | Type | Description | Default |
---|---|---|---|
grantOfflineAccess | boolean | Set 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
Prop | Type |
---|---|
remove | () => Promise<void> |
Type Aliases
Partial
Make all properties in T optional
{ P in keyof T?: TP; }
1.0.0
3 years ago