OwlEye Blog
Small is a budget, not a leaderboard
Published · by Shrinath Prabhu
Updated
“Tiny SDK” is easy to type. Keeping one small requires a build that complains when it grows. OwlEye measures its browser bundles and checks compressed bytes against explicit budgets. The check runs in CI, alongside the SDK tests.
Compare the same thing
A package directory, an ESM entry file, a complete import graph, and a standalone browser script are different measurements. A small entry file can import larger shared chunks. Gzip and Brotli produce different numbers. Compression level and optional features matter.
That is why we do not turn an unversioned download or a vendor’s headline into a “smallest analytics SDK” claim. A defensible comparison needs exact versions, reproducible commands, equivalent features, and saved artifacts. It also needs a date, because software changes.
Three entrypoints, three choices
The core entrypoint handles page analytics and explicit custom events. The optional rules entrypoint loads console-managed interaction rules. The performance entrypoint handles explicit operation timing. Import what the site uses.
Rules add selector matching, conditions, observation, and validation. That code has a cost. We will not advertise a core-only byte count as though it includes the rule engine. Likewise, zero runtime dependencies does not mean zero browser work or zero network traffic.
What the build checks
Our size script reads the built JavaScript and compresses it with Node’s gzip implementation at level 9. It compares the result with byte limits and fails when a measured surface exceeds its budget. The standalone IIFE includes its browser runtime. The check measures complete consumer ESM graphs as well as reporting entry-file sizes, so a small entry file cannot hide large shared imports.
Run the SDK build and size check from a source checkout:
pnpm --filter @owleye/analytics buildpnpm --filter @owleye/analytics sizeA budget failure should trigger an explanation: a useful new capability, accidental duplication, or an import that pulled in more than intended. It should not trigger a silent budget increase.
We keep validation at the browser boundary too. For example, global and per-event properties share the API’s ten-property limit. Saving a few bytes by sending invalid events would make the bundle smaller and the product worse.
Start with the SDK reference, choose the entrypoints you need, and measure your production build. Add the optional rules module once if you want to configure supported interactions from the dashboard, then use a funnel to see where visitors drop off. The best byte is still the one your site did not need to download.