The name of the Asset in Lens Studio.
ReadonlyuniqueWearable OnlyThe createWebAPISocket(endpoint, params) method initiates a WebSocket connection with the specified endpoint and the specified params to the Snap authorized remote services. Returns a WebSocket object that can be used to send and receive messages from the server.
Syntax
createAPIWebSocket(endpoint, params)
endpoint Defines the Snap authorized remote service endpoint to which to establish the WebSocket connection.params Defines the parameters that will be used to establish the connection.Example
//@input Asset.RemoteServiceModule remoteServiceModule
var remoteServiceModule = script.remoteServiceModule
// Create WebSocket connection.
let socket = script.remoteServiceModule.createAPIWebSocket("real_time", {"api-token" : "token", "api-example" : "realtime=v1", "model": "model"});
// Listen for the open event
socket.onopen = (event) => { print("Socket opened"); };
// Listen for messages
socket.onmessage = async (event) => { print("Socket message"); };
// Listen for the close event
socket.onclose = (event) => { print("Socket closed"); };
Wearable OnlyDeprecated. This method has been moved to InternetModule.
Experimental Wearable OnlyDeprecated. This method has been moved to InternetModule.
StaticcreateExperimental Wearable OnlyDeprecated. This method has been moved to InternetModule.
Wearable OnlyDeprecated. This method has been moved to InternetModule.
Optionaloptions: anyReturns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Wearable Only Camera KitGet a DynamicResource to be used with RemoteMediaModule from mediaUrl.
Wearable Only Camera KitDeprecated. This method has been moved to InternetModule.
Provides access to Snap authorized remote services.