Package Installation
AfterLink v2.0.2 is designed with strict modularity in mind. You can install the monolith package, pull individual libraries for Node.js, Python, or Dart, or load browser wrappers to fit your production stack footprint.
System Requirements
- Node.js: version
v18.0.0or higher (v20+ LTS recommended) - Python: version
3.8+(for Python SDK) - Dart / Flutter: Dart
3.0+/ Flutter3.0+(for Dart SDK) - npm: version
v9.0.0or higher - Operating System: Linux, macOS, or Windows (WSL recommended)
1. Distribution Channels
AfterLink packages are published to two separate registries. Choose the channel that best suits your deployment environment.
Registry 1: npm (Standard / Recommended)
The standard release packages are published on the public npm registry under the official @afterlink/* scope. You can install all key modules in one command using your preferred package manager:
Registry 2: GitHub Packages (Alternative)
As an alternative distribution channel, packages are also published to GitHub Packages under the @ajaymyth/* scope. To fetch packages from GitHub, route the @ajaymyth scope in your local .npmrc configuration file:
After setting up your .npmrc file with your GitHub Personal Access Token (PAT), install the scoped package directly:
Note: Starting in v2.0.0+, the umbrella afterlink package is optimized for speed and production safety. It has 0 security vulnerabilities and a small dependency footprint. It installs core, server, client, cluster, browser, and CLI tools. The optional terminal AI assistant (@afterlink/ai-assistant) is kept separate. If you want the offline AI assistant, install it explicitly.
2. Modular Distribution Packages
If you are building lightweight microservices, embedded nodes, or multi-language services, you can install only the specific packages you need:
| Package Name | Purpose | Context / Registry |
|---|---|---|
| @afterlink/core / @ajaymyth/core | Binary frame codec (encoder, decoder, Protocol v2 16-byte header) | Any / Universal (npm) |
| @afterlink/server / @ajaymyth/server | High-throughput TCP server runtime module with Prometheus & tracing | Node.js Server (npm) |
| @afterlink/client / @ajaymyth/client | Persistent TCP client wrapper with auto-reconnect & priority framing | Node.js Client (npm) |
| @ajaymyth/cluster | Redis-backed Node clustering, worker crash detection, and SIGUSR2 restarts | Node.js Server (npm) |
| afterlink (PyPI) | Native Python SDK with async client/server, sync wrapper, & Pydantic validation | Python 3.8+ (PyPI) |
| afterlink (pub.dev) | Dart & Flutter SDK with native TCP and web WebSocket transports | Dart 3.0+ / Flutter (pub.dev) |
| @afterlink/browser / @ajaymyth/browser | WebSocket fallback SDK with binary streaming support | Web Browser (npm) |
| @afterlink/cli / @ajaymyth/cli | Command-line debuggers, packet tracers, and validators | Global / CLI (npm) |
| @afterlink/ai-assistant | Offline RAG AI assistant — answers AfterLink questions in your terminal | Global / CLI (npm) |
Install selected modular Node distributions as follows:
3. Node Clustering Package (@ajaymyth/cluster)
To scale AfterLink horizontally across multi-core Node.js servers with shared Redis pub/sub routing, worker crash detection, and SIGUSR2 rolling restarts, install @ajaymyth/cluster:
4. Python SDK Installation (afterlink)
The AfterLink Python SDK is published on PyPI under the afterlink package name. Install it using pip:
5. Dart & Flutter SDK Installation (afterlink)
The Dart client SDK is available on pub.dev under afterlink. Add it to your Dart or Flutter project:
6. Quick Start — Server
Create a server script in your project root to handle binary framing:
7. Quick Start — Client
Establish a persistent connection from your client and publish your first frame:
8. Command-Line Developer Tools
AfterLink includes a command-line interface (CLI) to trace active frame streams, inspect live connection channels, and generate mock frame sequences during development:
Verify the command line tool installation by checking its version:
The AfterLink CLI ships with these powerful built-in utility commands:
afterlink ping <host:port>: Sends persistent ping packets to calculate heartbeat latencies.afterlink call <host:port> <route> [payload]: Invokes direct RPC endpoints and reports matching reply values.afterlink inspect <hex-string>: Decodes raw wire hex buffers into readable, formatted JSON blocks.afterlink monitor <host:port> <channel>: Listens to real-time pub/sub streams and prints routing traces.
9. Browser CDN Fallback Setup
If you are building simple frontend HTML interfaces without module bundlers, load the browser client fallback directly via CDN providers:
10. Browser Compatibility & Bundling Fixes
To guarantee compatibility across Node.js and client-side web environments, the core package (@afterlink/core / @ajaymyth/core) has been upgraded with a native "browser" mapping configuration inside its package.json.
When bundling for the browser (such as in @afterlink/browser), modern bundlers like esbuild, webpack, or Vite will automatically detect this mapping. They will dynamically ignore and stub out Node-specific modules ('net', 'tls', and 'zlib') and disable Node-specific client files (like TcpClient). This ensures the package builds and functions flawlessly in web applications without requiring complex custom configuration.
11. TypeScript Setup & Paths
If compiling with TypeScript, declare the paths inside your configuration file for proper module resolution:
12. AI Assistant (optional)
Install the offline AI assistant to ask questions directly in your terminal:
13. Upgrading an Existing Project to v2.0.2
If you already have AfterLink installed and want to upgrade all packages to the latest v2.0.2 versions in one go: