PHPackages                             telehost/jarvis-client - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. telehost/jarvis-client

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

telehost/jarvis-client
======================

Jarvis monitoring agent client for Laravel — expose health metrics to the Jarvis autonomous monitoring agent via a standardized /jarvis/health endpoint

v0.1.0(1mo ago)00MITPHPPHP ^8.1

Since Apr 19Pushed 1mo agoCompare

[ Source](https://github.com/telehostca/jarvis-client-php)[ Packagist](https://packagist.org/packages/telehost/jarvis-client)[ Docs](https://github.com/telehostca/jarvis-client-php)[ RSS](/packages/telehost-jarvis-client/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

Jarvis Client for Laravel
=========================

[](#jarvis-client-for-laravel)

> Expose your Laravel app to [Jarvis](https://jarvis.telehost.net) — the autonomous monitoring agent that watches your infrastructure and alerts you via WhatsApp when things go wrong.

[![Packagist Version](https://camo.githubusercontent.com/84a370950056b48c7219173f73dde488e2506833c54a4c7df9eafa602c2faa8e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74656c65686f73742f6a61727669732d636c69656e742e737667)](https://packagist.org/packages/telehost/jarvis-client)[![License](https://camo.githubusercontent.com/e0200ade418240580a079948c63c2edab4481415fed3062756c148574c62e72f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74656c65686f73742f6a61727669732d636c69656e742e737667)](LICENSE.md)

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

[](#what-it-does)

Jarvis is an AI agent that polls your app every 15 minutes and asks "is everything OK?". If anything is off — queue backlog, dropped users, rising error rate, failed jobs — it sends you a WhatsApp message with evidence-based suggestions.

This package exposes a standardized `/jarvis/health` endpoint that Jarvis polls. You define what metrics to expose, the package handles the rest (auth, formatting, error isolation).

Why you want it
---------------

[](#why-you-want-it)

Without JarvisWith JarvisYou SSH in to check if things are OKJarvis tells you via WhatsApp when they're notErrors pile up until users complainJarvis catches trends before customers noticeYou learn Grafana/PrometheusYou define 5 closures and you're done$50+/month for DatadogFree tier, $19/mo Pro, with WhatsApp alerts in SpanishInstallation
------------

[](#installation)

```
composer require telehost/jarvis-client
```

Publish the config:

```
php artisan vendor:publish --tag=jarvis-config
```

Quick Start
-----------

[](#quick-start)

**1. Get your token** from  (register your app → copy token)

**2. Set it in your `.env`:**

```
JARVIS_TOKEN=jrv_app_abc123...
```

**3. Edit `config/jarvis.php`:**

```
return [
    'token' => env('JARVIS_TOKEN'),

    'metrics' => [
        'users_active' => fn () => \App\Models\User::where('suspended', false)->count(),
        'revenue_today' => fn () => \App\Models\Order::whereDate('created_at', today())->sum('total'),
        'queue' => fn () => [
            'pending' => \DB::table('jobs')->count(),
            'failed_1h' => \DB::table('failed_jobs')
                ->where('failed_at', '>=', now()->subHour())
                ->count(),
        ],
    ],

    'alerts' => [
        'disk_low' => fn () => disk_free_space('/') < 1_000_000_000
            ? ['severity' => 'critical', 'message' => 'Less than 1GB disk free']
            : null,
    ],
];
```

**4. That's it.** Jarvis will start monitoring within minutes.

Verify locally:

```
curl -H "Authorization: Bearer $JARVIS_TOKEN" http://localhost:8000/jarvis/health
```

You should see:

```
{
  "app": "My App",
  "version": "1.0",
  "timestamp": "2026-04-19T14:30:00Z",
  "status": "healthy",
  "metrics": {
    "users_active": 1247,
    "revenue_today": 82340.50,
    "queue": { "pending": 3, "failed_1h": 0 }
  },
  "alerts": [],
  "custom": []
}
```

Advanced
--------

[](#advanced)

### Custom route path

[](#custom-route-path)

```
JARVIS_PATH=/internal/jarvis
```

Or disable auto-registration and define it yourself:

```
// config/jarvis.php
'auto_register_route' => false,

// routes/web.php
Route::get('/custom/health/path', \TeleHost\Jarvis\JarvisHealthController::class)
    ->middleware([\TeleHost\Jarvis\JarvisAuth::class]);
```

### Per-request middleware

[](#per-request-middleware)

```
// config/jarvis.php
'middleware' => [
    'throttle:30,1', // 30 requests per minute from Jarvis
],
```

### Dynamic metric registration

[](#dynamic-metric-registration)

From a service provider:

```
use TeleHost\Jarvis\JarvisManager;

app(JarvisManager::class)
    ->metric('stripe_balance', fn () => \Stripe\Balance::retrieve()->available[0]->amount / 100)
    ->alert('subscription_renewal', function () {
        $expiring = Subscription::whereDate('expires_at', today()->addDays(7))->count();
        return $expiring > 10
            ? ['severity' => 'warning', 'message' => "{$expiring} subs expire this week"]
            : null;
    });
```

### Error isolation

[](#error-isolation)

If any metric closure throws, only that metric fails — the rest continue:

```
{
  "metrics": {
    "users_active": 1247,
    "external_api_count": { "error": "Connection timeout" },
    "revenue_today": 82340.50
  }
}
```

Jarvis handles the error gracefully and reports it to you.

What Jarvis expects
-------------------

[](#what-jarvis-expects)

Your closures can return:

- **Scalars**: `int`, `float`, `string`, `bool`
- **Arrays** (for grouped metrics): ```
    'whatsapp' => fn () => [
        'connected' => 15,
        'disconnected' => 2,
        'by_integration' => ['baileys' => 13, 'meta' => 4],
    ],
    ```
- **null** (metric skipped this cycle)

For **alerts**, return:

- `['severity' => 'info'|'warning'|'critical', 'message' => 'Human-readable text']`
- Or `null` (no alert)

Security
--------

[](#security)

- The endpoint is protected by a bearer token (NEVER commit it)
- Only Jarvis has the token — anyone else gets 401
- Use HTTPS in production (Laravel defaults to it behind most load balancers)
- Rotate the token anytime from the dashboard

Common metrics to expose
------------------------

[](#common-metrics-to-expose)

Tailor to your business, but here are patterns that work well:

```
'metrics' => [
    // Business health
    'users_active' => fn () => User::where('last_login_at', '>=', now()->subWeek())->count(),
    'new_signups_24h' => fn () => User::where('created_at', '>=', now()->subDay())->count(),
    'revenue_today' => fn () => Transaction::whereDate('created_at', today())->sum('amount'),

    // Infrastructure
    'queue' => fn () => [
        'pending' => DB::table('jobs')->count(),
        'failed_1h' => DB::table('failed_jobs')->where('failed_at', '>=', now()->subHour())->count(),
    ],

    // External dependencies
    'db_latency_ms' => fn () => measureDbLatency(),
    'stripe_reachable' => fn () => pingStripe(),

    // Error rates
    'error_rate_pct' => fn () => calculateErrorRate(),
],
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT. See [LICENSE.md](LICENSE.md).

Who builds this
---------------

[](#who-builds-this)

[TeleHost C.A.](https://telehost.net) — a Venezuelan infrastructure company that got tired of paying $50+/month for monitoring and built its own.

- Website:
- Issues:
- Related: [@telehost/jarvis-client](https://www.npmjs.com/package/@telehost/jarvis-client) (Node.js version)

###  Health Score

33

—

LowBetter than 73% of packages

Maintenance91

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

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

Unknown

Total

1

Last Release

51d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/06fe521b00e20ce5070fa9ca5881179c1dd476a7aa4bc2fe392bbf777efb04d9?d=identicon)[luisrosas90](/maintainers/luisrosas90)

---

Tags

laravelmonitoringwhatsappobservabilityhealth checkalertingjarvistelehost

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/telehost-jarvis-client/health.svg)

```
[![Health](https://phpackages.com/badges/telehost-jarvis-client/health.svg)](https://phpackages.com/packages/telehost-jarvis-client)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76318.2M110](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

59156.3k10](/packages/api-platform-laravel)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15104.9k4](/packages/calebdw-larastan)

PHPackages © 2026

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