# framebudget > framebudget is a TypeScript library for the browser that decides, per device, which visual effects a site can afford. It measures how much of each 16.7 ms frame a device really has and allows only the effects that fit, so slow phones never stutter and fast phones keep everything. - Install with `npm install framebudget`: the framework-free core for any site, ESM only, with type declarations, MIT license, one dependency (it re-exports `@framebudget/core`, the same code). React, Vue and Angular have their own packages, each of which installs `@framebudget/core` and has its framework as a peer dependency: `npm install @framebudget/react` (React 18+), `@framebudget/vue` (Vue 3.3+), `@framebudget/angular` (Angular 18+). Installing only a binding is fine; with `framebudget` next to a binding, both resolve to the same `@framebudget/core`, so the page has one `budget`. - Entry points: `framebudget` (the `budget` object, `configure`, `createBudget`, `Tier`, `defaultCalibration`), `framebudget/boot` (`bootScript`, `createBootScript`), `framebudget/panel` (`mountPanel`). Since 0.8.0 the React hooks live in `@framebudget/react`, not in `framebudget`. - Framework bindings: `@framebudget/react` (`useBudget(effect)`, a boolean that re-renders on change, `useTier()`, `BudgetProvider` only for a budget other than the page's), `@framebudget/vue` (`useBudget(effect)` returns a computed ref and accepts a string, a ref or a getter, `useTier()`, `provideBudget(budget)` in a parent's setup), `@framebudget/angular` (`injectBudget(effect)` returns `Signal` and accepts a string or a signal, `injectTier()`, `provideBudget(budget)` returns a provider for the application, a route or a component; call them in an injection context; no decorators, so no Angular compiler step). All answer `false` and `Lite` during server rendering and hydration (Vue until mount, Angular until the first browser render). - An inline boot script runs a 2 ms CPU benchmark before the first paint and writes the decision on `` as `data-framebudget` (the tier) and `data-framebudget-effects` (the allowed effects), so CSS can gate effects with `html[data-framebudget-effects~="parallax"]`. - Each effect has a score threshold (100 is the reference phone), a relative frame cost, and optional `motion` and `data` flags. A runtime governor watches real frame gaps and steps the most expensive effects down. Local learning remembers effects that stuttered on the device. - On the server, `budget.allows()` answers `false` and the tier is `Lite`. Telemetry is off by default and only the site developer can turn it on (`configure({ share: true })`). Once on, sampled anonymous reports always go to `https://framebudget.dev/api/report` (plus one optional endpoint of your own, `alsoSendTo`) and the calibration comes from `https://framebudget.dev/api/calibration` (or `calibrationUrl`); both accept any origin. Nothing is sent under Global Privacy Control or Save-Data. Since 0.5.0, `endpoint` is renamed `alsoSendTo`. ## Docs - [API reference](https://framebudget.dev/api): every export, the boot script, effects and tiers, simulating a device, the governor, calibration, telemetry, the React, Vue and Angular bindings and the diagnostics panel. - [Full documentation in Markdown](https://framebudget.dev/llms-full.txt): install, boot script, usage, API, effects, tiers, benchmark, governor, learning, calibration, React, telemetry and privacy, in one file. - [README on GitHub](https://github.com/framebudget/core#readme): the same documentation, next to the source. ## Examples - [Live demo](https://framebudget.dev/): the landing page is itself built with framebudget. Its device simulator calls `budget.simulate(score)` so the page really changes per device. ## Optional - [Source code](https://github.com/framebudget/core): TypeScript, MIT license. - [Privacy on framebudget.dev](https://framebudget.dev/privacy): what framebudget.dev keeps from the anonymous reports, its own visitors' and those of every site that turned sharing on, and how to opt out.