v2.0.0 #11
0G3RA
announced in
Announcements
v2.0.0
#11
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
[2.0.0] — 2026-04-10
First release of the V2 architecture. Complete rewrite with a new
public API, full TypeScript types, and a clean lifecycle model.
See MIGRATION.md for the full 1.x → 2.0 guide.
Added
Public API
tv(options)factory function returning aClient.Clientwith lifecycle (connect,disconnect, events,Symbol.asyncDispose).TvSymbolwithprice(),snapshot(),info(),candles(),stream().Streamwith typed events (price,change,update,bar,error),Symbol.dispose, andSymbol.asyncIterator.Portfolio— ad-hoc multi-symbol collection (client.symbols([...])).Group— named, mutable collection with liveadd/remove/has/clearpropagating to active streams.GroupRegistry—Map-like container atclient.groups.MultiStream— shared multi-symbol stream base used byPortfolio,Group, andclient.stream().client.stream()— aggregate multi-symbol stream with automaticdedup across overlapping groups.
QuoteField,QuoteFieldTypeMap,QuoteSnapshot<F>,FullQuoteSnapshot,TradeTick,BarTick.Candle,Timeframe,RawTimeframe,TimeframeAlias,normalizeTimeframe.SymbolInfowith camelCase fields and an index signature forforward-compatibility.
TvError,TvConnectionError,TvProtocolError,TvSessionError,TvSymbolError,TvTimeoutError.Internal API
The
tradingview-api-adapter/internalsubpath exports low-levelprimitives for advanced users. These are semver-exempt — breaking
changes may happen in minor versions.
Transport— WebSocket lifecycle with reconnect and buffering.Protocol— pureencodeFrame/decodeFrames/encodeCommand/encodeHeartbeat.SessionManager— transport owner, heartbeat, routing, replay.QuoteSession/ChartSession— TradingView session logic.SymbolBatcher— the rate limiter used to coalesce add/remove ops.calculateBackoff,randomId,createLogger,kebabToCamel,transformKeys,symbolInfoFromRaw.Resilience
reconnect so consumer code never sees the outage.
SessionManager.cancel-within-window dedup (
add('X') + remove('X')in the samewindow emits nothing).
Authentication
auth.sessionid/auth.sessionidSign— sent asCookieheaderon the WebSocket handshake (Node only).
auth.authToken— sent viaset_auth_tokenmessage after theserver hello, defaults to
"unauthorized_user_token".localeoption — sent viaset_localeafter auth.Browser / dual runtime
import('ws')so browser bundlers drop the Nodewspackage from client builds.
WebSocketin browsers,wsin Node, fallback to native in Bun / Deno / Cloudflare Workers.happy-domtest environment for browser smoke tests.Proxy support
agentoption accepted bytv(), propagated through to thewspackage. Works with
https-proxy-agent,socks-proxy-agent, orany
http.Agent-compatible proxy client.Documentation
docs/getting-started.md— installation, concepts, troubleshooting.docs/api/— full reference forClient,TvSymbol,Stream,Portfolio/Group, and types.docs/guides/— streaming, candles, groups, reconnect, browser,proxy, auth.
MIGRATION.md— complete 1.x → 2.0 migration guide.CONTRIBUTING.md— development workflow,.jsextension rationale.Examples
12 runnable demos in
examples/:01-single-price.ts02-streaming.ts03-multi-symbol.ts04-groups.ts05-candles-history.ts06-candles-streaming.ts07-symbol-info.ts08-async-iterator.ts09-reconnect-resilience.ts10-browser.html11-proxy-node.ts12-auth-session.tsTesting and tooling
tests/unit/.tests/fixtures/ws-server.tsforintegration-like tests without touching the network.
LIVE_E2E=1environment variable.@vitest/coverage-v8with 85% statement threshold.tsupdual ESM + CJS build with.d.tsand.d.ctstypes.publintpre-publish validation.release workflow with npm provenance.
Changed
"type": "module") with a CJS fallback.keywordsinpackage.jsontrimmed to 10 honest entries from 12(removed
tradingview-webhooks,tradingview-indicator,bitcoin,dogecoin, and de-duplicated stock-related keywords).wsto^8.18.0(fixesGHSA-3h5v-q93c-6h6q).
Removed
src/Client.ts,src/Quote.ts,src/QuoteChannel.ts,src/TickerDetails.ts,src/WsProtocol.ts,src/adapters/*,demos/*. Replaced by the new architecture.Fixed
Unable to close WS connection.
client.disconnect()now releasesevery resource and allows the Node process to exit.
Unclear
trade/minute-bar/daily-bartypes. TheQuoteFieldTypeMapnow declares fullTradeTickandBarTickinterfaces with TypeScript checking.
Mobile browser quotes. Browser detection now uses the native
WebSocketwhen available and thewspackage is dropped frombrowser bundles via dynamic import.
Vue 3 WebSocket error. Same dynamic import fix.
Proxy server.
agentoption now propagates through the fullClient→SessionManager→Transportstack.This discussion was created from the release v2.0.0.
Beta Was this translation helpful? Give feedback.
All reactions