@quotemedia.com/streamer
v2.64.0
Published
A JavaScript client for QuoteMedia's streaming data service.
Keywords
Readme
Overview
JavaScript streaming client that provides easy-to-use client APIs to connect and subscribe to QuoteMedia's market data streaming services.
https://quotemedia.com/
Getting Started
The Javascript streaming client is a library that contains all the necessary dependencies to run not only in the browser, but also in Node.js environments.
Browser Usage
To use the library in your browser project simply include the library file in your HTML page as a script.
Node.js Usage
Since the window object is not available in Node.js, it will need to be mocked before we import the library.
- Mock the window object before importing the library:
if (typeof global.window === 'undefined') { var window = { navigator: { userAgent: "atmosphere.js" }, document: {}, location: { protocol: 'https:'}, JSON: JSON }; window.WebSocket = require("ws"); window.EventSource = require("eventsource"); window.XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; global.window = window; global.location = window.location; global.WebSocket = window.WebSocket; global.EventSource = window.EventSource; global.navigator = window.navigator; global.document = window.document; } - Then import the library with require syntax:
var Streamer = require("<path to the library>"); - The library is ready for use in your
Node.jsproject.
Examples
- Enterprise Example An example showing how to configure, create a stream, and subscribe to market data with tokens.
- Enduser Example: An example showing how to configure, create a stream, and subscribe to market data with enduser credentials.
- WMID Example: An example showing how to configure, create a stream, and subscribe to market data with a webmaster ID.
- Stomp Example: An example showing how to subscribe and unsubscribe to market data using the Stomp protocol.
- Reconnect Example: An example showing how configure and setup automatic reconnection.
- Subscription Example: An example showing how to subscribe to the trade data market type.
