사이드 메뉴
Getting started
Kakao Developers
Login
Communication
Advertisement
- Concepts
- Ad creation: Ad account
- Ad creation: Campaign
- Ad creation: Ad group
- Targeting for ad group
- Custom audience targeting for ad group
- Ad creation: Creative common
- Ad creation: Display creative
- Ad creation: Message creative
- Ad creation: Personalized message creative
- Bizboard landing settings
- Report
- Message management
- Personalized message management
- Message ad management
- Message ad operation
- Ad View management
- Business Form linkage management
- Pixel & SDK linkage management
- Audience management
- Engagement targeting management
- Customer file management
- Friend group management
- Ad account management
- Reference
- Type information
- Error code
Upgrade v1 to v2
This document guides information to upgrade Kakao SDK for JavaScript("JavaScript SDK") from v1(lower version of 2.0.0) to v2(version 2.0.0 or higher).
- Change minimum version of Internet Explorer
- Change script tag used to load JavaScript SDK
- Replace callback patterns with promise patterns
- End support for login by presenting popup window
- Change module names and API request URLs
The minimum supported version of Internet Explorer (IE) is changed to IE 11 in JavaScript SDK v2. To support IE 9 or IE 10, use Legacy JavaScript SDK.
To load the JavaScript SDK v2, the version must be specified inside the <script> element.
integrity is an attribute for Subresource Integrity (SRI). To strengthen security, use integrity. To copy the script tag or the integrity value of the desired SDK version, see Download.
<!-- Before --><script src="https://t1.kakaocdn.net/kakao_js_sdk/v1/kakao.min.js"></script><!-- After --><script src="https://t1.kakaocdn.net/kakao_js_sdk/${VERSION}/kakao.min.js" integrity="${INTEGRITY_VALUE}" crossorigin="anonymous"></script>
The functions in the JavaScript SDK v2 return the Promise objects instead of callback parameters such as success, fail, and always.
Replace the callback parameters with the Promise.then() and Promise.catch() functions by referring to the following sample snippet and each development guide.
// BeforeKakao.API.request({url: '/v2/user/me',success: function (response) {console.log(response)},fail: function (error) {console.log(error)},})// AfterKakao.API.request({url: '/v2/user/me',}).then(function (response) {console.log(response)}).catch(function (error) {console.log(error)})
To provide a better service with strengthened security, JavaScript SDK v2 does not provide the associated functions used to obtain an access token on the client side by presenting popup window in JavaScript SDK v1.
To integrate Kakao Login with the JavaScript SDK v2, use the Kakao.Auth.authorize() function instead.
| Feature | JavaScript SDK v1 | JavaScript SDK v2 |
|---|---|---|
| Kakao Login | Kakao.Auth.login()Kakao.Auth.createLoginButton()Kakao.Auth.loginForm()Kakao.Auth.autoLogin() | Kakao.Auth.authorize() |
As some service names are changed, the associated modules and API request URLs are changed as follows.
| Feature | JavaScript SDK v1 | JavaScript SDK v2 |
|---|---|---|
| Kakao Talk Share | Kakao.Link | Kakao.Share |
| Kakao Talk Channel | Kakao.PlusFriend | Kakao.Channel |
| Checking Kakao Talk Channel relationship | /v1/api/talk/plusfriends | /v1/api/talk/channels |