Configuration

Realtime

Configuration for WebSockets and GraphQL Subscriptions.
Environment Variables
Environment variables are configurable for Directus Business Cloud and Enterprise Cloud projects via our Customer Success team. You can also set environment variables in self-hosted projects.

Directus Realtime provides WebSockets and GraphQL Subscriptions.

VariableDescriptionDefault Value
WEBSOCKETS_ENABLEDWhether or not to enable all WebSocket functionality.false
WEBSOCKETS_HEARTBEAT_ENABLEDWhether or not to enable the heartbeat ping signal.true
WEBSOCKETS_HEARTBEAT_PERIODThe period in seconds at which to send the ping. This period doubles as the timeout used for closing an unresponsive connection.30

It's recommended to keep the WEBSOCKETS_HEARTBEAT_PERIOD between 30 and 120 seconds, otherwise the connections could be considered idle by other parties and therefore terminated.

WebSockets

VariableDescriptionDefault Value
WEBSOCKETS_REST_ENABLEDWhether or not to enable the WebSocket message handlers.true
WEBSOCKETS_REST_PATHThe URL path at which the WebSocket endpoint will be available./websocket
WEBSOCKETS_REST_CONN_LIMITHow many simultaneous connections are allowed.Infinity
WEBSOCKETS_REST_AUTHThe method of authentication to require for this connection. One of public, handshake or strict.handshake
WEBSOCKETS_REST_AUTH_TIMEOUTThe amount of time in seconds to wait before closing an unauthenticated connection.30
Read more about different authentication methods with Directus Realtime.

GraphQL

VariableDescriptionDefault Value
WEBSOCKETS_GRAPHQL_ENABLEDWhether or not to enable GraphQL Subscriptions.true
WEBSOCKETS_GRAPHQL_PATHThe URL path at which the GraphQL Subscriptions endpoint will be available./graphql
WEBSOCKETS_GRAPHQL_CONN_LIMITHow many simultaneous connections are allowed.Infinity
WEBSOCKETS_GRAPHQL_AUTHThe method of authentication to require for this connection. One of public, handshake or strict.handshake
WEBSOCKETS_GRAPHQL_AUTH_TIMEOUTThe amount of time in seconds to wait before closing an unauthenticated connection.30
Read more about different authentication methods with Directus Realtime.

Logging

Read more about logging with Directus Realtime in the logging configuration.