Python - websocket()
This is reference documentation for the Nitric Python SDK. To learn about Websockets in Nitric start with the Websockets docs.
Creates a new Websocket API.
from nitric.resources import websocketfrom nitric.application import Nitricpublic_websocket = websocket("public")Nitric.run()
Parameters
- Name
name- Required
- Required
- Type
- string
- Description
The unique name of this Websocket within the app. Subsequent calls to
websocketwith the same name will return the same object.
Examples
Create a Websocket
from nitric.resources import websocketfrom nitric.application import Nitricchat_websocket = websocket("chat")Nitric.run()
Have feedback on this page?
Open GitHub IssueLast updated on Jan 5, 2026