--- title: "Javascript SDK" slug: "game-gamepot-javascriptsdk" tags: ["GAMEPOT"] updated: 2026-09-17T09:18:10Z published: 2026-09-17T09:18:10Z canonical: "guide.ncloud-docs.com/game-gamepot-javascriptsdk" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # Javascript SDK **The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.** Available in Classic and VPC This guide describes how to use the GAMEPOT Javascript SDK to integrate GAMEPOT on the web. You can integrate the game and dashboard by installing the SDK and configuring the environment. The requirements for using the GAMEPOT SDK for Javascript are as follows. - Minimum specifications: Chrome 4, IE 8, Firefox 3.5, Safari 4, Opera 10.50, etc. ## Install SDK and configure environment How to configure basic settings to use JavaScript SDK is as follows. 1. Download [gamepot-sdk-javascript-lastest.min.js](https://gamepot.gcdn.ntruss.com/gamepot-sdk-javascript-lastest.min.js). 2. Add the downloaded file, gamepot-sdk-javascript-lastest.min.js between the head and head. ``` // Or you can use a CDN link directly. (Recommended) ``` GAMEPOT Javascript SDK is offered as an npm package and also accessible via yarn. ``` # using npm npm install gamepot # using yarn yarn add gamepot ``` Console Setting Guide for Social Media Log-ins: [Download](https://xyuditqzezxs1008973.cdn.ntruss.com/patch/JavascriptSDK%E1%84%85%E1%85%A9%E1%84%80%E1%85%B3%E1%84%8B%E1%85%B5%E1%86%AB%E1%84%87%E1%85%A1%E1%86%BC%E1%84%89%E1%85%B5%E1%86%A8%E1%84%89%E1%85%A1%E1%84%8B%E1%85%AD%E1%86%BC%E1%84%89%E1%85%B5%E1%84%8F%E1%85%A9%E1%86%AB%E1%84%89%E1%85%A9%E1%86%AF%E1%84%89%E1%85%A6%E1%86%BA%E1%84%90%E1%85%B5%E1%86%BC%E1%84%80%E1%85%A1%E1%84%8B%E1%85%B5%E1%84%83%E1%85%B3.pdf) Available log-ins: Google/Facebook/Apple log-ins For Apple logins, the GAMEPOT **Dashboard > Project settings > General > Apple ID login** field should be filled in. The address of the domain you're logging in from should be listed in GAMEPOT **Dashboard > Project settings > General > WEB- Allowed domains**. ## Reset To allow run it once the web page loading is done, reset within `window.onload = function() {...}` or `$(ducement).ready(function() {...})` if you’re using jQuery. ``` ``` | Attribute | Description | | --- | --- | | project_id | GAMEPOT Dashboard Project ID | | api_url | URL associated with GAMEPOT dashboard (It is https://gpapps.gamepot.ntruss.com by default. However, this address may be different for managed product customers, so you may need to contact GAMEPOT.) | | api_key | Authentication key issued by GAMEPOT (Dashboard > Project settings > API key) | | google_signin_client_id | Web Application ID within the Google console | | facebook_app_id | Facebook app ID | | apple_client_id | Services ID created in the Apple console | | apple_redirect_uri | Domain address you're attempting to log-in from | ### Error handling The error handling is the same for all. If there is an error, a message, such as function (user, error) { }, is displayed and if there is no error, a success is returned. ``` GP.login(GP.ChannelType.EMAIL, function (user, error) { if(error) { // Login failure alert(error.message); // Failure message return; } alert(user); }); ``` ## Login, logout You can integrate Google, Facebook, and Apple ID login SDKs. ### log in The login UI must be implemented by the developer; it connects when a user clicks the login button. #### Social Platform Log-ins ``` // Define login type. // GP.ChannelType.GOOGLE : Google // GP.ChannelType.FACEBOOK : Facebook // GP.ChannelType.APPLE : Apple ID // GP.ChannelType.KAKAO : Kakao // Call when the Facebook Log-in button was pressed. GP.login(GP.ChannelType.FACEBOOK, function (user, error) { if (error) { alert(error); // Error message return; } // Login completed alert(user); }); ``` The social login will automatically sign you up for the game at the same time you log in. If you don't want the signup, you can add the following option. ``` GP.setAuthSignup(false); ``` USER Data Class | ID | type | desc | | --- | --- | --- | | id | string | Member ID | | token | string | Login token (JWT) | | nickname | string | Nickname | | provider | string | Social login type | | providerId | string | Social login ID | | verify | string | Authentication | | agree | string | Agreement to Terms | #### Email login ``` GP.signin("email", username, password, function(user, err) { if(err) { alert(err.message); } else { alert(user.id); } }); ``` ### Email signup ``` GP.signup("email", username, password, name, function(user, err) { if(err) { alert(err.message); } else { alert(user); } }); ``` ### Log out It logs the current member account out. ``` GP.logout(function (result, error) { if (error) { alert(error.message); } // Log out successful }); ``` ### Withdraw from membership ``` GP.withdraw(function (result, error) { if (error) { alert(error.message); } // Membership withdrawal succeeded }); ``` ### Check if they're a member via a social account After logging-in, check if the social account is connected with a GAMEPOT member . ``` GP.linkingByUser(channeltype, function( user, error) { if(error) { alert(`${error.code}-${error.message}`); // Error message return false; } if(user == null) alert('Account doesn't exist') else if(user.member_id.id) alert(user.member_id.id); // Returns ID }); ``` USER Data Class | ID | type | desc | | --- | --- | --- | | member_id.id | string | GAMEPOT member ID | | username | string | Social ID | ## 4. Plugin GAMEPOT supports various eternal module connection services apart from the basic functions. Supporting modules - Identification (DANAL) - Overseas PG(Xsolla) - Domestic PG (DANAL) ### Identity verification The cell phone identification service is to check the user’s identification through an authentication process using their registered cell phone. (Only in Korea) ``` GP.Identity('[Identity verification code]',{},function(resp) { if(resp.success) { alert(resp.orderId); } else { alert(resp.error); } }); ``` ### External payment The equation that shows the payment window for external PGs, including Xsolla or DANAL ``` function Payment(key) { GP.Payment(key, { userId: "[USERID]", productId : "[ITEMID]", name: "[ITEMNAME]", buyer_name: "[Customer name]", buyer_email: "[Customer EMAIL]", },function(resp) { if(resp.success) { alert(resp.orderId); } else { alert(resp.error); } }) } ``` | Attribute | Description | | --- | --- | | userId | GAMEPOT member ID | | productId | Product code | | name | Item name | | buyer_name | Customer name (option) | | buyer_email | Customer email (option) | | playerId | Player ID (option) | | serverId | Server ID (option) | | userdata | User data (option) |