Skip to main content

require

Function

Load a JavaScript module.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

require(moduleName): any

Load a JavaScript module. Used for importing another JavaScript file found in the Resources panel to be used in the current script. Similar to require found in CommonJS specification.

Parameters

ParameterType
moduleNamestring | ScriptAsset

Returns

any

Remarks

You can access Lens Studio specific modules (like RemoteServiceModule) using the LensStudio prefix, such as: require("LensStudio:RemoteServiceModule).