PHPackages                             webhubworks/inertia-props-stats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. webhubworks/inertia-props-stats

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

webhubworks/inertia-props-stats
===============================

Measures the size of InertiaJS props and provides statistics about them.

0.0.6(1mo ago)049MITVuePHP ^8.3CI failing

Since Jan 10Pushed 1mo agoCompare

[ Source](https://github.com/webhubworks/inertia-props-stats)[ Packagist](https://packagist.org/packages/webhubworks/inertia-props-stats)[ Docs](https://github.com/webhubworks/inertia-props-stats)[ GitHub Sponsors](https://github.com/Webhub)[ RSS](/packages/webhubworks-inertia-props-stats/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (20)Versions (7)Used By (0)

Inertia Props Stats
===================

[](#inertia-props-stats)

A Laravel package that measures the size of InertiaJS props and provides statistics about them. This tool helps you monitor and optimize your Inertia payloads during development.

What it does
------------

[](#what-it-does)

This package:

- **Measures payload size**: Automatically calculates the total size of your Inertia props in KB
- **Warns about large payloads**: Displays console warnings and an expandable stats panel when props exceed the configured threshold
- **Detects duplicate keys**: Identifies when the same key is used in both shared and page props
- **Development-only**: Only collects stats in non-production environments to avoid unnecessary overhead
- **Configurable exceptions**: Control when exceptions are thrown for duplicate keys or size violations
- **Flare integration**: Optionally reports large payloads to Spatie Flare for monitoring
- **Ray integration**: Sends payload statistics to Ray for debugging

The package provides detailed statistics including:

- Total payload size (shared + page props)
- Component-specific props size
- Configured threshold
- Amount exceeded (if applicable)
- Duplicate keys between shared and page props

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require webhubworks/inertia-props-stats
```

Publish the configuration file (optional):

```
php artisan vendor:publish --tag="inertia-props-stats-config"
```

This will create a `config/inertia-props-stats.php` file where you can customize:

```
return [
    'enabled' => env('INERTIA_PAYLOAD_SIZE_MEASUREMENT_ENABLED', true),

    'payload_size' => [
        'threshold_in_kb' => (int) env('INERTIA_PAYLOAD_SIZE_THRESHOLD_IN_KB', 500),
    ],

    'throw_exception' => [
        'on_duplicate_keys' => env('INERTIA_PROPS_THROW_EXCEPTION_ON_DUPLICATE_KEYS', true),
        'when_component_props_size_exceed_total_props_size' => env('INERTIA_PROPS_THROW_WHEN_COMPONENT_PROPS_EXCEED_TOTAL_PROPS_SIZE', true),
    ],
];
```

Configuration options:

- `enabled`: Enable/disable stats collection globally (disabled in production by default)
- `payload_size.threshold_in_kb`: Size threshold in KB before warnings are shown
- `throw_exception.on_duplicate_keys`: Throw an exception when duplicate keys are detected in shared and page props
- `throw_exception.when_component_props_size_exceed_total_props_size`: Throw an exception when component props exceed total props size

Recommended thresholds:

- Soft limit: 100-200KB
- Hard limit: 500KB

Vue.js Component
----------------

[](#vuejs-component)

An example Vue.js component is included in `resources/js/components/InertiaPropsStatsPanel.vue` that you can copy and paste into your main app.

This component:

- Monitors the `_inertiaPayloadTotalSizeInKb` prop
- Displays an expandable stats panel when the payload exceeds the threshold
- Shows detailed payload statistics including size, threshold, and duplicate keys
- Provides a cleaner UI for development environments with more detailed error messages

To use it, copy the component to your Vue.js application and include it in your main layout:

```

import InertiaPropsStatsPanel from '@/components/InertiaPropsStatsPanel.vue'

```

Note: The component requires `lucide-vue-next` for icons. Install it with:

```
npm install lucide-vue-next
```

License
-------

[](#license)

The MIT License (MIT). Please see the license file for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance89

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

6

Last Release

56d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec27ae4540fa1b8d81e3fa5f0ff42dd5c988fbc77c2b3014782e237b956e7817?d=identicon)[webhubworks](/maintainers/webhubworks)

---

Top Contributors

[![marventhieme](https://avatars.githubusercontent.com/u/53627227?v=4)](https://github.com/marventhieme "marventhieme (16 commits)")

---

Tags

laravelinertiainertiajsWebhub

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/webhubworks-inertia-props-stats/health.svg)

```
[![Health](https://phpackages.com/badges/webhubworks-inertia-props-stats/health.svg)](https://phpackages.com/packages/webhubworks-inertia-props-stats)
```

###  Alternatives

[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[robertboes/inertia-breadcrumbs

Laravel package to automatically share breadcrumbs to Inertia

56129.1k](/packages/robertboes-inertia-breadcrumbs)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[ziming/laravel-scrapingbee

A PHP Laravel Library for ScrapingBee

4310.6k](/packages/ziming-laravel-scrapingbee)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
