Skip to main content

Complete JavaScript Client

Here’s a full-featured Node.js WebSocket client for the QuantCite API:

Package Configuration

Create a package.json file:
Install dependencies:

Usage Examples

Basic Usage

Event-Driven Processing

Multiple Symbol Management

Key Features

Event-Driven Architecture

Built with Node.js EventEmitter for efficient real-time data processing and custom event handling.

Automatic Reconnection

Handles connection drops with exponential backoff retry logic and maintains subscriptions.

Comprehensive Error Handling

Proper error handling for all message types with detailed logging and event emission.

Health Monitoring

Built-in ping/pong mechanism with connection health monitoring and latency tracking.

Browser Compatibility

For browser usage, create a simplified version without Node.js dependencies:
Remember to replace "demo_key_123" with your actual API key. The client includes automatic reconnection and comprehensive error handling for production use.