Lens Scripting API

    Class ConnectedLensModule

    Enables the creation and management of networked Lens experiences, allowing for real-time communication and interaction between users through Connected Lenses.

    Allows use of networked Lens communication capabilities such as real-time communication, co-located session creation and joining, and shared persistent storage. It's recommended to only use one ConnectedLensModule per Lens.

    function createSession() {
    var options = ConnectedLensSessionOptions.create();

    options.onSessionCreated = onSessionCreated;
    options.onConnected = onConnected;
    options.onDisconnected = onDisconnected;
    options.onMessageReceived = onMessageReceived;
    options.onUserJoinedSession = onUserJoinedSession;
    options.onUserLeftSession = onUserLeftSession;
    options.onError = onError;

    script.connectedLensModule.createSession(options);
    }

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    name: string

    The name of the Asset in Lens Studio.

    uniqueIdentifier: string

    Methods

    • Create session with the provided options. Will also check if there is a session that can be created from a session sharetype received from other users.

      Parameters

      Returns void

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean

    • Share the session with other users, specified by the SessionShareType. Note that if shared via Invitation, a new session will be created. Expect a new onConnected callback with the new session being passed in.

      Parameters

      Returns void

    MMNEPVFCICPMFPCPTTAAATR