내용으로 건너뛰기

시작하기

GitHub

설치

설치

Capgo의 AI 보조 설치를 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 기능을 추가하려면 다음 명령어를 사용하세요:

터미널 창
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

그다음에 다음 프롬프트를 사용하세요:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-firebase-authentication` plugin in my project.

만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:

터미널 창
bun add @capgo/capacitor-firebase-authentication
bunx cap sync

import

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

code 인증 코드를 적용합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.applyActionCode({} as ApplyActionCodeOptions);

confirmPasswordReset

제목 "confirmPasswordReset"

비밀번호 초기화 프로세스를 완료합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.confirmPasswordReset({} as ConfirmPasswordResetOptions);

confirmVerificationCode

제목 "confirmVerificationCode"

휴대폰 인증 코드를 확인합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.confirmVerificationCode({} as ConfirmVerificationCodeOptions);

createUserWithEmailAndPassword

제목 "createUserWithEmailAndPassword"

이메일과 비밀번호를 사용하여 새로운 사용자 계정을 생성합니다. 새로운 계정이 성공적으로 생성되면 사용자는 자동으로 로그인됩니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.createUserWithEmailAndPassword({} as CreateUserWithEmailAndPasswordOptions);

사용자를 삭제하고 로그아웃합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.deleteUser();

이메일 주소에 대한 로그인 방법을 가져옵니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.fetchSignInMethodsForEmail({} as FetchSignInMethodsForEmailOptions);

현재 로그인한 사용자를 가져옵니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getCurrentUser();

리턴합니다. SignInResult 앱이 웹 로그인 흐름을 시작하고 OS가 앱을 백그라운드에서 삭제하는 경우.

안드로이드만 지원합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getPendingAuthResult();

getIdToken

getIdToken

현재 로그인한 사용자의 Firebase Auth ID 토큰을 가져옵니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getIdToken();

getIdTokenResult

getIdTokenResult

JSON Web Token (JWT)으로 사용자를 식별하는 데 사용되는 사용자 정보를 반환합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getIdTokenResult();

getRedirectResult

getRedirectResult

리턴합니다. SignInResult redirect 기반 로그인 흐름에서부터 시작합니다.

로그인에 실패한 경우 오류와 함께 실패합니다. redirect 연산이 호출되지 않은 경우 null 사용자와 함께 반환합니다. SignInResult redirect 연산이 호출되지 않은 경우 null 사용자와 함께 반환합니다.

웹 전용입니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getRedirectResult();

테넌트 ID를 가져옵니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getTenantId();

이메일 링크로 로그인하는 incoming 링크가 적합한지 확인합니다. signInWithEmailLink.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.isSignInWithEmailLink({} as IsSignInWithEmailLinkOptions);

Apple 인증 제공자와 사용자 계정을 연결합니다.

네이티브层에서 사용자가 로그인되어야 합니다. skipNativeAuth 이 설정 옵션은 이곳에서 효과가 없습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithApple();

이메일 인증 제공자와 사용자 계정을 연결합니다.

네이티브层에서 사용자가 로그인되어야 합니다. skipNativeAuth 이 설정 옵션은 이곳에서 효과가 없습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithEmailAndPassword({} as LinkWithEmailAndPasswordOptions);

이메일 인증 제공자와 사용자 계정을 연결합니다.

네이티브层에서 사용자가 로그인되어야 합니다. skipNativeAuth 설정 옵션은 이곳에서 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithEmailLink({} as LinkWithEmailLinkOptions);

linkWithFacebook

링크WithFacebook

Facebook 인증 제공자와 사용자 계정을 연결합니다.

사용자는 네이티브层에서 로그인되어 있어야 합니다. skipNativeAuth 설정 옵션은 이곳에서 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithFacebook();

linkWithGameCenter

링크WithGameCenter

Game Center 인증 제공자와 사용자 계정을 연결합니다.

사용자는 네이티브层에서 로그인되어 있어야 합니다. skipNativeAuth 설정 옵션은 이곳에서 영향을 미치지 않습니다.

iOS에서만 사용 가능합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithGameCenter();

Links the user account with GitHub authentication provider.

네이티브层에서 로그인한 상태여야 합니다. skipNativeAuth 이 설정 옵션은 이곳에서 효과가 없습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithGithub();

Google 인증 제공자와 사용자 계정을 연결합니다.

네이티브层에서 로그인한 상태여야 합니다. skipNativeAuth 이 설정 옵션은 이곳에서 효과가 없습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithGoogle();

linkWithMicrosoft

Microsoft과 연결하기

사용자 계정에 Microsoft 인증 제공자를 연결합니다.

사용자는 네이티브层에서 로그인되어 있어야 합니다. skipNativeAuth 이 구성 옵션은 여기에 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithMicrosoft();

사용자 계정에 OpenID Connect 제공자를 연결합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithOpenIdConnect({} as LinkWithOpenIdConnectOptions);

사용자 계정에 전화번호 인증 제공자를 연결합니다.

사용자는 네이티브层에서 로그인되어 있어야 합니다. skipNativeAuth 이 구성 옵션은 여기에 영향을 미치지 않습니다.

사용 phoneVerificationCompleted 인증이 완료되면 알림을 받을 리스너입니다. 인증을 위한 phoneVerificationFailed 인증이 실패하면 알림을 받을 리스너입니다. 인증을 위한 phoneCodeSent 인증 ID를 가져올 리스너입니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithPhoneNumber({} as LinkWithPhoneNumberOptions);

linkWithPlayGames

링크WithPlayGames

Play Games 인증 제공자와 사용자 계정을 연결합니다.

네이티브层에서 로그인한 상태여야 합니다. skipNativeAuth 이 옵션은 이곳에서 효과가 없습니다.

안드로이드만 지원합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithPlayGames();

linkWithTwitter

링크WithTwitter

Twitter 인증 제공자와 사용자 계정을 연결합니다.

사용자는 네이티브层에서 로그인되어야 합니다. skipNativeAuth 이 구성 옵션은 여기에 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithTwitter();

linkWithYahoo

링크위드야후

Yahoo 인증 제공자와 사용자 계정을 연결합니다.

사용자는 네이티브层에서 로그인되어야 합니다. skipNativeAuth 이 구성 옵션은 여기에 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithYahoo();

reload

재로드

로그인한 경우 사용자 계정 데이터를 다시 로드합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.reload();

revokeAccessToken

액세스 토큰 취소

해당 액세스 토큰을 취소합니다. 현재는 Apple OAuth 액세스 토큰만 지원합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.revokeAccessToken({} as RevokeAccessTokenOptions);

현재 로그인한 사용자에게 인증 이메일을 보냅니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendEmailVerification();

사용자에게 비밀번호 재설정 이메일을 보냅니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendPasswordResetEmail({} as SendPasswordResetEmailOptions);

사용자에게 이메일 주소와 이메일 링크를 보내고 사용자가 이메일 링크를 클릭하여 로그인합니다.

로그인에 이메일 링크를 사용하려면 이메일 주소와 이메일 링크를 호출하세요. signInWithEmailLink 로그인에 이메일 링크를 사용하려면 이메일 주소와 이메일 링크를 호출하세요.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendSignInLinkToEmail({} as SendSignInLinkToEmailOptions);

setLanguageCode

setLanguageCode

인증 연산에 사용되는 사용자 대면 언어를 code로 설정합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setLanguageCode({} as SetLanguageCodeOptions);

setPersistence

setPersistence

현재 저장된 인증 세션에 대한 저장 유형을 설정합니다.

웹 전용

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setPersistence({} as SetPersistenceOptions);

setTenantId

setTenantId

테넌트 ID를 설정합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setTenantId({} as SetTenantIdOptions);

signInAnonymously

signInAnonymously

무료 사용자로 로그인합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInAnonymously();

signInWithApple

signInWithApple

애플 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithApple();

signInWithCustomToken

signInWithCustomToken

커스텀 토큰 로그인 흐름을 시작합니다.

이 메소드는 Android와 iOS에서 사용할 수 없습니다. 이 경우 Firebase JS __CAPGO_KEEP_0__의 인터페이스를 직접 사용해야 합니다. skipNativeAuth 클립보드에 복사 signInWithCustomToken interface of the Firebase JS SDK directly.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithCustomToken({} as SignInWithCustomTokenOptions);

signInWithEmailAndPassword

signInWithEmailAndPassword

이메일과 비밀번호를 사용하여 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithEmailAndPassword({} as SignInWithEmailAndPasswordOptions);
signInWithEmailLink

이메일과 로그인 이메일 링크를 사용하여 로그인합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithEmailLink({} as SignInWithEmailLinkOptions);

signInWithFacebook

signInWithFacebook

페이스북 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithFacebook();

signInWithGameCenter

signInWithGameCenter

게임 센터 로그인 흐름을 시작합니다.

iOS에서만 사용 가능합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithGameCenter();

signInWithGithub

GitHub 로그인 시작

GitHub 로그인 시작

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithGithub();

signInWithGoogle

Google 로그인 시작

클립보드 복사

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithGoogle();

signInWithMicrosoft

클립보드 복사

OpenID Connect 로그인 시작

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithMicrosoft();

signInWithOpenIdConnect

Microsoft 로그인 시작

클립보드 복사

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithOpenIdConnect({} as SignInWithOpenIdConnectOptions);

전송 번호로 로그인하는 흐름을 시작합니다.

listener를 사용하여 인증이 완료되면 알림을 받습니다. phoneVerificationCompleted listener를 사용하여 인증이 실패하면 알림을 받습니다. phoneVerificationFailed listener를 사용하여 인증 ID를 받습니다. phoneCodeSent 안드로이드 및 iOS에서만 사용할 수 있습니다.

클립보드에 복사

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithPhoneNumber({} as SignInWithPhoneNumberOptions);

클립보드에 복사

__CAPGO_KEEP_0__

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithPlayGames();

Twitter 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithTwitter();

Yahoo 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithYahoo();

로그아웃 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signOut();

서비스 제공자를 사용자 계정에서 제거합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.unlink({} as UnlinkOptions);

현재 로그인한 사용자의 이메일 주소를 업데이트합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updateEmail({} as UpdateEmailOptions);

현재 로그인한 사용자의 비밀번호를 업데이트합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updatePassword({} as UpdatePasswordOptions);

사용자의 프로필 데이터를 업데이트합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updateProfile({} as UpdateProfileOptions);

code을 기본 앱 언어로 설정합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.useAppLanguage();

useEmulator

useEmulator

Authentication 에미레이터와 통신하기 위해 앱을 구성하십시오.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.useEmulator({} as UseEmulatorOptions);

verifyBeforeUpdateEmail

verifyBeforeUpdateEmail

현재 로그인한 사용자의 이메일 주소를 업데이트하기 전에 새로운 이메일 주소를 확인합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.verifyBeforeUpdateEmail({} as VerifyBeforeUpdateEmailOptions);

checkAppTrackingTransparencyPermission

checkAppTrackingTransparencyPermission

앱 트래킹 투명성 확인

iOS에서만 사용 가능합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.checkAppTrackingTransparencyPermission();

requestAppTrackingTransparencyPermission

requestAppTrackingTransparencyPermission

앱 트래킹 투명성 권한을 요청합니다.

주의: 사용자는 장치 설정에서 추적 요청을 비활성화 할 수 있습니다, 애플의 문서를 참조하십시오.

iOS에서만 사용 가능합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.requestAppTrackingTransparencyPermission();

ApplyActionCodeOptions

ApplyActionCodeOptions 섹션
export interface ApplyActionCodeOptions {
/**
* A verification code sent to the user.
*
* @since 0.2.2
*/
oobCode: string;
}

ConfirmPasswordResetOptions

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

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;
}
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

“CreateUserWithEmailAndPasswordOptions” 섹션
export interface CreateUserWithEmailAndPasswordOptions {
/**
* @since 0.2.2
*/
email: string;
/**
* @since 0.2.2
*/
password: string;
}

FetchSignInMethodsForEmailOptions

“FetchSignInMethodsForEmailOptions” 섹션
export interface FetchSignInMethodsForEmailOptions {
/**
* The user's email address.
*
* @since 6.0.0
*/
email: string;
}

FetchSignInMethodsForEmailResult

“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[];
}
export interface GetCurrentUserResult {
/**
* The currently signed-in user, or null if there isn't any.
*
* @since 0.1.0
*/
user: User | null;
}
export interface GetIdTokenOptions {
/**
* Force refresh regardless of token expiration.
*
* @since 0.1.0
*/
forceRefresh: boolean;
}

GetIdTokenResult

GetIdTokenResult
export interface GetIdTokenResult {
/**
* The Firebase Auth ID token JWT string.
*
* @since 0.1.0
*/
token: string;
}

GetIdTokenResultOptions

GetIdTokenResultOptions
export interface GetIdTokenResultOptions {
/**
* Force refresh regardless of token expiration.
*
* @since 7.4.0
*/
forceRefresh: boolean;
}

GetIdTokenResultResult

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>;
}

실질적인 출처

실질적인 출처

이 페이지는 플러그인의 src/definitions.ts공개 API이 업스트림에서 변경될 때 다시 싱크를 실행하세요.

Getting Started에서 계속 진행하세요.

Getting Started를 계속 진행하는 방법

Capgo를 사용 중이라면 Getting Started 인증 및 계정 흐름을 계획하고자 할 때 Capgo에서 @capgo/capacitor-social-login Capgo에서 @capgo/capacitor-social-login의 구현 세부 정보 Capgo에서 @capgo/capacitor-passkey Capgo에서 @capgo/capacitor-passkey의 구현 세부 정보 Capgo에서 @capgo/capacitor-native-biometric Capgo에서 @capgo/capacitor-native-biometric의 구현 세부 정보 두 단계 인증 두 단계 인증의 구현 세부 정보 SSO (기업) SSO (기업) 구현 세부 사항에 대한 정보입니다.