Node.js - websocket()
Creates a new Websocket.
import { websocket } from '@nitric/sdk'const socket = websocket('socket')
Parameters
- Name
name- Required
- Required
- Type
- string
- Description
The unique name of this Websocket within the app. Subsequent calls to
websocket()with the same name will return the same object.
Examples
Create a Websocket
import { websocket } from '@nitric/sdk'const socket = websocket('socket')
Have feedback on this page?
Open GitHub IssueLast updated on Jan 5, 2026