smwebsdk.scene.connect_1
Home > @soulmachines/smwebsdk > Scene > connect
Scene.connect() method
Connect to a scene at the given server uri.
Signature:
connect(serverUri?: string, userText?: string, accessToken?: string, retryOptions?: RetryOptions): Promise<string | undefined>;
Parameters
Parameter | Type | Description |
---|---|---|
serverUri | string | (Optional) The server websocket uri to connect to. |
userText | string | (Optional) A custom text string that is sent to the orchestration server. |
accessToken | string | (Optional) A jwt access token issued to permit access to this server. |
retryOptions | RetryOptions | (Optional) Options for customizing connection error retry. |
Returns:
Promise<string | undefined>
Returns a promise that holds success/failure callbacks. If the promise is rejected then an Eror is given as the argument converts to a string message. The error result has two fields 'message' which is the string message and 'name' which is one of the following error name/reason codes: - **notSupported** - the browser does not support getUserMedia - **noUserMedia** - the microphone/camera is either not available, not usable or the user declined permission to use them - **serverConnectionFailed** - the connection to the server failed - **noScene** - no persona was available - **mediaStreamFailed** - the audio/video stream failed - **sessionTimeout** - the session timed out before it was fully available