How to Install the DNotifier SDK
Install the official DNotifier package for JavaScript/TypeScript, Python, or Flutter/Dart and verify your environment before you initialize the client.
JavaScript / TypeScript • Python • Flutter / Dart
Per the official DNotifier SDK table, there are three published SDKs today. .NET, Android, and iOS native SDKs are listed as "coming soon."
| Language | Package |
|---|---|
| JavaScript / TypeScript | @dnotifier-realtime/dnotifier (npm) |
| Dart / Flutter | dnotifier (pub.dev) |
| Python | dnotifier (PyPI) |
Pick the section below that matches your stack. You only need one.
Option A: JavaScript / TypeScript
Check Your Environment
Node.js backend: confirm Node is installed with node -v.
Browser/frontend project: no separate runtime check needed — browsers provide WebSocket natively.
Install the Package
- Yarn or pnpm equivalents:
- yarn add @dnotifier-realtime/dnotifier
- pnpm add @dnotifier-realtime/dnotifier
npm install @dnotifier-realtime/dnotifierNode.js Only — Install a WebSocket Implementation
Node has no built-in WebSocket client, so if you're using WebSocket transport (transport: "ws") from a Node.js backend, also install the ws package and pass it in as WebSocketImpl when you construct the client:
- Browser projects skip this step — the SDK uses the browser's native WebSocket automatically.
npm install wsVerify the Install
Confirm the package appears in package.json.
Confirm it imports correctly:
import { DNotifier } from "@dnotifier-realtime/dnotifier";const { DNotifier } = require("@dnotifier-realtime/dnotifier");Store Your Credentials as Environment Variables
Node.js: use a .env file with a loader (e.g. dotenv), read via process.env.DNOTIFIER_APP_ID / process.env.DNOTIFIER_SECRET.
Browser build tools (e.g. Vite): use the tool's own env convention (e.g. import.meta.env.VITE_DNOTIFIER_APP_ID).
Option B: Python
Check Your Environment
Confirm Python 3.9 or later:
- (Recommended) create and activate a virtual environment:
- python3 -m venv venv
- source venv/bin/activate # macOS/Linux
- venv\Scripts\activate # Windows
python3 --versionInstall the Package
pip install dnotifierVerify the Install
pip show dnotifierpython3 -c "import dnotifier; print(dnotifier.__file__)"Store Your Credentials as Environment Variables
Set them in your shell or a .env file loaded with something like python-dotenv:
DNOTIFIER_APP_ID=your_app_id
DNOTIFIER_SECRET=your_app_secretOption C: Flutter / Dart
Check Your Environment
Pure Dart project, no Flutter: use dart --version.
flutter --versiondart --versionAdd the Package
Pure Dart project: use dart pub add dnotifier.
This adds an entry such as dnotifier: ^1.1.1 under dependencies in pubspec.yaml.
flutter pub add dnotifierdart pub add dnotifierFetch the Package
Usually run automatically by pub add; run it manually if it wasn't.
flutter pub getVerify the Install
Confirm dnotifier is resolved in pubspec.lock.
Confirm it imports correctly:
import 'package:dnotifier/dnotifier.dart';Handle Credentials Correctly for Your Platform
Flutter apps (Android, iOS, Web) are client apps distributed to end users, same category as a browser app per official guidance: don't embed your App Secret directly in a production Flutter client. Have your Flutter app talk to your own backend (Node.js, Python, etc.), and let that backend hold the DNotifier credentials and make the SDK calls that require the secret.
Pure Dart (server/CLI use) can hold the secret directly via environment variables, the same as the Python or Node.js server case.
End of Tutorial Checklist
- Correct SDK package installed for your platform (@dnotifier-realtime/dnotifier, dnotifier via pip, or dnotifier via pub.dev)
- Node.js users: ws package installed if using WebSocket transport
- Install verified (importable, correct version resolved)
- App ID and App Secret stored outside source control, with the App Secret kept server-side only
Watch: How to Install the DNotifier SDK
Same steps as above — use whichever format you prefer.
DNotifier Tutorial