npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kim5257/capacitor-google-authentication

v0.0.38

Published

Google Authentication Capacitor Plugin

Downloads

14

Readme

@kim5257/capacitor-google-authentication

Google Authentication Capacitor Plugin

Install

npm install @kim5257/capacitor-google-authentication
npx cap sync

API

initialize(...)

initialize(config: GoogleAuthenticationOptions) => Promise<{ result: 'success' | 'error'; }>

| Param | Type | | ------------ | ----------------------------------------------------------------------------------- | | config | GoogleAuthenticationOptions |

Returns: Promise<{ result: 'error' | 'success'; }>


verifyPhoneNumber(...)

verifyPhoneNumber(options: { phone: string; elem?: HTMLElement; }) => Promise<{ result: 'success' | 'error'; }>

| Param | Type | | ------------- | ------------------------------------------- | | options | { phone: string; elem?: any; } |

Returns: Promise<{ result: 'error' | 'success'; }>


confirmPhoneNumber(...)

confirmPhoneNumber(options: { code: string; }) => Promise<{ result: 'success' | 'error'; }>

| Param | Type | | ------------- | ------------------------------ | | options | { code: string; } |

Returns: Promise<{ result: 'error' | 'success'; }>


createUserWithEmailAndPassword(...)

createUserWithEmailAndPassword(options: { email: string; password: string; }) => Promise<{ result: "success" | "error"; idToken: string; }>

| Param | Type | | ------------- | ------------------------------------------------- | | options | { email: string; password: string; } |

Returns: Promise<{ result: 'error' | 'success'; idToken: string; }>


signInWithEmailAndPassword(...)

signInWithEmailAndPassword(options: { email: string; password: string; }) => Promise<{ result: "success" | "error"; idToken: string; }>

| Param | Type | | ------------- | ------------------------------------------------- | | options | { email: string; password: string; } |

Returns: Promise<{ result: 'error' | 'success'; idToken: string; }>


signInWithGoogle()

signInWithGoogle() => Promise<{ result: "success" | "error"; idToken: string; }>

Returns: Promise<{ result: 'error' | 'success'; idToken: string; }>


signInWithCustomToken(...)

signInWithCustomToken({ customToken }: { customToken: string; }) => Promise<{ result: "success" | "error"; idToken: string; }>

| Param | Type | | --------- | ------------------------------------- | | __0 | { customToken: string; } |

Returns: Promise<{ result: 'error' | 'success'; idToken: string; }>


signInWithApple()

signInWithApple() => Promise<{ result: "success" | "error"; idToken: string; }>

Returns: Promise<{ result: 'error' | 'success'; idToken: string; }>


getIdToken(...)

getIdToken(options: { forceRefresh: boolean; }) => Promise<{ result: 'success' | 'error'; idToken: string; }>

| Param | Type | | ------------- | --------------------------------------- | | options | { forceRefresh: boolean; } |

Returns: Promise<{ result: 'error' | 'success'; idToken: string; }>


getCurrentUser()

getCurrentUser() => Promise<{ result: 'success' | 'error'; user: User | null | undefined; }>

Returns: Promise<{ result: 'error' | 'success'; user: User | null; }>


updateProfile(...)

updateProfile(options: { displayName?: string; photoUri?: string; }) => Promise<{ result: 'success' | 'error'; }>

| Param | Type | | ------------- | --------------------------------------------------------- | | options | { displayName?: string; photoUri?: string; } |

Returns: Promise<{ result: 'error' | 'success'; }>


updateEmail(...)

updateEmail(options: { email: string; }) => Promise<{ result: 'success' | 'error'; }>

| Param | Type | | ------------- | ------------------------------- | | options | { email: string; } |

Returns: Promise<{ result: 'error' | 'success'; }>


signOut()

signOut() => Promise<{ result: 'success' | 'error'; }>

Returns: Promise<{ result: 'error' | 'success'; }>


linkWithPhone(...)

linkWithPhone({ phone, elem }: { phone: string; elem: HTMLElement; }) => Promise<{ result: "success" | "error"; }>

| Param | Type | | --------- | ------------------------------------------ | | __0 | { phone: string; elem: any; } |

Returns: Promise<{ result: 'error' | 'success'; }>


confirmLinkPhoneNumber(...)

confirmLinkPhoneNumber(options: { code: string; }) => Promise<{ result: 'success' | 'error'; }>

| Param | Type | | ------------- | ------------------------------ | | options | { code: string; } |

Returns: Promise<{ result: 'error' | 'success'; }>


updatePhoneNumber(...)

updatePhoneNumber({ phone, elem }: { phone: string; elem: HTMLElement; }) => Promise<{ result: "success" | "error"; }>

| Param | Type | | --------- | ------------------------------------------ | | __0 | { phone: string; elem: any; } |

Returns: Promise<{ result: 'error' | 'success'; }>


confirmUpdatePhoneNumber(...)

confirmUpdatePhoneNumber(options: { code: string; }) => Promise<{ result: 'success' | 'error'; }>

| Param | Type | | ------------- | ------------------------------ | | options | { code: string; } |

Returns: Promise<{ result: 'error' | 'success'; }>


echo(...)

echo(options: { value: string; }) => Promise<{ value: string; }>

| Param | Type | | ------------- | ------------------------------- | | options | { value: string; } |

Returns: Promise<{ value: string; }>


addListener('google.auth.phone.verify.completed', ...)

addListener(eventName: 'google.auth.phone.verify.completed', listenerFunc: (resp: { idToken: string; }) => void) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | ---------------------------------------------------- | | eventName | 'google.auth.phone.verify.completed' | | listenerFunc | (resp: { idToken: string; }) => void |

Returns: Promise<PluginListenerHandle>


addListener('google.auth.phone.code.sent', ...)

addListener(eventName: 'google.auth.phone.code.sent', listenerFunc: (resp: { verificationId: string | null; resendingToken: string | null; }) => void) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | --------------------------------------------------------------------------------------------------- | | eventName | 'google.auth.phone.code.sent' | | listenerFunc | (resp: { verificationId: string | null; resendingToken: string | null; }) => void |

Returns: Promise<PluginListenerHandle>


addListener('google.auth.phone.verify.failed', ...)

addListener(eventName: 'google.auth.phone.verify.failed', listenerFunc: (resp: { message: string; }) => void) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | ---------------------------------------------------- | | eventName | 'google.auth.phone.verify.failed' | | listenerFunc | (resp: { message: string; }) => void |

Returns: Promise<PluginListenerHandle>


addListener('google.auth.state.update', ...)

addListener(eventName: 'google.auth.state.update', listenerFunc: (resp: { idToken: string; }) => void) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | ---------------------------------------------------- | | eventName | 'google.auth.state.update' | | listenerFunc | (resp: { idToken: string; }) => void |

Returns: Promise<PluginListenerHandle>


Interfaces

GoogleAuthenticationOptions

| Prop | Type | | -------------------- | --------------------------------------------- | | googleClientId | string | | persistence | 'SESSION' | 'LOCAL' | 'MEMORY' |

User

A user account.

| Prop | Type | Description | | ------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | emailVerified | boolean | Whether the email has been verified with {@link sendEmailVerification} and {@link applyActionCode}. | | isAnonymous | boolean | Whether the user is authenticated using the {@link ProviderId}.ANONYMOUS provider. | | metadata | UserMetadata | Additional metadata around user creation and sign-in times. | | providerData | UserInfo[] | Additional per provider such as displayName and profile information. | | refreshToken | string | Refresh token used to reauthenticate the user. Avoid using this directly and prefer {@link User.getIdToken} to refresh the ID token instead. | | tenantId | string | null | The user's tenant ID. |

| Method | Signature | Description | | -------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | delete | () => Promise<void> | Deletes and signs out the user. | | getIdToken | (forceRefresh?: boolean | undefined) => Promise<string> | Returns a JSON Web Token (JWT) used to identify the user to a Firebase service. | | getIdTokenResult | (forceRefresh?: boolean | undefined) => Promise<IdTokenResult> | Returns a deserialized JSON Web Token (JWT) used to identify the user to a Firebase service. | | reload | () => Promise<void> | Refreshes the user, if signed in. | | toJSON | () => object | Returns a JSON-serializable representation of this object. |

IdTokenResult

Interface representing ID token result obtained from {@link User.getIdTokenResult}.

| Prop | Type | Description | | ------------------------ | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | | authTime | string | The authentication time formatted as a UTC string. | | expirationTime | string | The ID token expiration time formatted as a UTC string. | | issuedAtTime | string | The ID token issuance time formatted as a UTC string. | | signInProvider | string | null | The sign-in provider through which the ID token was obtained (anonymous, custom, phone, password, etc). | | signInSecondFactor | string | null | The type of second factor associated with this session, provided the user was multi-factor authenticated (eg. phone, etc). | | token | string | The Firebase Auth ID token JWT string. | | claims | ParsedToken | The entire payload claims of the ID token including the standard reserved claims as well as the custom claims. |

ParsedToken

Interface representing a parsed ID token.

| Prop | Type | Description | | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | | 'exp' | string | Expiration time of the token. | | 'sub' | string | UID of the user. | | 'auth_time' | string | Time at which authentication was performed. | | 'iat' | string | Issuance time of the token. | | 'firebase' | { sign_in_provider?: string; sign_in_second_factor?: string; identities?: Record<string, string>; } | Firebase specific claims, containing the provider(s) used to authenticate the user. |

UserMetadata

Interface representing a user's metadata.

| Prop | Type | Description | | -------------------- | ------------------- | ----------------------------- | | creationTime | string | Time the user was created. | | lastSignInTime | string | Time the user last signed in. |

UserInfo

User profile information, visible only to the Firebase project's apps.

| Prop | Type | Description | | ----------------- | --------------------------- | ----------------------------------------------------------------------------------------- | | displayName | string | null | The display name of the user. | | email | string | null | The email of the user. | | phoneNumber | string | null | The phone number normalized based on the E.164 standard (e.g. +16505550101) for the user. | | photoURL | string | null | The profile photo URL of the user. | | providerId | string | The provider used to authenticate the user. | | uid | string | The user's unique ID, scoped to the project. |

PluginListenerHandle

| Prop | Type | | ------------ | ----------------------------------------- | | remove | () => Promise<void> |

Type Aliases

Record

Construct a type with a set of properties K of type T

{ [P in K]: T; }