Tutorial 2 of 5

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

12 min read~3 min video

Per the official DNotifier SDK table, there are three published SDKs today. .NET, Android, and iOS native SDKs are listed as "coming soon."

LanguagePackage
JavaScript / TypeScript@dnotifier-realtime/dnotifier (npm)
Dart / Flutterdnotifier (pub.dev)
Pythondnotifier (PyPI)

Pick the section below that matches your stack. You only need one.

Option A: JavaScript / TypeScript

STEP 01

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.

STEP 02

Install the Package

  • Yarn or pnpm equivalents:
  • yarn add @dnotifier-realtime/dnotifier
  • pnpm add @dnotifier-realtime/dnotifier
npm install @dnotifier-realtime/dnotifier
STEP 03

Node.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 ws
STEP 04

Verify 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");
STEP 05

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

STEP 01

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 --version
STEP 02

Install the Package

pip install dnotifier
STEP 03

Verify the Install

pip show dnotifier
python3 -c "import dnotifier; print(dnotifier.__file__)"
STEP 04

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_secret

Option C: Flutter / Dart

STEP 01

Check Your Environment

Pure Dart project, no Flutter: use dart --version.

flutter --version
dart --version
STEP 02

Add 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 dnotifier
dart pub add dnotifier
STEP 03

Fetch the Package

Usually run automatically by pub add; run it manually if it wasn't.

flutter pub get
STEP 04

Verify the Install

Confirm dnotifier is resolved in pubspec.lock.

Confirm it imports correctly:

import 'package:dnotifier/dnotifier.dart';
STEP 05

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

Tutorial 2 of 5

  1. Tutorial 1How to Create a New Project
  2. Tutorial 2How to Install the DNotifier SDK
  3. Tutorial 3How to Choose a Transport
  4. Tutorial 4How to Make Your First Connection
  5. Tutorial 5How to Send and Receive Your First Message