Skip to content

Account integration requirements

The CrazyGames account system is a powerful tool that allows our users to save progress, play on multiple devices, customize their username and avatar and play with their friends. The most succesful games on our site integrate seamlessly with our account system.

CrazyGames has over 15M registered users, many of them playing actively every week.

We want to ensure this experience for our users:

  • No standalone in-game username are needed
  • No additional login flows in-game are needed
  • Guests can also play the games

We understand these requirements can have a substantial impact on your game. However it's not necessary to do customization before releasing your initial game version which we describe below. We distinguish 4 account integration scenarios:

Basic Implementation

If your game doesn’t have the notion of users, you are not expected to integrate with our user module.

You can however use the Data module in our SDK to save user progress, or alternatively rely on our APS system.

Full Implementation

Improve the gamer's experience by showing their username and profile picture in your game.

  • You can retrieve the user object from the user module to obtain user profile info
  • In case the result is null the user is not logged in on CrazyGames and you should continue as guest.
  • You can use the Data module in our SDK to save user progress, or alternatively rely on our APS system.

Full Implementation

This scenario is meant for games that have in-game accounts with a custom back-end. We want to ensure a smooth login experience for CrazyGames users, meaning:

  • New logged in CrazyGames users are automatically registered & logged in within your game.
  • Returning logged in CrazyGames users are automatically logged in within your game.
  • CrazyGames guests can play your game as guests
  • Logging out in the game and allowing login with external login options (e.g. Facebook, Google, email) is not allowed.
    • If you want to offer importing existing accounts or exporting CrazyGames account, you are responsible for transferring progress correctly. Refer to Account linking in the appropriate SDK docs for functionality we provide.

Preparation

Your CrazyGames game version will need to allow using CrazyGames user ID's as identifiers within the game.

At game launch

Start by retrieving the current user. The game should request the current user account every time the game starts.

User is not logged in (getUser() returns null)

You should always allow the user to start playing as Guest.

Optionally, you can give the user the choice:

  • 'Login with CrazyGames' button (triggering our Auth prompt method)
  • Continue as Guest

Please note:

  • Don't allow Guests to use different login methods than 'Login with CrazyGames'
  • Don't trigger the Auth prompt automatically as this might confuse the user
User is logged in on CrazyGames (getUser() returns a user)

Check if the CrazyGames account (via getUserToken()) already exists in your back-end.

  • Case: CrazyGames account is already available:
    • Fetch the data for this user from your back-end, and start playing!
  • Case: The CrazyGames account is not yet known to your game:
    • Automatically create a game account using the player's CrazyGames account, based on the user token. This user will have fresh data in your back-end.

Game login button

  • You can show a Login button in your menu for Guests, which triggers the same flow as described above in "At game launch".
  • You should not display a login page (for example containing external accounts like Google or Facebook).
  • The game should also not allow the user to logout.

Players changing CrazyGames accounts while playing

Mandatory for games using In-Game Purchases, optional for other games

  • Users logging into their CrazyGames account while playing can be detected using an Auth Listener, in this case we will expect you to follow the "User is logged in on CrazyGames" flow above and if necessary refresh the game. This only applies to users playing as guest in the game and is optional.
  • When a user logs out during gameplay, the entire web page is refreshed, so there is nothing else to do in this case. The game flow will start from the beginning.

Basic Implementation

To publish a game that saves user profile info or progress on your own back-end without customization/integration, you should:

  • Allow both guests and registered CrazyGames users to play your game as guests by default
  • Disable any external login options (e.g. Facebook, Google, email)

Naturally, we will require you to integrate fully according to Full Implementation when the game has proven to be succesful.

You can consider using the Data module in our SDK to save user progress, or alternatively rely on our APS system.

Progress save

Full Implementation

Players care A LOT about their progress in games, and expect their progress to synchronize across their devices. CrazyGames offers a number of methods to save progress in the cloud. Unless progress is not applicable for your game, you need to implement one of these methods.

  1. Using the Data module (HTML5/Unity) which saves the user's progress on their CrazyGames account
  2. If your game has their own back-end, use the User module (HTML5/Unity) to link progress in your back-end to the user's CrazyGames account
  3. Alternatively you can use our Automatic Progress Save system. This is not allowed for games with in-game purchases as it relies on local data.