Skip to main content

Authentication API

Learn how to work with authentication in GamePush SDK.

Methods​

Check Availability of Authentication​

To find out if authentication (internal, external) is available on the platform, you can use the method FREE:

gp.platform.hasIntegratedAuth; // boolean

Check Availability of Authentication via Secret Code​

To find out if authentication via secret code is available on the platform, you can use the method FREE:

gp.platform.isSecretCodeAuthAvailable; // boolean

Learn more about authentication via secret code.

Check Authentication Status​

To determine if the player is authenticated through internal or external authentication system, you can use the method FREE:

gp.player.isLoggedIn; // boolean

Perform Login​

To trigger the login window, you can use the method +0-1 Request:

gp.player.login();

Wait for the login event by subscribing to the event FREE:

gp.player.on('login', (success) => {});
tip

After logging in, remember to update the interface and set new values in the game for variables that changed after login.

Logout from Account​

To check if account logout is available on the platform, you can use the method FREE:

gp.platform.isLogoutAvailable; // boolean

You can logout the player using the method +0-1 Request:

gp.player.logout();

Wait for the logout event by subscribing to the event FREE:

gp.player.on('logout', (success) => {});
tip

After logging out, remember to update the interface and set new values in the game for variables that changed after logout.

Get Player ID on the Platform​

To retrieve the player's ID on the platform or in an external authentication system, you can use the method FREE:

gp.player.get('credentials'); // string

Stay in Touch​

Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.

GamePush Community Telegram: @gs_community.

For your suggestions e-mail: official@gamepush.com

We Wish you Success!