Skip to main content

Web

Version Requirements

PC browser: Chrome, Firefox, Edge, Safari

Mobile browser: iOS Safari >= 11, Android >= 6

Quick Start

caution

The custom account is deprecated, reach out to the Player Network representative to upgrade to LI PASS. To migrate custom accounts to LI PASS, see JSSDK Migration Guide.

Step 1: Install the JavaScript SDK

caution

During integration testing, the test environment SDK can be imported, which should be used for integration testing only. The production environment SDK must be used when launching the project online!

Install the JavaScript SDK from npm or CDN.

// To use LI PASS, make sure the version is later than 1.16.0 
$ npm install @intlsdk/account-api

Step 2: Instantiate the SDK

caution

Set env to the test environment test during the integration testing; set env to the corresponding production environment when launching the game.

The parameters for instantiating different functions differ.

LI PASS Login

const accountApi = new IntlgameAccountApi({
env: "test", // SDK environment
gameID: 11, // Game ID generated in Player Network
appID: "", // APP_ID generated in Player Network
accountPlatType: 131, // LI PASS platform ID
hostCAcc: "https://test-web-pass.intlgame.com", // Test environment: `https://test-web-pass.intlgame.com`, Production environment `https://li-sg.intlgame.com`
langType: "en", // Language
});
ParameterTypeDescriptionRemarks
envstringSDK environment
For more information, see Retrieve cluster information
Required
langTypestringLanguage type
For more information, see Language Type Definition - Custom Account
Required
appIDstringApp ID
ACCOUNT_APP_ID assigned by Player Network Console
Required
accountPlatTypenumberAccount platform type used to identify different account platforms
ACCOUNT_PLAT_TYPE assigned by Player Network Console, value for LI PASS is 131
Required
gameIDnumberPlayer Network unique game IDRequired
hostCAccstring[Required for LI PASS]
Test environemnt: https://test-web-pass.intlgame.com
Production environment: https://li-sg.intlgame.com
Required for LI PASS

Third-party channel login

const accountApi = new IntlgameAccountApi({
env: "test", // SDK environment
gameID: 11,
});
ParameterTypeDescriptionRemarks
envstringSDK environment
For more information, see Retrieve cluster information.
Required
gameIDnumberPlayer Network unique game IDRequired

Step 3: Implement the required features

Use the APIs to implement your features.

For more information on the login APIs, see:

APIFunction
signInCustom account log in through password
verifyCodeSignInCustom account log in through verification code
intlSignInPlayer Network account log in through custom account
queryUserInfoGets custom account user profile
modifyProfileModifies user profile
queryUserNameStatusQueries if the username is already registered for custom account
modifyUserAgreementModifies the custom account privacy policy and term of service
queryRegisterStatusQueries if the custom account is already registered
registerRegisters custom account with password
verifyCodeRegisterRegisters custom account with verification code
requestVerifyCodeSends email/phone verification code
resetPasswordResets password
IntlLogoutLogs out

For more information on the third-party login APIs, see:

APIFunction
ThirdAuthorizeThird-party authorization
IntlAuthorizePlayer Network account authorization
IntlLogoutLogs out

For more information on the account linking APIs, see:

APIFunction
bindLink
unbindUnlink
getBindChannelsByOpenIDGets the list of linked channels based on Player Network SDK OpenID
getBindChannelsByUidGets the list of linked channels based on channel information

For more information on the account mapping APIs, see:

APIFunction
mapMaps
unmapUnmaps
queryMapByCAccInfoGets the list of mapped channels based on custom account login information
queryMapByThirdInfoGets the custom account UID based on the login information of the mapped channel

For more information on the sharing APIs, see:

APIFunction
shareShare

For more information on the LBS APIs, see:

APIFunction
queryMyRegionGets the country/region information based on player IP