explaingit

guess-js/guess

7,120TypeScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

Guess.js is a JavaScript library that speeds up website navigation by automatically prefetching the pages users are most likely to visit next, driven by real traffic patterns pulled from your Google Analytics account.

Mindmap

mindmap
  root((Guess.js))
    What it does
      Predictive prefetch
      Faster navigation
      Analytics-driven
    Tech Stack
      TypeScript
      webpack
      Google Analytics
    Modules
      GA data fetcher
      Route parser
      GuessPlugin
    Use Cases
      Speed up websites
      Auto prefetch hints
      SPA optimization
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Speed up page navigation on a website by automatically prefetching the most likely next pages based on real Google Analytics traffic data.

USE CASE 2

Add predictive prefetching to a webpack project using GuessPlugin without manually writing prefetch hints that go stale.

USE CASE 3

Implement server-side next-page prediction for a non-webpack site using the Guess.js client-side script.

USE CASE 4

Keep prefetching decisions automatically up to date as traffic patterns change, with no manual hint maintenance.

Tech stack

TypeScriptJavaScriptwebpackNode.js

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires a Google Analytics account with existing traffic data and a configured webpack build pipeline, currently in alpha.

In plain English

Guess.js is a set of JavaScript libraries that makes websites load pages faster by predicting where a user is likely to navigate next and quietly fetching those pages in the background before the user clicks. The prediction is based on real traffic patterns pulled from Google Analytics: if analytics shows that 60% of visitors who land on your homepage then go to your pricing page, Guess.js will prefetch the pricing page automatically for each new visitor on the homepage. The project has two main integration paths. If you use webpack to bundle your JavaScript, there is a webpack plugin called GuessPlugin that connects to your Google Analytics account, reads the navigation data, and configures your build so that JavaScript bundles for likely next pages are loaded ahead of time. For sites that do not use webpack, there is a separate workflow that adds a small client-side script to your site, which asks a server for the most probable next URL and then prefetches it. The core packages are split into three modules. One module fetches and structures the navigation data from the Google Analytics API. A second module parses JavaScript framework routes so the tool understands how pages map to code bundles. The third is the webpack plugin itself, which brings the other two together and exposes configuration options for tuning how aggressively pages are prefetched based on connection speed and probability thresholds. The problem Guess.js addresses is that prefetching is underused on the web because it traditionally required developers to manually study analytics and hardcode prefetch hints. Those hints go stale as traffic patterns change. Guess.js automates the analysis and keeps the prefetch decisions in sync with current data. The project is labeled alpha in the README. It requires a Google Analytics account with existing traffic data to drive its predictions.

Copy-paste prompts

Prompt 1
I have a webpack-based website with Google Analytics. Show me how to install and configure GuessPlugin to automatically prefetch likely next pages for visitors.
Prompt 2
My website does not use webpack but I want predictive prefetching with Guess.js. Explain the client-side script approach and how it requests next-URL predictions from a server.
Prompt 3
How do I connect Guess.js to my Google Analytics account to read navigation pattern data? Walk me through the API authentication setup.
Prompt 4
I am building a React SPA with React Router and want to use Guess.js for route-based code-split prefetching. Show me the configuration.
Prompt 5
Explain how Guess.js decides which pages to prefetch and what probability threshold I should set to balance performance versus bandwidth.
Open on GitHub → Explain another repo

← guess-js on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.