LensStudio script.remoteServiceModule is undefined

13 Views Asked by At

I have this script in a SnapChat filter

// @input Asset.RemoteServiceModule remoteServiceModule
var request = global.RemoteApiRequest.create();
request.endpoint = "start"
script.remoteServiceModule.performApiRequest(request, function(response){
if(response.statusCode !== 1){
print("Request Failed with code: " + String(response.statusCode))
return
}
})

but "script.remoteServiceModule" is undefined, so I can't make api request. What can I do to fix this error? I working on Lens Studio 4.55.1 Thanks

1

There are 1 best solutions below

0
Mauro Sala On

You need to add remote media module to your resources (for example import from the Api section of Asset Library) and set it as an input of this script!

enter image description here