serverUrl uses a WebSocket origin such as wss://metatell.app.
Do not include the room path.roomId is the room ID, not the full URL.authToken is set and has
not expired.debug: true to print more connection logs.connect(): AuthenticationError indicates an
authentication failure, and TransportError.reason contains the underlying
connection error.chat.onMessage() before or immediately after connect().mention field before filtering.client.chat.onMessage(({ from, text, mention }) => {
console.log({ from: from.name, text, mention })
})
Fetch the bot session ID after connect() and compare it with
mention.sessionId:
await client.connect()
const botInfo = await client.getInfo()
client.chat.onMessage(async ({ mention, reply }) => {
if (mention?.sessionId === botInfo.sessionId) {
await reply('Mention received.')
}
})
MetatellClient does not
throttle moveTo(); use RateLimitedQueue or your own timer for frequent
movement loops.rotateTo().avatar.getAvailableAnimations() and use an ID that exists for the
selected avatar.idle and walking are guaranteed preset IDs.@metatell/bot-sdk and @metatell/bot-realtime.enableVoice() after connect().sampleRate option does not
resample; convert other rates with pcm.resample().sendVoiceFrame() requires 960-sample Int16Array frames for 20 ms, or 480
samples with frameDurationMs: 10.metatell.app and metatell-stg.app, set
METATELL_REALTIME_URL to the LiveKit URL.transport: { type: 'mock' }) when testing
audio logic without a live room.prepareNavigation() rejects with a NavigationError. Check its code:
SCENE_UNAVAILABLE: the room join did not report a supported scene asset.
Call connect() first.SCENE_FETCH_FAILED: the GLB request failed or its URL is not allowed. Add a
custom-domain CDN to additionalAllowedOrigins as an exact HTTPS origin.SCENE_FORMAT_UNSUPPORTED: the scene is not a self-contained GLB.SCENE_TOO_LARGE: the download exceeds maxBytes.NAV_MESH_TOO_LARGE: the navmesh exceeds maxDecodedBytes or
maxTriangles. Raise the limit only for trusted scenes.NAV_MESH_NOT_FOUND or NAV_MESH_INVALID: the first nav-mesh marker is
missing, is not a character navmesh, or has no mesh.NAV_MESH_UNSUPPORTED: the scene uses a geometry compression extension other
than EXT_meshopt_compression, KHR_draco_mesh_compression, or
KHR_mesh_quantization.SCENE_CHANGED: the room scene changed. Prepare a new snapshot.Retry only when error.retryable is true. If you pass signal and abort it,
prepareNavigation() rejects with an AbortError (the signal's reason when it
is an AbortError, otherwise a DOMException), not a NavigationError.
moduleResolution to NodeNext,
Node16, or Bundler so the @metatell/bot-sdk/navigation subpath export
resolves.Disable debug for normal operation or register a custom logger provider. See
Logging and errors.