Added the user-room token created from admin when we access a room

This commit is contained in:
Valdo Romao 2021-12-01 15:38:34 +00:00
parent 9eb4206fe0
commit dd79f7d0f4
13 changed files with 63 additions and 2 deletions

View file

@ -58,6 +58,29 @@ WA.onInit().then(() => {
})
```
### Get the user-room token of the player
```
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.
{.alert.alert-info}
You need to wait for the end of the initialization before accessing `WA.player.userRoomToken`
```typescript
WA.onInit().then(() => {
console.log('Token: ', WA.player.userRoomToken);
})
```
### Listen to player movement
```
WA.player.onPlayerMove(callback: HasPlayerMovedEventCallback): void;