Your first connection
Connecting is the first code you write after installing an SDK. This page explains the flow conceptually; language-specific guides contain copy-paste examples.
What connect() does
When you call connect(), the SDK performs two phases depending on transport:
Phase 1 β Authentication (all transports)
Sends
appId,appSecret, anduserIDto the DNotifier auth endpointReceives an auth token and plan limits
Sets
aiEnabled,messageSizeLimit, and related properties on the client
If authentication fails (wrong secret, invalid app, plan issue), connect() throws an error.
Phase 2 β Transport setup
ws
Opens a WebSocket to DNotifier, sends a handshake frame with the token, waits for acknowledgment, then sets isConnected = true and calls onConnected
http
Skips the persistent socket; sets isConnected = true and calls onConnected immediately after auth
For your first message tutorial, use transport: "ws" so you can send and receive in realtime.
Constructor options (common to all SDKs)
appId
Yes
From dashboard
secret
Yes
From dashboard
transport
Yes
"ws" or "http"
userId
Yes
Your end-user or service identifier
onConnected
Recommended
Called when ready to send
onMessage
Recommended
Called for incoming WebSocket messages
onDisconnected
Recommended
Called when the socket closes
Optional: logs, url (custom WebSocket URL), and platform-specific WebSocket injection (Node.js).
Connection lifecycle
After a successful connect
You can read:
notifier.isConnectedβtruewhen readynotifier.getPlanLimits()β quotas from your plannotifier.aiEnabledβ whether AI features are onnotifier.messageSizeLimitβ max message size in bytesnotifier.authTokenβ token from the last auth (avoid logging in production)
Language guides
Pick your stack for a complete, runnable example:
.NET, Android, and iOS SDKs are coming soon β use JavaScript, Dart, or Python guides until those packages ship.
Prerequisites checklist
Next step
After you connect successfully, send your first 1:1 message:
Last updated