0.1.0 • Published 10 months ago

@jakcharvat/capacitor-google-auth v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@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.

ParamTypeDescription
optionsInitOptions- 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

PropTypeDescription
webWebInitOptionsWeb plugin initialization options. These options are only read when the plugin is running on the web

WebInitOptions

PropTypeDescription
clientIdstringThe app's client ID, found and created in the Google Developers Console. Common for Android or iOS. The default is defined in the configuration.
scopesstring[]Specifies the scopes required for accessing Google APIs The default is defined in the configuration.

User

PropTypeDescription
idstringThe unique identifier for the user.
emailstringThe email address associated with the user.
namestringThe user's full name.
familyNamestringThe family name (last name) of the user.
givenNamestringThe given name (first name) of the user.
imageUrlstringThe URL of the user's profile picture.
serverAuthCodestringThe server authentication code.
authenticationAuthenticationThe authentication details including access, refresh and ID tokens.

Authentication

PropTypeDescription
accessTokenstringThe access token obtained during authentication.
idTokenstringThe ID token obtained during authentication.
refreshTokenstringThe refresh token.
0.1.0

10 months ago