From dbbfdfb66bc21b762d68b0a178197a2fe886d9b4 Mon Sep 17 00:00:00 2001 From: Valdo Romao Date: Mon, 13 Dec 2021 16:08:44 +0000 Subject: [PATCH] Updated API doc --- docs/maps/api-player.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/maps/api-player.md b/docs/maps/api-player.md index cb2910c7..9af0b1c2 100644 --- a/docs/maps/api-player.md +++ b/docs/maps/api-player.md @@ -65,12 +65,17 @@ WA.player.userRoomToken: string; ``` The user-room token is available from the `WA.player.userRoomToken` property. -This token is generated in WorkAdventure and contains information such as the player's room ID and its associated membership ID. -{.alert.alert-warn} -This token is used when you change your logo using a configured variable. -Indeed, to change your logo you need to perform an upload in order to get a file URL. This type of actions must be validated on our side. -If you are using a self-hosted version of WorkAdventure you will not have the possibility to perform actions that depends on the user-room token, unless you create an API that support it. +This token can be used by third party services to authenticate a player and prove that the player is in a given room. +The token is generated by the administration panel linked to WorkAdventure. The token is a string and is depending on your implementation of the administration panel. +In WorkAdventure SAAS version, the token is a JWT token that contains information such as the player's room ID and its associated membership ID. + +If you are using the self-hosted version of WorkAdventure and you developed your own administration panel, the token can be anything. +By default, self-hosted versions of WorkAdventure don't come with an administration panel, so the token string will be empty. + +{.alert.alert-info} +A typical use-case for the user-room token is providing logo upload capabilities in a map. +The token can be used as a way to authenticate a WorkAdventure player and ensure he is indeed in the map and authorized to upload a logo. {.alert.alert-info} You need to wait for the end of the initialization before accessing `WA.player.userRoomToken`