The name of the Asset in Lens Studio.
Readonly
uniqueWearable Only
The 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 Only
Deprecated. This method has been moved to InternetModule.
Experimental
Wearable Only
Deprecated. This method has been moved to InternetModule.
Static
createExperimental
Wearable Only
Deprecated. This method has been moved to InternetModule.
Wearable Only
Deprecated. This method has been moved to InternetModule.
Optional
options: 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 Kit
Get a DynamicResource
to be used with RemoteMediaModule
from mediaUrl
.
Wearable Only
Camera Kit
Deprecated. This method has been moved to InternetModule.
Provides access to Snap authorized remote services.