# kakao-login

> Kakao Account Login Wrapper

Latest version **1.0.2** (published 2018-04-24) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install kakao-login
pnpm add kakao-login
yarn add kakao-login
bun add kakao-login
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-04-24 |
| First published | 2018-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | raccoondev85 |
| Maintainers | raccoondev85 |
| Keywords | ionic, cordova, kakao, kakaologin, kakaoaccount, kakaotalk |

## Links

- npm: https://www.npmjs.com/package/kakao-login
- Repository: https://github.com/raccoondev85/kakao-login
- Homepage: https://github.com/raccoondev85/kakao-login#readme
- Issues: https://github.com/raccoondev85/kakao-login/issues
- npm.io page: https://npm.io/package/kakao-login

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-04-24
- 1.0.1 — 2018-04-24
- 1.0.0 — 2018-04-23

## README

# kakao-login
Kakao Account Login Plugin Wrapper (카카오 계정 연동 플러그인 Wrapper)
link: https://github.com/raccoondev85/cordova-plugin-kakaologin

## Development Environment and ETC
|type|version
|---|---
|ionic (Ionic CLI)|3.19.1
|cordova (Cordova CLI)|8.0.0
|Cordova Platforms Android|6.4.0
|Cordova Platforms IOS|4.5.4
|Ionic Framework|ionic-angular 3.9.2
|KakaoOpenSDK.framework(ios)|1.7.0
|com.kakao.sdk:kakaotalk(android)|1.10.1
|com.kakao.sdk:kakaolink(android)|1.10.1


## How to install
install cordova plugin
```
// KAKAO_APP_KEY: the app key that you got assigned as a native key in the kakao development console
$ cordova plugin add cordova-plugin-kakaologin --variable KAKAO_APP_KEY=YOUR_KAKAO_APP_KEY
```

install wrapper for kakao login plugin to interface
```
$ npm install --save kakao-login
```

then import __KakaoLogin__ module into app.module.ts
```
import { KakaoLogin } from 'kakao-login';

@NgModule({
  providers: [
    KakaoLogin
  ]
})
```

## Methods
### `login()`


```
import { KakaoLogin, AuthTypes } from 'kakao-login';

  constructor(public _kakaoLogin: KakaoLogin) {
    let loginOptions = {};
    loginOptions['authTypes'] = [
                                  AuthTypes.AuthTypeTalk, 
                                  AuthTypes.AuthTypeStory,
                                  AuthTypes.AuthTypeAccount
                                ];
    
    this._kakaoLogin.login(loginOptions).then((res) => {
        console.log(res);
      }
    );
  }
```
There is an optional parameter you can pass in to give users to choose various login ways through:

|options|type|default|iOS|Android|description
|---|---|---|---|---|---
|`authTypes`|any[]|`AuthTypes.AuthTypeTalk`|yes|yes|Types of Authentication: "AuthTypes.AuthTypeTalk", "AuthTypes.AuthTypeStory", "AuthTypes.AuthTypeAccount", multiple values in this option will show the popup window to choose among the login methods unless one of those apps are not yet installed in the device(except AuthTypeAccount)


Return values are "id", "accessToken", "email", "emailVerified", "nickname", "profileImagePath", "thumbnailImagePath", and etc(basically everthing that SDK gives but it might be slightly different  depending on OS, AuthType, or user's setting, for example "profileImagePath" or "thumbnailImagePath" not be given if user doesn't set up, or "email" might not exist if you did not set up as mandatory parameter in the kakao development console )

### `logout()`
```
  constructor(public _kakaoLogin: KakaoLogin) {
    this._kakaoLogin.logout().then(() => {
        //do your logout proccess for your app
      }
    );
  }
```
return null

### `unlinkApp()`
Unregister app for your app service. 
```
  constructor(public _kakaoLogin: KakaoLogin) {
    this._kakaoLogin.unlinkApp().then(() => {
        //do your unregister proccess for your app
      }
    );
  }
```

### `getAccessToken()`
Get current access token.
```
  constructor(public _kakaoLogin: KakaoLogin) {
    this._kakaoLogin.getAccessToken().then((res) => {
        console.log(res);
      }
    );
  }
```
it returns the current access token.

---
_Source: https://npm.io/package/kakao-login · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
