跳过主要内容
返回插件
@capgo/capacitor-firebase-authentication
教程
@capgo/capacitor-firebase-authentication

Firebase Authentication

Capacitor Firebase 认证插件

指南

Firebase 认证教程

使用 @capgo/capacitor-firebase-authentication

Capacitor Firebase 认证插件

安装

bun add @capgo/capacitor-firebase-authentication
bunx cap sync

此插件暴露的内容

  • applyActionCode - Applies a verification code sent to the user by email.
  • confirmPasswordReset - 完成密码重置流程。
  • confirmVerificationCode - 完成手机号验证流程。
  • createUserWithEmailAndPassword - 使用邮箱和密码创建新用户账户。如果新账户创建成功,用户会自动登录。

示例使用

applyActionCode

Applies a verification code sent to the user by email.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';

await FirebaseAuthentication.applyActionCode({} as ApplyActionCodeOptions);

confirmPasswordReset

完成密码重置流程。

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';

await FirebaseAuthentication.confirmPasswordReset({} as ConfirmPasswordResetOptions);

confirmVerificationCode

完成手机号验证流程。

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';

await FirebaseAuthentication.confirmVerificationCode({} as ConfirmVerificationCodeOptions);

createUserWithEmailAndPassword

使用邮箱和密码创建新用户账户。如果新账户创建成功,用户会自动登录。

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';

await FirebaseAuthentication.createUserWithEmailAndPassword({} as CreateUserWithEmailAndPasswordOptions);

全局参考

Keep going from Using @capgo/capacitor-firebase-authentication

继续使用 @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-firebase-authentication Using @capgo/capacitor-firebase-authentication 使用 @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-firebase-authentication @capgo/capacitor-social-login @capgo/capacitor-social-login 查看 @capgo/capacitor-social-login 的实现细节 查看 @capgo/capacitor-passkey 的实现细节 查看 @capgo/capacitor-native-biometric 的实现细节 对于 @capgo/capacitor-native-biometric 的实现细节 双因素认证 对于双因素认证和 SSO (企业) 对于 SSO (企业) 的实现细节