diff --git a/src/index.ts b/src/index.ts index dc226f6..c0459b8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,8 +27,7 @@ const NativeKakaoLogins: KakaoLoginModuleInterface = { }, serviceTerms() { return RNKakaoLogins.serviceTerms(); - - } + }, }; export const login = NativeKakaoLogins.login; diff --git a/src/index.web.ts b/src/index.web.ts index f7e95fe..ac54a00 100644 --- a/src/index.web.ts +++ b/src/index.web.ts @@ -63,6 +63,15 @@ const WebKakaoLogins: KakaoLoginModuleInterface = { }, }).then((res) => res.json()); }, + serviceTerms(tokenWeb?: string) { + return fetch('https://kapi.kakao.com/v2/user/service_terms', { + method: 'get', + headers: { + Authorization: `Bearer ${tokenWeb}`, + 'Content-type': 'application/x-www-form-urlencoded;charset=utf-8', + }, + }).then((res) => res.json()); + }, async getAccessToken() { throw new Error('Web does not support `getAccessToken`'); }, diff --git a/src/types/index.ts b/src/types/index.ts index 4dee786..68613ce 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -110,13 +110,13 @@ export type KakaoShippingAddress = { export declare type KakaoAllowedServiceTerms = { tag: string; agreedAt: string; -} +}; export declare type KakaoAppServiceTerms = { tag: string; createdAt: string; updatedAt: string; -} +}; export declare type KakaoServiceTerms = { userId?: number;