Configuration options
The DNotifier constructor accepts credentials, transport selection, lifecycle callbacks, and optional tuning flags. All options are set once at construction time unless noted.
Required options
appId
string
Your DNotifier application id from the dashboard
secret
string
Application secret paired with appId
transport
"ws" | "http"
"ws" for persistent realtime messaging; "http" for RPC-style AI/RAG/workflow calls
userId
string
End-user or service identity used for auth and message routing
Optional options
logs
boolean
false
When true, AI sessions are reported to the DNotifier logs dashboard
url
string
Production WebSocket URL
Custom WebSocket endpoint (WebSocket transport only)
onConnected
function
no-op
Called when the client is authenticated and ready
onMessage
function
no-op
Called for each incoming framed message ({ metadata, payload })
onDisconnected
function
no-op
Called when the WebSocket closes or the transport errors
Platform-specific injection
JavaScript (Node.js)
WebSocketImpl
transport: "ws" — pass the ws package constructor
Dart / Flutter
connectWebSocket
Optional custom WebSocket factory for tests or proxies
Properties after connect()
These instance properties are populated after a successful connect():
isConnected
boolean
true after auth (HTTP) or handshake (WebSocket) completes
aiEnabled
boolean
Whether AI features are enabled on the current plan
authToken
string
Bearer token from the auth response
messageSizeLimit
number
Max single-chunk payload size in bytes (from plan, default 32 KiB)
appId
string
Echo of constructor appId
userId
string
Echo of constructor userId
Call getPlanLimits() for structured quota details.
Language pages
JavaScript / TypeScript — Full constructor signature, TypeScript notes,
WebSocketImplDart / Flutter — Named parameters,
connectWebSocket,disconnect()
See also
Last updated