Connection & auth
Every SDK session starts with connect(). Authentication is identical for WebSocket and HTTP transports; only the post-auth step differs.
Flow overview
Client DNotifier API
| |
|-- Authenticate (HTTPS) ---------->|
| appId, secret, userId |
|<-- token + plan limits -----------|
| |
| [transport = http] |
| connected → onConnected() |
| |
| [transport = ws] |
|-- Open WebSocket (WSS) ---------->|
|-- Handshake with token ---------->|
|<-- Handshake acknowledged --------|
| connected → onConnected() |Auth request
appId
string
Application id
secret
string
Application secret
userId
string
Connected user / service id
Credentials are sent over HTTPS to the production API. Exact URLs are handled by the SDK.
After successful auth
Auth token
Used for subsequent API and realtime calls (authToken after connect())
Plan limits
Available via getPlanLimits()
AI enabled flag
Sets aiEnabled / related plan fields
Message size limit
Used for automatic chunking of large payloads
WebSocket handshake
After auth, WebSocket clients open a secure connection, complete a short handshake with the auth token, then fire onConnected. Until handshake completes, application messages are not delivered.
HTTP transport
HTTP clients skip the WebSocket handshake. After auth succeeds:
The client is marked connected and
onConnected()firesEach API method (
sendAI,search, etc.) uses authenticated HTTPS independently
getPlanLimits()
Call after connect(). Throws if not connected.
messagesHardLimit
number
Hard cap on messages
maxAIRequestsPerMonth
number
AI request quota (0 if AI disabled)
maxAIWordsPerMonth
number
AI word quota
knowledgeBaseMaxWords
number
Knowledge-base word cap
aiEnabled
boolean
Whether AI/RAG is available
maxUsers
number
Storage user cap
maxRowsPerUser
number
Rows per user cap
Sender ids
Pass plain userId / senderId / receiverId values in your application code. The SDK scopes them to your app when talking to the server.
Error handling
Auth rejected (bad credentials)
Throws with an authentication error
WebSocket error
onDisconnected, isConnected = false
WebSocket close
onDisconnected with close details
Disconnecting
Dart / Flutter
notifier.disconnect() — closes WebSocket
Python
await notifier.disconnect()
JavaScript
Manage lifecycle in your app (close the underlying socket if needed)
See also
Last updated