finds.dev

segmentio/analytics-next

Segment Analytics for Javascript

View on GitHubHomepage ↗

★ 480TypeScriptMITupdated Oct 2026

// the take

Segment's official JS/TS analytics SDK monorepo, covering both the browser package (analytics-next) and a Node package, used to send tracking events to Segment's platform and onward to whatever destinations you've configured. It's for teams already on Segment who need an event-tracking client, not a general-purpose analytics library you'd self-host.

The core event pipeline (buffer, queue, context, plugin) is cleanly separated from destination-specific logic, so middleware and routing rules can be added without touching core dispatch code. The persisted priority queue with backoff handles retries and offline buffering properly instead of just firing fetch calls and hoping. Test coverage is real rather than decorative: integration tests for lazy-init and pre-init ordering, backwards-compatibility tests pinned against older snippet versions, Playwright e2e browser tests, and a separate QA harness with benchmarking against production destinations.

This is a client for Segment's hosted platform, not a standalone library: destinations load via remote-loader/remote-middleware, which pulls third-party destination code from Segment's CDN at runtime based on your write key. That's a real supply-chain and CSP consideration for security-conscious teams - there's a dedicated csp-detection module specifically because this trips people up. The codebase carries years of backwards-compat weight from the original analytics.js (legacy-video-plugins, classic-destination fixtures, an isomorphic/browser eslint split), so you're never touching a clean rewrite. Star count (480) is modest for something this central to Segment's product, meaning community PRs move slowly and most support realistically routes through Segment's own channels rather than GitHub issues.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

search the same ground:

// at a glance

Stars
480
Forks
163
Language
TypeScript
License
MIT
Last commit
21 Oct 2026

// nearby

If analytics-next isn't quite it.

All repos →