0.1.0 • Published 10 months ago
@jakcharvat/capacitor-google-auth v0.1.0
@jakcharvat/capacitor-google-auth
A Capacitor 6 plugin for Google Auth.
Install
npm install @jakcharvat/capacitor-google-auth
npx cap sync
API
initialize(...)
initialize(options?: InitOptions | undefined) => Promise<void>
Initializes the GoogleAuthPlugin, loading the gapi library and setting up the plugin.
Param | Type | Description |
---|---|---|
options | InitOptions | - Optional initialization options. |
signIn()
signIn() => Promise<User>
Initiates the sign-in process and returns a Promise that resolves with the user information.
Returns: Promise<User>
signOut()
signOut() => Promise<void>
Signs out the user and returns a Promise.
Interfaces
InitOptions
Prop | Type | Description |
---|---|---|
web | WebInitOptions | Web plugin initialization options. These options are only read when the plugin is running on the web |
WebInitOptions
Prop | Type | Description |
---|---|---|
clientId | string | The app's client ID, found and created in the Google Developers Console. Common for Android or iOS. The default is defined in the configuration. |
scopes | string[] | Specifies the scopes required for accessing Google APIs The default is defined in the configuration. |
User
Prop | Type | Description |
---|---|---|
id | string | The unique identifier for the user. |
email | string | The email address associated with the user. |
name | string | The user's full name. |
familyName | string | The family name (last name) of the user. |
givenName | string | The given name (first name) of the user. |
imageUrl | string | The URL of the user's profile picture. |
serverAuthCode | string | The server authentication code. |
authentication | Authentication | The authentication details including access, refresh and ID tokens. |
Authentication
Prop | Type | Description |
---|---|---|
accessToken | string | The access token obtained during authentication. |
idToken | string | The ID token obtained during authentication. |
refreshToken | string | The refresh token. |
0.1.0
10 months ago