Frictionless - Overview

Simple code-only authentication [IDEN-Frictionless-01]

📘

A Beamable Prefab is available for this feature

Beamable provides a prefab for this feature which can be found in the Identity Prefabs section.

Beamable’s SDK provides frictionless authentication by default when the SDK is initialized. This is completely done for you under the hood. It is quite simple, and thus the Code Sample for it is short. However, this is an opportunity for you to learn more about the Beamable SDK and what it does for you when it is initialized from any “prefab”, service or API.

Frictionless Flow Diagram

859

Frictionless Flow

Whenever you use Beamable, you should initialize the SDK, this can be done more than once as it uses the Singleton pattern under the hood. That means it will only ever create one instance the Beamable API and it returns a reference to that instance.

Upon Initialization it passes necessary data about your device, such as Device ID, to the Beamable service to determine if a user has been created for this device yet. If it has not been created, it will create one for you and return an authorization token. If it has been created it will just return the authorization token.

Error Handling

Because initialization must communicate with the Beamable service, it is possible for an error to be thrown. It is up to you to determine the best course of action for when these errors occur.

If your game is an Online game, then you may want to return an error message to the player. If your game has offline play, you may want to hide these errors but take another course of action to enable the offline mode functionality of the game.