Erste Schritte
Kopiere einen Setup-Prompt mit den Installationsschritten und dem vollständigen Markdown-Guide für dieses Plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-firebase-authentication`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/firebase-authentication/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Installieren
Abschnitt „Installation“Du kannst unser KI-gestütztes Setup nutzen, um das Plugin zu installieren. Füge die Capgo Skills mit dem folgenden Befehl deinem KI-Tool hinzu:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsNutze dann diesen Prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-firebase-authentication` plugin in my project.Wenn du ein manuelles Setup bevorzugst, installiere das Plugin mit den folgenden Befehlen und befolge die plattformspezifischen Anweisungen unten:
bun add @capgo/capacitor-firebase-authenticationnpx cap syncImportieren
Abschnitt mit dem Titel „Import“import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';Quickstart
Abschnitt „Quick start“import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.applyActionCode({ oobCode: 'oob-code' });Beispiel: confirmPasswordReset
Abschnitt mit dem Titel „Beispiel: confirmPasswordReset“import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.confirmPasswordReset({ oobCode: 'oob-code', newPassword: 'new-password',});Beispiel: confirmVerificationCode
Abschnitt mit dem Titel „Beispiel: confirmVerificationCode“import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.confirmVerificationCode({ verificationId: 'phoneCodeSent', verificationCode: 'phoneCodeSent',});// The result holds sensitive values: use it without logging it.Häufige Stolperfallen
Abschnitt „Häufige Fallstricke“- Listener: Handles beim Unmounten von Screens entfernen.
- Nativer Sync: ausführen
npx cap syncnach Plugin-Upgrades. - Single Source of Truth: Vertrauen
src/definitions.tsim GitHub Repo.
API Übersicht
Abschnitt „API Übersicht“applyActionCode
Abschnitt „applyActionCode“Wendet einen Verifizierungs-code an, den der Nutzer per E-Mail erhalten hat.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.applyActionCode({ oobCode: 'oob-code' });confirmPasswordReset
Abschnitt „confirmPasswordReset“Schließt den Passwort-Reset ab.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.confirmPasswordReset({ oobCode: 'oob-code', newPassword: 'new-password',});confirmVerificationCode
Abschnitt „confirmVerificationCode“Schließt die Telefonnummer-Verifizierung ab.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.confirmVerificationCode({ verificationId: 'phoneCodeSent', verificationCode: 'phoneCodeSent',});// The result holds sensitive values: use it without logging it.createUserWithEmailAndPassword
Abschnitt „createUserWithEmailAndPassword“Erstellt ein neues Benutzerkonto mit E-Mail und Passwort. Wenn das neue Konto erstellt wurde, wird der Nutzer automatisch angemeldet.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.createUserWithEmailAndPassword({ email: 'user@example.com', password: 'password',});// The result holds sensitive values: use it without logging it.deleteUser
Abschnitt „deleteUser“Löscht den Benutzer und meldet ihn ab.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.deleteUser();fetchSignInMethodsForEmail
Abschnitt „fetchSignInMethodsForEmail“Ruft die Anmeldemethoden für eine E-Mail-Adresse ab.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.fetchSignInMethodsForEmail({ email: 'user@example.com' });console.log(result);getCurrentUser
Abschnitt „getCurrentUser“Ruft den aktuell angemeldeten Benutzer ab.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getCurrentUser();// The result holds sensitive values: use it without logging it.getPendingAuthResult
Abschnitt „getPendingAuthResult“Gibt den SignInResult falls deine App einen Web-Sign-in-Flow gestartet hat und das OS die App im Hintergrund beendet.
Nur für Android verfügbar.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getPendingAuthResult();// The result holds sensitive values: use it without logging it.getIdToken
Abschnitt mit dem Titel „getIdToken“Ruft das Firebase Auth ID Token für den aktuell angemeldeten Benutzer ab.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getIdToken();// The result holds sensitive values: use it without logging it.getIdTokenResult
Abschnitt mit dem Titel „getIdTokenResult“Gibt ein deserialisiertes JSON Web Token (JWT) zurück, mit dem der Benutzer gegenüber einem Firebase-Service identifiziert wird.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getIdTokenResult();// The result holds sensitive values: use it without logging it.getRedirectResult
Abschnitt mit dem Titel „getRedirectResult“Gibt den SignInResult aus dem redirect-basierten Sign-in-Flow.
Wenn die Anmeldung nicht erfolgreich war, schlägt sie mit einem Fehler fehl.
Wenn keine Redirect-Operation aufgerufen wurde, wird ein SignInResult mit einem null-Benutzer.
Nur für Web verfügbar.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getRedirectResult();// The result holds sensitive values: use it without logging it.getTenantId
Abschnitt mit dem Titel „getTenantId“Tenant-ID abrufen.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getTenantId();console.log(result);isSignInWithEmailLink
Abschnitt mit dem Titel „isSignInWithEmailLink“Prüft, ob ein eingehender Link ein für den Sign-in per E-Mail-Link geeigneter Link ist signInWithEmailLink.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.isSignInWithEmailLink({ emailLink: 'https://example.com' });// The result holds sensitive values: use it without logging it.linkWithApple
Abschnitt mit dem Titel „linkWithApple“Verknüpft das Benutzerkonto mit dem Apple Authentication Provider.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithApple();// The result holds sensitive values: use it without logging it.linkWithEmailAndPassword
Abschnitt mit dem Titel „linkWithEmailAndPassword“Verknüpft das Benutzerkonto mit dem E-Mail-Authentifizierungsanbieter.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithEmailAndPassword({ email: 'user@example.com', password: 'password',});// The result holds sensitive values: use it without logging it.linkWithEmailLink
Abschnitt mit dem Titel „linkWithEmailLink“Verknüpft das Benutzerkonto mit dem E-Mail-Authentifizierungsanbieter.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithEmailLink({ email: 'user@example.com', emailLink: 'https://example.com',});// The result holds sensitive values: use it without logging it.linkWithFacebook
Abschnitt mit dem Titel “linkWithFacebook”Verknüpft das Benutzerkonto mit dem Facebook Authentication Provider.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithFacebook();// The result holds sensitive values: use it without logging it.linkWithGameCenter
Abschnitt mit dem Titel “linkWithGameCenter”Verknüpft das Benutzerkonto mit dem Game Center Authentication Provider.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
Nur für iOS verfügbar.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithGameCenter();// The result holds sensitive values: use it without logging it.linkWithGithub
Abschnitt mit dem Titel “linkWithGithub”Verknüpft das Benutzerkonto mit dem GitHub Authentication Provider.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithGithub();// The result holds sensitive values: use it without logging it.linkWithGoogle
Abschnitt mit dem Titel „linkWithGoogle“Verknüpft das Benutzerkonto mit dem Google Authentication Provider.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithGoogle();// The result holds sensitive values: use it without logging it.linkWithMicrosoft
Abschnitt mit dem Titel „linkWithMicrosoft“Verknüpft das Benutzerkonto mit dem Microsoft Authentication Provider.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithMicrosoft();// The result holds sensitive values: use it without logging it.linkWithOpenIdConnect
Abschnitt „linkWithOpenIdConnect“Verknüpft das Benutzerkonto mit einem OpenID-Connect-Provider.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithOpenIdConnect({ providerId: 'provider-id-123' });// The result holds sensitive values: use it without logging it.linkWithPhoneNumber
Abschnitt „linkWithPhoneNumber“Verknüpft das Benutzerkonto mit dem Phone-Number-Authentication-Provider.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
Nutze das phoneVerificationCompleted Listener, der benachrichtigt wird, wenn die Verifizierung abgeschlossen ist.
Nutze den phoneVerificationFailed Listener, der benachrichtigt wird, wenn die Verifizierung fehlgeschlagen ist.
Nutze den phoneCodeSent Listener, um die Verification ID zu erhalten.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithPhoneNumber({ phoneNumber: "+16505550101" });linkWithPlayGames
Abschnitt mit dem Titel „linkWithPlayGames“Verknüpft das Benutzerkonto mit dem Play Games Authentication Provider.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
Nur für Android verfügbar.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithPlayGames();// The result holds sensitive values: use it without logging it.linkWithTwitter
Abschnitt mit dem Titel „linkWithTwitter“Verknüpft das Benutzerkonto mit dem Twitter Authentication Provider.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithTwitter();// The result holds sensitive values: use it without logging it.linkWithYahoo
Abschnitt „linkWithYahoo“Verknüpft das Benutzerkonto mit dem Authentifizierungsanbieter Yahoo.
Der Benutzer muss auf der nativen Ebene eingeloggt sein.
Der skipNativeAuth Diese Konfigurationsoption hat hier keine Wirkung.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithYahoo();// The result holds sensitive values: use it without logging it.reload
Abschnitt „reload“Lädt die Benutzerkontodaten neu, falls angemeldet.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.reload();revokeAccessToken
Abschnitt „revokeAccessToken“Widerruft den angegebenen Access Token. Derzeit werden nur Apple OAuth Access Tokens unterstützt.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.revokeAccessToken({ token: 'token-123' });sendEmailVerification
Abschnitt mit dem Titel “sendEmailVerification”Sendet eine Verifizierungs-E-Mail an den aktuell angemeldeten Benutzer.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendEmailVerification();sendPasswordResetEmail
Abschnitt mit dem Titel “sendPasswordResetEmail”Sendet eine E-Mail zum Zurücksetzen des Passworts.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendPasswordResetEmail({ email: 'user@example.com' });sendSignInLinkToEmail
Abschnitt mit dem Titel “sendSignInLinkToEmail”Sendet dem Benutzer mit der angegebenen E-Mail-Adresse einen Anmelde-Link per E-Mail.
Um die Anmeldung per E-Mail-Link abzuschließen, rufen Sie auf signInWithEmailLink mit der E-Mail-Adresse und dem E-Mail-Link, der in der an den Benutzer gesendeten E-Mail angegeben wurde.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendSignInLinkToEmail({ email: 'user@example.com', actionCodeSettings: { url: 'https://example.com' },});setLanguageCode
Abschnitt mit dem Titel “setLanguageCode”Legt die für Benutzer sichtbare Sprache code für Auth-Operationen fest.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setLanguageCode({ languageCode: "en-US" });setPersistence
Abschnitt mit dem Titel „setPersistence“Legt den Persistenztyp für die aktuell gespeicherte Auth-Session fest.
Nur für Web verfügbar.
import { FirebaseAuthentication, Persistence } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setPersistence({ persistence: Persistence.IndexedDbLocal });setTenantId
Abschnitt mit dem Titel „setTenantId“Legt die Tenant-ID fest.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setTenantId({ tenantId: 'tenant-id-123' });signInAnonymously
Abschnitt mit dem Titel „signInAnonymously“Meldet sich als anonymen Benutzer an.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInAnonymously();// The result holds sensitive values: use it without logging it.signInWithApple
Abschnitt „signInWithApple“Startet den Apple-Sign-in-Flow.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithApple();// The result holds sensitive values: use it without logging it.signInWithCustomToken
Abschnitt „signInWithCustomToken“Startet den Custom-Token-Sign-in-Flow.
Diese Methode kann nicht in Kombination mit skipNativeAuth auf Android und iOS verwendet werden.
In diesem Fall musst du das signInWithCustomToken Interface des Firebase JS SDK direkt verwenden.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithCustomToken({ token: 'token-123' });// The result holds sensitive values: use it without logging it.signInWithEmailAndPassword
Abschnitt „signInWithEmailAndPassword“Startet den Sign-in-Flow mit E-Mail und Passwort.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithEmailAndPassword({ email: 'user@example.com', password: 'password',});// The result holds sensitive values: use it without logging it.signInWithEmailLink
Abschnitt mit dem Titel “signInWithEmailLink”Meldet sich mit einer E-Mail-Adresse und einem E-Mail-Link an.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithEmailLink({ email: 'user@example.com', emailLink: 'https://example.com',});// The result holds sensitive values: use it without logging it.signInWithFacebook
Abschnitt mit dem Titel “signInWithFacebook”Startet den Facebook-Anmelde-Flow.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithFacebook();// The result holds sensitive values: use it without logging it.signInWithGameCenter
Abschnitt mit dem Titel “signInWithGameCenter”Startet den Anmelde-Flow für Game Center.
Nur für iOS verfügbar.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithGameCenter();// The result holds sensitive values: use it without logging it.signInWithGithub
Abschnitt mit dem Titel “signInWithGithub”Startet den GitHub-Sign-in-Flow.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithGithub();// The result holds sensitive values: use it without logging it.signInWithGoogle
Abschnitt mit dem Titel “signInWithGoogle”Startet den Google-Sign-in-Flow.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithGoogle();// The result holds sensitive values: use it without logging it.signInWithMicrosoft
Abschnitt mit dem Titel “signInWithMicrosoft”Startet den Microsoft-Sign-in-Flow.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithMicrosoft();// The result holds sensitive values: use it without logging it.signInWithOpenIdConnect
Abschnitt mit dem Titel “signInWithOpenIdConnect”Startet den OpenID-Connect-Sign-in-Flow.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithOpenIdConnect({ providerId: 'provider-id-123' });// The result holds sensitive values: use it without logging it.signInWithPhoneNumber
Abschnitt mit dem Titel “signInWithPhoneNumber”Startet den Sign-in-Flow per Telefonnummer.
Nutze das phoneVerificationCompleted Listener, der benachrichtigt wird, wenn die Verifizierung abgeschlossen ist.
Nutze den phoneVerificationFailed Listener, der benachrichtigt wird, wenn die Verifizierung fehlgeschlagen ist.
Nutze den phoneCodeSent Listener, um die Verification ID zu erhalten.
Nur für Android und iOS verfügbar.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithPhoneNumber({ phoneNumber: "+16505550101" });signInWithPlayGames
Abschnitt mit dem Titel „signInWithPlayGames“Startet den Play-Games-Sign-in-Flow.
Nur für Android verfügbar.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithPlayGames();// The result holds sensitive values: use it without logging it.signInWithTwitter
Abschnitt mit dem Titel „signInWithTwitter“Startet den Twitter-Sign-in-Flow.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithTwitter();// The result holds sensitive values: use it without logging it.signInWithYahoo
Abschnitt mit dem Titel “signInWithYahoo”Startet den Yahoo-Sign-in-Flow.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithYahoo();// The result holds sensitive values: use it without logging it.Startet den Sign-out-Flow.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signOut();Entkoppelt einen Provider von einem Benutzerkonto.
import { FirebaseAuthentication, ProviderId } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.unlink({ providerId: ProviderId.APPLE });// The result holds sensitive values: use it without logging it.updateEmail
Abschnitt mit dem Titel “updateEmail”Aktualisiert die E-Mail-Adresse des aktuell angemeldeten Benutzers.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updateEmail({ newEmail: 'user@example.com' });updatePassword
Abschnitt „updatePassword“Aktualisiert das Passwort des aktuell angemeldeten Benutzers.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updatePassword({ newPassword: 'new-password' });updateProfile
Abschnitt „updateProfile“Aktualisiert die Profildaten eines Benutzers.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updateProfile({ displayName: 'display', photoUrl: 'https://example.com',});useAppLanguage
Abschnitt „useAppLanguage“Setzt die für Nutzer sichtbare Sprache code als Standardsprache der App.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.useAppLanguage();useEmulator
Abschnitt „useEmulator“Instrumentiere deine App für die Kommunikation mit dem Authentication-Emulator.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.useEmulator({ host: "127.0.0.1" });verifyBeforeUpdateEmail
Abschnitt „verifyBeforeUpdateEmail“Verifiziert die neue E-Mail-Adresse, bevor die E-Mail-Adresse des aktuell angemeldeten Benutzers aktualisiert wird.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.verifyBeforeUpdateEmail({ newEmail: 'user@example.com' });checkAppTrackingTransparencyPermission
Abschnitt „checkAppTrackingTransparencyPermission“Prüft den aktuellen Status der App Tracking Transparency.
Nur auf iOS verfügbar.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.checkAppTrackingTransparencyPermission();console.log(result);requestAppTrackingTransparencyPermission
Abschnitt „requestAppTrackingTransparencyPermission“Öffnet den Systemdialog, um App Tracking Transparency zu autorisieren.
Achtung: Möglicherweise hat der Benutzer die Tracking-Anfrage in den Geräteeinstellungen deaktiviert, siehe Apples Dokumentation.
Nur auf iOS verfügbar.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.requestAppTrackingTransparencyPermission();console.log(result);Typreferenz
Abschnitt mit dem Titel „Typreferenz“ApplyActionCodeOptions
Abschnitt „ApplyActionCodeOptions“export interface ApplyActionCodeOptions { /** * A verification code sent to the user. * * @since 0.2.2 */ oobCode: string;}ConfirmPasswordResetOptions
Abschnitt „ConfirmPasswordResetOptions“export interface ConfirmPasswordResetOptions { /** * A verification code sent to the user. * * @since 0.2.2 */ oobCode: string; /** * The new password. * * @since 0.2.2 */ newPassword: string;}ConfirmVerificationCodeOptions
Abschnitt „ConfirmVerificationCodeOptions“export interface ConfirmVerificationCodeOptions { /** * The verification ID received from the `phoneCodeSent` listener. * * The `verificationCode` option must also be provided. * * @since 5.0.0 */ verificationId: string; /** * The verification code either received from the `phoneCodeSent` listener or entered by the user. * * The `verificationId` option must also be provided. * * @since 5.0.0 */ verificationCode: string;}SignInResult
Abschnitt „SignInResult“export interface SignInResult { /** * The currently signed-in user, or null if there isn't any. * * @since 0.1.0 */ user: User | null; /** * Credentials returned by an auth provider. * * @since 0.1.0 */ credential: AuthCredential | null; /** * Additional user information from a federated identity provider. * * @since 0.5.1 */ additionalUserInfo: AdditionalUserInfo | null;}CreateUserWithEmailAndPasswordOptions
Abschnitt mit dem Titel “CreateUserWithEmailAndPasswordOptions”export interface CreateUserWithEmailAndPasswordOptions { /** * @since 0.2.2 */ email: string; /** * @since 0.2.2 */ password: string;}FetchSignInMethodsForEmailOptions
Abschnitt mit dem Titel “FetchSignInMethodsForEmailOptions”export interface FetchSignInMethodsForEmailOptions { /** * The user's email address. * * @since 6.0.0 */ email: string;}FetchSignInMethodsForEmailResult
Abschnitt mit dem Titel “FetchSignInMethodsForEmailResult”export interface FetchSignInMethodsForEmailResult { /** * The sign-in methods for the specified email address. * * This list is empty when [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) * is enabled, irrespective of the number of authentication methods available for the given email. * * @since 6.0.0 */ signInMethods: string[];}GetCurrentUserResult
Abschnitt mit dem Titel “GetCurrentUserResult”export interface GetCurrentUserResult { /** * The currently signed-in user, or null if there isn't any. * * @since 0.1.0 */ user: User | null;}GetIdTokenOptions
Abschnitt mit dem Titel “GetIdTokenOptions”export interface GetIdTokenOptions { /** * Force refresh regardless of token expiration. * * @since 0.1.0 */ forceRefresh: boolean;}GetIdTokenResult
Abschnitt mit dem Titel “GetIdTokenResult”export interface GetIdTokenResult { /** * The Firebase Auth ID token JWT string. * * @since 0.1.0 */ token: string;}GetIdTokenResultOptions
Abschnitt mit dem Titel „GetIdTokenResultOptions“export interface GetIdTokenResultOptions { /** * Force refresh regardless of token expiration. * * @since 7.4.0 */ forceRefresh: boolean;}GetIdTokenResultResult
Abschnitt mit dem Titel „GetIdTokenResultResult“export interface GetIdTokenResultResult { /** * The authentication time in milliseconds since the epoch. * * This is the time the user authenticated (signed in) and not the time the token was refreshed. * * @since 7.4.0 */ authTime: number; /** * The ID token expiration time in milliseconds since the epoch. * * @since 7.4.0 */ expirationTime: number; /** * The ID token issuance time in milliseconds since the epoch. * * @since 7.4.0 */ issuedAtTime: number; /** * The sign-in provider through which the ID token was obtained. * * @since 7.4.0 */ signInProvider: string | null; /** * The type of second factor associated with this session, provided the user was multi-factor * authenticated (eg. phone, etc). * * @since 7.4.0 */ signInSecondFactor: string | null; /** * The entire payload claims of the ID token including the standard reserved claims as well as * the custom claims. * * @since 7.4.0 */ claims: Record<string, unknown>;}Source of Truth
Abschnitt mit dem Titel „Source of Truth“Diese Seite wird aus dem Plugin generiert src/definitions.ts. Führe den Sync erneut aus, wenn sich das öffentliche API upstream ändert.
Weiter geht's nach Getting Started
Abschnitt: „Weiter geht’s mit Getting Started“Wenn du es nutzt Erste Schritte Um Authentifizierungs- und Account-Flows zu planen, verbinde es mit @capgo/capacitor-social-login für die Implementierungsdetails in @capgo/capacitor-social-login, @capgo/capacitor-passkey für die Implementierungsdetails in @capgo/capacitor-passkey, @capgo/capacitor-native-biometric für die Implementierungsdetails in @capgo/capacitor-native-biometric, Zwei-Faktor-Authentifizierung für die Implementierungsdetails zur Zwei-Faktor-Authentifizierung, und SSO (Enterprise) für die Implementierungsdetails zu SSO (Enterprise).