Skip to main content

Profiles

Profiles are the entities that deal with things like favourites, player events etc. so that each member of an account (usually a household) can have their own set of data (favourites, recommendations etc).

Default Profile

When logging in Backstage will automatically check for existing profiles. When no profiles exist it will create what's called a default profile. This is the profile that's automatically selected when a user logs in.

Even if you don't allow the creation/switching of profiles in a front-end app the entity will still exist in Backstage, but as you're automatically logged in with this particular profile there is no need to write additional logic to select the one and only profile available to the user.

The default profile will automatically be named after the first/lastName property of the user if available, if this is not available it will just be called Default. It will also have a default image attached, this image can be uploaded & selected in the Backstage CMS.

Creating a profile

If you want your users to be able to create their own profiles you can allow so via the Backstage API: create user profile.

In order to create a profile you'll need to provide the following information:

  • Profile name
  • Profile image

Selecting a profile image

Profile images follow a netflix-style selection mechanism where you're offered a selection of pre-populated images that you can select. These images can be uploaded by our customer in the Backstage CMS and can be retrieved via the list profile images API.

The profile images contain a name and a square (1:1 aspect ratio) image which can be used to render the list of images.

When your user has selected the profile image they want you need to pass the profile image ID into the create profile payload.

Updating a profile

Just like creating a profile you can update a profile through the update API. The data structure is exactly the same.

Setting the default

When sending the defaultProfile property and setting it to true that profile will now be set to be used as the default. The previous default profile will have it's property removed and the next time you log-in you'll automatically be assigned the new default profile.

Deleting a profile

Deleting a profile can be done through the delete API. When deleting a profile all data stored under this profile (favourites, player events etc.) will be lost!

Changing profiles

Changing profiles is touched upon in the registration & login section