Import Libraries for Alpaca API, Step 1

PHOTO EMBED

Wed Dec 09 2020 20:41:41 GMT+0000 (UTC)

Saved by @sam

// alpaca-api.js

// Import websocket libraries
const Websocket = require('ws');
const ReconnectingWebSocket = require('reconnecting-websocket');
// set up the Alpaca stream endpoint
const ALPACA_STREAM_URL = "wss://paper-api.alpaca.markets/stream";
// get the access_token from your OAuth Login function
const { access_token } = loginAlpaca();
content_copyCOPY