PHPackages                             illuma-law/healthcheck-typesense - 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. illuma-law/healthcheck-typesense

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

illuma-law/healthcheck-typesense
================================

A Typesense health check for Spatie's Laravel Health package.

v0.1.4(1mo ago)062MITPHPPHP ^8.3CI passing

Since Apr 20Pushed 1mo agoCompare

[ Source](https://github.com/illuma-law/healthcheck-typesense)[ Packagist](https://packagist.org/packages/illuma-law/healthcheck-typesense)[ Docs](https://github.com/illuma-law/healthcheck-typesense)[ RSS](/packages/illuma-law-healthcheck-typesense/feed)WikiDiscussions main Synced 1w ago

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

Healthcheck Typesense for Laravel
=================================

[](#healthcheck-typesense-for-laravel)

[![Tests](https://github.com/illuma-law/healthcheck-typesense/actions/workflows/run-tests.yml/badge.svg)](https://github.com/illuma-law/healthcheck-typesense/actions)[![Packagist License](https://camo.githubusercontent.com/e60623f508586f049d48cfb8396ee411b0c9bc3be174381a1893c37462a3c1e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e63652d4d49542d626c7565)](http://choosealicense.com/licenses/mit/)[![Latest Stable Version](https://camo.githubusercontent.com/a165b22772bd011765ff3055e1a1120b3b2dd337fce1632e185bba2a3534be0f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c6c756d612d6c61772f6865616c7468636865636b2d7479706573656e73653f6c6162656c3d56657273696f6e)](https://packagist.org/packages/illuma-law/healthcheck-typesense)

A Typesense health check for Spatie's [Laravel Health](https://spatie.be/docs/laravel-health/v1/introduction) package.

This package provides a direct and reliable way to ensure your Typesense search cluster is reachable and responding quickly. It checks the built-in `/health` API of Typesense and alerts you if the service goes down or experiences severe latency.

Features
--------

[](#features)

- **Reachability Check:** Verifies that your Laravel application can successfully connect to your Typesense cluster.
- **Latency Monitoring:** Measures the exact response time of the Typesense cluster. If the response time exceeds a specified timeout threshold, the check will degrade to a Warning state.
- **Flexible Configuration:** Connect using config values, passing arrays fluently, or even injecting an already instantiated `Typesense\Client`.

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

[](#installation)

Require this package with composer:

```
composer require illuma-law/healthcheck-typesense
```

Configuration
-------------

[](#configuration)

You can publish the config file to define the connection settings across your application:

```
php artisan vendor:publish --tag="healthcheck-typesense-config"
```

The resulting `config/healthcheck-typesense.php` will look like this:

```
return [
    // Threshold in seconds before a successful request is considered 'slow' (Warning)
    'timeout_seconds' => 5,

    // Array of settings passed to the \Typesense\Client
    'client_settings' => [
        'api_key' => env('TYPESENSE_API_KEY', ''),
        'nodes' => [
            [
                'host' => env('TYPESENSE_HOST', 'localhost'),
                'port' => env('TYPESENSE_PORT', '8108'),
                'path' => env('TYPESENSE_PATH', ''),
                'protocol' => env('TYPESENSE_PROTOCOL', 'http'),
            ],
        ],
        'connection_timeout_seconds' => 2,
    ],
];
```

Usage &amp; Integration
-----------------------

[](#usage--integration)

Add the check inside your `AppServiceProvider` or your dedicated `HealthServiceProvider`.

### Basic Registration

[](#basic-registration)

If you have configured the connection in the published configuration file, you can register the check cleanly without passing any arguments:

```
use IllumaLaw\HealthCheckTypesense\TypesenseCheck;
use Spatie\Health\Facades\Health;

Health::checks([
    TypesenseCheck::new(),
]);
```

### Fluent Configuration

[](#fluent-configuration)

You can override default settings dynamically. This is useful if you are fetching connection settings from a different configuration file (like Scout) or testing.

```
use IllumaLaw\HealthCheckTypesense\TypesenseCheck;
use Spatie\Health\Facades\Health;

Health::checks([
    TypesenseCheck::new()
        ->timeout(3) // Issue a warning if the ping takes > 3 seconds
        ->clientSettings([
            'api_key' => config('scout.typesense.api_key'),
            'nodes' => [
                [
                    'host' => 'typesense.production.internal',
                    'port' => '8108',
                    'protocol' => 'http',
                ],
            ],
            'connection_timeout_seconds' => 2,
        ]),
]);
```

### Injecting the Client

[](#injecting-the-client)

If you already bind the `Typesense\Client` in your Laravel container, you can pass it directly to avoid re-initializing it:

```
use IllumaLaw\HealthCheckTypesense\TypesenseCheck;
use Spatie\Health\Facades\Health;
use Typesense\Client;

Health::checks([
    TypesenseCheck::new()
        ->useClient(app(Client::class)),
]);
```

### Expected Result States

[](#expected-result-states)

The check communicates with the Spatie Health dashboard using these states:

- **OK:** Typesense responded successfully within the defined timeout threshold. The short summary shows the response time (e.g., `12ms`).
- **Warning:** Typesense responded successfully, but the response time was higher than the configured `timeout_seconds`.
- **Failed:** Typesense was unreachable, the connection timed out entirely, or an authentication error occurred.

Testing
-------

[](#testing)

Run the test suite:

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance91

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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 ~2 days

Total

5

Last Release

44d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2affac64f2726a640084b203503518ca01f582536d60a0a299b614486ed95aaa?d=identicon)[miguelenes](/maintainers/miguelenes)

---

Top Contributors

[![miguelenes](https://avatars.githubusercontent.com/u/1568086?v=4)](https://github.com/miguelenes "miguelenes (11 commits)")

---

Tags

laravelhealthtypesensehealthcheckilluma-law

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/illuma-law-healthcheck-typesense/health.svg)

```
[![Health](https://phpackages.com/badges/illuma-law-healthcheck-typesense/health.svg)](https://phpackages.com/packages/illuma-law-healthcheck-typesense)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

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

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[nativephp/mobile

NativePHP for Mobile

97255.0k84](/packages/nativephp-mobile)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

24740.3k](/packages/harris21-laravel-fuse)[laracraft-tech/laravel-useful-additions

A collection of useful Laravel additions!

58122.8k](/packages/laracraft-tech-laravel-useful-additions)

PHPackages © 2026

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