WebSockets
Two-way connections to a server: WebSocket and its events.
Commonly used
InternetModuleProvides access to the open internet.In Cloud, Networking & Storage › Internet AccessWebSocketWebSocket provides an API for managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.WebSocketCloseEventEvent type for WebSocket close events.WebSocketMessageEventEvent type for WebSocket message events.
Guides
WebSocketConnect a SPECS Lens to real-time data streams over the internet with the WebSocket API, for live updates and two-way communication.Internet AccessUse the Fetch API and InternetModule in a SPECS Lens to make HTTPS requests, call external APIs, download media, and check whether the internet is available.Edge FunctionsDeploy a Snap Cloud edge function from the dashboard and call it from a SPECS Lens, with a sum example and an image round trip through Storage.StorageCreate a Snap Cloud storage bucket and download images, 3D models, and audio from it into a SPECS Lens.Authentication FlowImplement OAuth2 sign-in in SPECS Lenses with Auth Kit's Authorization Code and Implicit flows and deep link redirects.Script ModulesScript Modules allow you to encapsulate code to use throughout your project.
All APIs in this topic
Objects and data
| API | Description |
|---|---|
| WebSocket SPECS Camera Kit | WebSocket provides an API for managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. |
| WebSocketCloseEvent SPECS Camera Kit | Event type for WebSocket close events. |
| WebSocketEvent SPECS Camera Kit | Generic event type for WebSocket. |
| WebSocketMessageEvent SPECS Camera Kit | Event type for WebSocket message events. |