Skip to main content

Building Connected Lenses

Connected Lenses for Spectacles are built in Lens Studio. Lens studio offers a number of tools for building and testing Connected Lenses in the editor and on device.

Spectacles Sync Kit

Spectacles Sync Kit is a Lens Studio package that provides the core logic, APIs, and components for building Connected Lenses on Spectacles. For more information about how to set up a project with Spectacles Sync Kit, see Spectacles Sync Kit > Getting Started.

TypeScript Status panel

The Spectacles Sync Kit package is written in TypeScript, which needs to be compiled before you can preview your Lens. Add the TypeScript Status panel to your Lens Studio layout via Windows > Utilities > TypeScript Status panel to confirm compilation.

Project Settings

In Project Settings > Platform Settings, select Spectacles. This configures the appropriate permissions for Connected Lenses on Spectacles.

Connected Lens Module

The Spectacles Sync Kit package includes a Connected Lens Module that connects your Lens to the Connected Lenses backend. The Inspector panel for the Connected Lenses Module includes a Session ID field. The Session ID is is a unique string that identifies the session. Press the Randomize Session ID button to create a new session or to reset the session for all Preview panels.

Multiple Previews

Connected Lenses can be tested in Lens Studio using multiple Preview panels. When multiple Preview panels are open, each Preview simulates a different user in a Connected Lenses session. To add an additional Preview panel to your Lens Studio layout, select Windows > General > Preview. Configure new Preview panels for Spectacles.

Each Preview panel shows the Session ID that it is connected to. This can be used to verify that Previews are joining the same session.

To exit the session from a Preview panel, press the Refresh button at the top right of the panel. This will reset the Preview to the Start Menu.

Connected Lenses Monitor [Beta]

The Connected Lenses Monitor [Beta] is a tool that provides a real-time view of the session, including messages and data stores. It can be added from Windows > Utilities > Connected Lenses Monitor. For more information on how to use the Connected Lenses Monitor, see How to Use Connected Lenses Monitor.

Testing on Spectacles

To test your Connected Lens on Spectacles, follow these steps:

  1. For multiple pairs of Spectacles, pair each device to a separate Snapchat account.
  2. Pair each Snapchat account to Lens Studio.
  3. In Lens Studio, select Send to All Paired Spectacles.

Known Issues and Limitations

  • Only one pair of Spectacles can be paired to a given Snapchat account at a time.
  • Connecting Spectacles to Lens Studio directly using the Connect Spectacles button is not currently supported for testing Connected Lenses.
  • If you send a Connected Lens to Spectacles again while the Lens is still open on Spectacles, the Lens will not launch properly. As a workaround, close the Lens on Spectacles before sending it again from Lens Studio.
  • Joining the same session from Lens Studio and Spectacles is not currently supported.

Restrictions

When building and using Connected Lenses, some APIs are restricted for privacy. For more information, see Connected Lenses > Restrictions.

Was this page helpful?
Yes
No