Web
PC browser: Chrome, Firefox, Edge, Safari
Mobile browser: iOS Safari >= 11, Android >= 6
Quick Start
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
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
.
- npm
- CDN
// To use LI PASS, make sure the version is later than 1.16.0
$ npm install @intlsdk/account-api
// SDK production version package
<script src="https://common-web.intlgame.com/sdk-cdn/account-api/latest/index.umd.js"></script>
Step 2: Instantiate the SDK
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
});
Parameter | Type | Description | Remarks |
---|---|---|---|
env | string | SDK environment For more information, see Retrieve cluster information | Required |
langType | string | Language type For more information, see Language Type Definition - Custom Account | Required |
appID | string | App ID ACCOUNT_APP_ID assigned by Player Network Console | Required |
accountPlatType | number | Account platform type used to identify different account platforms ACCOUNT_PLAT_TYPE assigned by Player Network Console, value for LI PASS is 131 | Required |
gameID | number | Player Network unique game ID | Required |
hostCAcc | string | [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,
});
Parameter | Type | Description | Remarks |
---|---|---|---|
env | string | SDK environment For more information, see Retrieve cluster information. | Required |
gameID | number | Player Network unique game ID | Required |
Step 3: Implement the required features
Use the APIs to implement your features.
For more information on the login APIs, see:
API | Function |
---|---|
signIn | Custom account log in through password |
verifyCodeSignIn | Custom account log in through verification code |
intlSignIn | Player Network account log in through custom account |
queryUserInfo | Gets custom account user profile |
modifyProfile | Modifies user profile |
queryUserNameStatus | Queries if the username is already registered for custom account |
modifyUserAgreement | Modifies the custom account privacy policy and term of service |
queryRegisterStatus | Queries if the custom account is already registered |
register | Registers custom account with password |
verifyCodeRegister | Registers custom account with verification code |
requestVerifyCode | Sends email/phone verification code |
resetPassword | Resets password |
IntlLogout | Logs out |
For more information on the third-party login APIs, see:
API | Function |
---|---|
ThirdAuthorize | Third-party authorization |
IntlAuthorize | Player Network account authorization |
IntlLogout | Logs out |
For more information on the account linking APIs, see:
API | Function |
---|---|
bind | Link |
unbind | Unlink |
getBindChannelsByOpenID | Gets the list of linked channels based on Player Network SDK OpenID |
getBindChannelsByUid | Gets the list of linked channels based on channel information |
For more information on the account mapping APIs, see:
API | Function |
---|---|
map | Maps |
unmap | Unmaps |
queryMapByCAccInfo | Gets the list of mapped channels based on custom account login information |
queryMapByThirdInfo | Gets the custom account UID based on the login information of the mapped channel |
For more information on the sharing APIs, see:
API | Function |
---|---|
share | Share |
For more information on the LBS APIs, see:
API | Function |
---|---|
queryMyRegion | Gets the country/region information based on player IP |