Kakao Login
Logging In
You can perform tasks like user registration, login, receiving additional consent, and obtaining agreement for terms using Kakao Login.

Usage
Calling the login() function will trigger the login process immediately.
import { login } from '@react-native-kakao/user';
...
login()
Parameters
All parameters are optional.
serviceTerms: Additional feature to specify specific service terms for the Kakao login consent screen, based on the user's service registration scenario. Specify the service terms tags to be included in the consent screen by setting theserviceTermsparameter when making a Kakao login request. Include one or more service terms set as [required consent] to display the consent screen and obtain user consent.
This feature is only available for services implementing Kakao Sync.
prompts: Allows control over the login process by passing flags.
Pass Login, Create, Cert, UnifyDaum, or SelectAccount(Android only) as a string[].
For detailed descriptions, refer to the Official Documentation.
Sent when attempting a login with a Kakao account instead of KakaoTalk.
scopes: Used when requesting additional consent from the user. Pass the items that require consent.
Refer to the Official Documentation for details.
Check the xxxNeedsAgreement properties in the me() function to get items that require additional consent.
If scopes are provided, it always executes login with a Kakao account.
-
useKakaoAccountLogin: Attempt login with a Kakao account instead of KakaoTalk. -
nonce: A value used to prevent ID token replay attacks. The value you pass is returned in thenonceclaim of the issued ID token.
Refer to the Official Documentation for details.
Only meaningful for apps with OpenID Connect enabled.
Errors will be thrown under the following conditions:
- If
useKakaoAccountLogindoes not exist or isfalse,promptsandscopescannot be passed.
For KakaoTalk login, prompts and scopes cannot be passed (Native SDK restriction).
- If
scopesare passed,serviceTermsandpromptscannot be passed.
When requesting additional consent, serviceTerms and prompts cannot be passed together (Native SDK restriction).
Response
Returns token-related information via a Promise.
The response includes the following:
{
accessToken: string;
refreshToken: string;
tokenType?: string;
idToken?: string;
accessTokenExpiresAt: number; // unix
refreshTokenExpiresAt: number; // unix
accessTokenExpiresIn: number; // seconds
refreshTokenExpiresIn: number; // seconds
scopes: string[];
};
Logging Out
You can log out using logout().
Revoking Account Linkage
Use unlink() to revoke account linkage.
Checking Current Login Status
Use isLogined() to check if the user is currently logged in. It returns a Promise<boolean>.
Checking KakaoTalk Availability
Use isKakaoTalkLoginAvailable() to check if KakaoTalk login is available. It returns a Promise<boolean>.