Dosu LogoDosu Logo
Ask
Join our Discord
PersonalPublic
WorkAdventure
DocumentsPersonal
api-start
api-start
Type
External
Status
Published
Created
Feb 24, 2026
Updated
Feb 24, 2026
Source
docs/developer/map-scripting/references/api-start.md

Start#

Waiting for WorkAdventure API to be available#

When your script / iFrame loads WorkAdventure, it takes a few milliseconds for your script / iFrame to exchange
data with WorkAdventure. You should wait for the WorkAdventure API to be fully ready using the WA.onInit() method.

WA.onInit(): Promise<void>

Some properties (like the current user name, or the room ID) are not available until WA.onInit has completed.

Example:

WA.onInit().then(() => {
    console.log('Current player name: ', WA.player.name);
});

Or the same code, using await/async:

(async () => {
    await WA.onInit();
    console.log('Current player name: ', WA.player.name);
})();
Documents
Admin API Member Data Contract
Map Editor Authorization
OIDC Authentication & JWT Token Management
matrix
Phaser 4 GPU Tilemap Rendering
Self-Hosted Instance Configuration
install
matrix
README
README
wa-hosted
CHANGELOG
CONTRIBUTING
README
README
README
README
README
README
README
README
README
README
README
README
README
SECURITY
adminAPI
animations
api-camera
api-chat
api-controls
api-deprecated
api-event
api-mapeditor
api-metadata
api-nav
api-player
api-players
api-room
api-sound
api-start
api-state
api-ui
broadcast
camera
chat
chat-zones
communication-between-services
contributing-to-scripting-api
diagrams
entity-collection-file-format
entry-exit
entry-exit
events
focusable
github-pages
highlight
hosting
how-to-translate
index
index
index
index
index
index
index
invite
jitsi
jitsi
matrix-chat-zone
matrix-dev
meeting-rooms
meetingRoom
megaphone
open-link
open-link
openid
opening-a-website
personal-area
phone-chat
play-sound
play-sound
restricted-area
scripting-internals
self-hosted-access
silent
special-zones
text
troubleshooting
troubleshooting
using-typescript
variables
wa-maps
website-in-map
wokas