Updated API doc

This commit is contained in:
Valdo Romao 2021-12-13 16:08:44 +00:00
parent 67fc6e8cd2
commit dbbfdfb66b

View file

@ -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`