PHPackages                             shellrent/kraken-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. [API Development](/categories/api)
4. /
5. shellrent/kraken-client

ActiveLibrary[API Development](/categories/api)

shellrent/kraken-client
=======================

Api client for Kraken project

1.2.0(2y ago)0971↓61.5%PHPPHP &gt;=8.1

Since Mar 21Pushed 2y ago3 watchersCompare

[ Source](https://github.com/shellrent/kraken-client)[ Packagist](https://packagist.org/packages/shellrent/kraken-client)[ RSS](/packages/shellrent-kraken-client/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

 [![Kraken Client Logo](logo.png)](logo.png) [![Last version](https://camo.githubusercontent.com/7ff5e471c257e064088ecc6f2e6cda6cdb704bd27ec6e9dccbdecafd834376d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7368656c6c72656e742f6b72616b656e2d636c69656e74)](https://packagist.org/packages/shellrent/kraken-client) [![Php version](https://camo.githubusercontent.com/d47a5a5a73f02d8743471e5b2967f2bc566b5f7032a8dee9257bd6aa2846eb5e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f7368656c6c72656e742f6b72616b656e2d636c69656e742f706870)](https://php.net/releases)

---

**kRAKEN** is an application for tracking and managing errors issued by external applications

This library provides a `PHP` client API to facilitate calls to ***kRAKEN*** and an integration for the **Laravel** and **Phalcon** frameworks

The integrations add an **ExceptionHandler**, which carries out a complete report of unhandled exceptions and a **Logger**, which allows you to use the ***kRAKEN*** system for receiving and archiving log messages

Table of Contents
-----------------

[](#table-of-contents)

- [Get Started](#get-started)
- [Laravel Integration](#laravel)
    - [Integration](#integration-laravel)
    - [ExceptionHandler Usage](#exceptionhandler-usage-laravel)
    - [Logger Usage](#logger-usage-laravel)
    - [Customization](#customization-laravel)
- [Phalcon Integration](#phalcon)
    - [Integration](#integration-phalcon)
    - [ExceptionHandler Usage](#exceptionhandler-usage-phalcon)
    - [Logger Usage](#logger-usage-phalcon)
    - [Customization](#customization-phalcon)

Get Started
-----------

[](#get-started)

> **Requires [PHP 8.1+](https://php.net/releases/)**

First, install Kraken Client via the [Composer](https://getcomposer.org/) package manager:

```
composer require shellrent/kraken-client
```

Then interact with kRAKEN's API to send a report:

```
$report = new \Shellrent\KrakenClient\ReportBuilder(
  'report-type', //Corresponds to the type code configured on the project on kRAKEN app
  'message' //Message to send
);

$client = new \Shellrent\KrakenClient\KrakenClient(
  'https://kraken-endpoint.com', //kRAKEN endpoint
  'auth-token' //Create an "environment" on the project page on kRAKEN app
);

$client->sendReport( $report->getData() );
```

To generate a standard report starting from an exception, simply use the specific `ReportBuilder` method:

```
try {
    /* code that throws an exception */

} catch( Exception $exception ) {
    $report = new \Shellrent\KrakenClient\ReportBuilder::createFromException( $exception );

    /* send the report */
}
```

Laravel
-------

[](#laravel)

> **Requires [Laravel 10.x](https://laravel.com/docs/10.x)**
>
> **[ExceptionHandler](#exceptionhandler-usage-laravel) also works with [Laravel 9.x](https://laravel.com/docs/9.x)**
>
> Previous or later versions have not yet been tested
>
> use on other versions is possible at your own risk

There is an integration with the Laravel framework

The Laravel package provides an `ExceptionHandler` and registers the `client API` and a psr style logger in the service container

### Integration (Laravel)

[](#integration-laravel)

To make the package work, you need to add the following settings to the `.env` file:

```
KRAKEN_ENDPOINT="https://kraken-endpoint.com"
KRAKEN_AUTH_TOKEN="auth-token"
```

To be able to send reports via **queue** you must specify the name of the queue to use in the `.env` file, you can use the "default" value to use the standard queue

```
KRAKEN_QUEUE_NAME="default"
```

It is possible to test the connection to kraken and that the configurations are correct, using the command:

```
php artisan kraken:test
```

### ExceptionHandler Usage (Laravel)

[](#exceptionhandler-usage-laravel)

To enable exception reporting via the Exception Handler, you need to set the ExceptionHandler in the file `bootrstrap/app.php`, overriding the current configuration:

```
$app->singleton(
    Illuminate\Contracts\Debug\ExceptionHandler::class,
    \Shellrent\KrakenClient\Laravel\KrakenExceptionHandler::class
);
```

It is possible to decide on which environments to activate the sending of reports by modifying `enabled_envs` in the config file; by default only the **production** environment is enabled

By default the package does not send the information of the logged in user, they can be added by setting `user_report_builder` in the configuration file, with a callable that returns this information

For more details see [laravel customization](#customization-laravel)

### Logger Usage (Laravel)

[](#logger-usage-laravel)

It is possible to send single reports and logs via KrakenLogger using its Facade:

```
use Shellrent\KrakenClient\Laravel\Facades\KrakenLogger;

KrakenLogger::debug( 'message' );
KrakenLogger::info( 'message' );
KrakenLogger::notice( 'message' );
KrakenLogger::warning( 'message' );
KrakenLogger::error( 'message' );
KrakenLogger::critical( 'message' );
KrakenLogger::alert( 'message' );
KrakenLogger::emergency( 'message' );
```

Instead, to use kraken through the Laravel logging system, you can add kraken as a custom channel in the `config/logging.php` configuration file

It can also be added to the stack channel along with other channels

```
/******/
'channels' => [
    /*****/
        'stack' => [
            'driver' => 'stack',
            'channels' => ['daily', 'kraken'],
            'ignore_exceptions' => false,
        ],
        /*****/
        'kraken' => [
            'driver' => 'kraken',
            'level' => env('LOG_LEVEL', 'debug'),
            'report_exceptions' => false,
        ],
    /*****/
]
```

The kraken log channel can be used as a replacement for the ExceptionHandler, simply set `'report_exceptions' => true` in the configuration

> ***WARNING***
>
> Use the ExceptionHandler and the log channel with set `'report_exceptions' => true` at the same times, **duplicates** the reports sent in case of an exception

### Customization (Laravel)

[](#customization-laravel)

To be able to modify the configuration you must first publish it via the command:

```
php artisan vendor:publish --provider="Shellrent\KrakenClient\Laravel\KrakenServiceProvider"
```

From the file created in `config/kraken.php` you can edit:

- The code of the standard modules used by the framework
- The environments that trigger the ExceptionHandler
- The type code and builder class of an exception report
- The type code and builder class of an log report
- Signed in user information

For more details see the [configuration file](/src/Laravel/config/config.php)

Phalcon
-------

[](#phalcon)

> **Requires [Phalcon 5.1](https://docs.phalcon.io)**
>
> Previous or later versions have not yet been tested
>
> use on other versions is possible at your own risk

There is an integration with the Phalcon framework

The integration with Phalcon provides an `ExceptionHandler` and allows you to obtain the `configuration` and a `psr style logger` via the DI container of the framework

### Integration (Phalcon)

[](#integration-phalcon)

To make the package work, you need to add the following settings to the `.env` file:

```
KRAKEN_API_ENDPOINT="https://kraken-endpoint.com"
KRAKEN_API_TOKEN="auth-token"
```

### ExceptionHandler Usage (Phalcon)

[](#exceptionhandler-usage-phalcon)

To send exception reports it is necessary to integrate the **ExceptionHandler** provided in the phalcon package with the one used by the application

It is possible to decide on which environments to activate the sending of reports, passing the collections of environments to the ExceptionHandler. By default the activated environment is `production`

```
$envs = ['production'];
$krakenHandler = \Shellrent\KrakenClient\Phalcon\KrakenExceptionHandler::create( $envs )
$krakenHandler->report( $exception, $errno, $errstr, $errfile, $errline, $backtrace );
```

The handler handles both exceptions and php errors

You can add session parts to the report via the `addSessionKey` method

```
$krakenHandler->addSessionKey( 'logged-used' );
```

Furthermore, it is possible to hide specific information in the report by passing the key or the value that identifies it. Useful if sensitive data is present in `$_SERVER` or other collections

```
$krakenHandler->addHideDataKey( getenv( 'DATABASE_PASSWORD' ) );
$krakenHandler->addHideDataKey( 'KEY_CLI_ACCESS' );
```

By default the package does not send the information of the logged in user, they can be added by setting `userDataGetter` property in the configuration object, with a callable that returns this information

For more details see [phalcon customization](#customization-phalcon)

### Logger Usage (Phalcon)

[](#logger-usage-phalcon)

It is possible to send single reports and logs via KrakenLogger using `KrakenService`:

```
$logger = \Shellrent\KrakenClient\Phalcon\KrakenService::logger();

$logger->debug( 'message' );
$logger->info( 'message' );
$logger->notice( 'message' );
$logger->warning( 'message' );
$logger->error( 'message' );
$logger->critical( 'message' );
$logger->alert( 'message' );
$logger->emergency( 'message' );
```

### Customization (Phalcon)

[](#customization-phalcon)

It is not necessary for correct working, but in order to customize the behavior of the package, the services need to be registered in the DI

```
abstract class GenericApplication {
  /******/

  private function registerServices() {
      /******/
      $config = \Shellrent\KrakenClient\Phalcon\Config\Config::default();
      \Shellrent\KrakenClient\Phalcon\KrakenService::create( $config )->inject( $this->Di );
  }
}
```

The config object can be customized for change:

- The type code and builder class of an exception report
- The builder class of an php error report
- The type code and builder class of an log report
- Signed in user information

For more details see the [configuration class](/src/Phalcon/Config/Config.php)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Total

4

Last Release

823d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33652479?v=4)[Shellrent](/maintainers/shellrent)[@shellrent](https://github.com/shellrent)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shellrent-kraken-client/health.svg)

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M992](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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