Skip to main content

Kakao Login

Logging In

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

image

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 the serviceTerms parameter 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.
info

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.

info

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.
Warning

Errors will be thrown under the following conditions:

  • If useKakaoAccountLogin does not exist or is false, prompts and scopes cannot be passed.

For KakaoTalk login, prompts and scopes cannot be passed (Native SDK restriction).

  • If scopes are passed, serviceTerms and prompts cannot 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:

KakaoLoginToken
{
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>.