PHPackages                             vntrungld/laravel-crisp - 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. vntrungld/laravel-crisp

ActiveLibrary[API Development](/categories/api)

vntrungld/laravel-crisp
=======================

A Laravel package for seamless integration with Crisp Chat API including webhook handling and signature verification

v0.0.1(3mo ago)011[1 PRs](https://github.com/vntrungld/laravel-crisp/pulls)MITPHPPHP ^8.1CI passing

Since Feb 10Pushed 2mo agoCompare

[ Source](https://github.com/vntrungld/laravel-crisp)[ Packagist](https://packagist.org/packages/vntrungld/laravel-crisp)[ Docs](https://github.com/vntrungld/laravel-crisp)[ RSS](/packages/vntrungld-laravel-crisp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (4)Used By (0)

Laravel Crisp
=============

[](#laravel-crisp)

[![Latest Version on Packagist](https://camo.githubusercontent.com/dac649d4a6d78aad970c009ea0f65aa7e4d095318fe6b54fa265c3ce44fc89d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766e7472756e676c642f6c61726176656c2d63726973702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vntrungld/laravel-crisp)[![Total Downloads](https://camo.githubusercontent.com/dc79fcb0c37746f60aeac669661c353cb0ea15da6c6e62530c610de669ee5f09/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766e7472756e676c642f6c61726176656c2d63726973702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vntrungld/laravel-crisp)[![Tests](https://camo.githubusercontent.com/2de5f088d38162899472e23f0c7c55ac38f4edb32745879a22292eab965f5f59/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766e7472756e676c642f6c61726176656c2d63726973702f74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/vntrungld/laravel-crisp/actions)

A Laravel package that provides a seamless integration with [Crisp Chat](https://crisp.chat/). This package wraps the official Crisp PHP API client and adds Laravel-specific features like webhook handling with signature verification.

Features
--------

[](#features)

- 🚀 Easy integration with Crisp Chat API
- 🔐 Webhook signature verification for security
- 📢 Event-driven webhook handling
- ⚙️ Configurable webhook endpoints
- 🎯 Laravel 9+ support
- 🧪 Comprehensive test coverage

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 9.0 or higher

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

[](#installation)

Install the package via Composer:

```
composer require vntrungld/laravel-crisp
```

The package will automatically register its service provider.

### Publish Configuration

[](#publish-configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag="laravel-crisp.config"
```

This will create a `config/crisp.php` file in your application.

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

[](#configuration)

Add the following environment variables to your `.env` file:

```
CRISP_TIER=plugin
CRISP_TOKEN_ID=your-token-id
CRISP_TOKEN_KEY=your-token-key
CRISP_SIGNING_SECRET=your-signing-secret
CRISP_WEBHOOK_PATH=crisp
CRISP_PLUGIN_ID=your-plugin-id
```

### Configuration Options

[](#configuration-options)

- `tier`: The Crisp API tier (default: `plugin`)
- `token_id`: Your Crisp API token identifier
- `token_key`: Your Crisp API token key
- `signing_secret`: Secret for webhook signature verification
- `webhook_path`: Base path for webhook routes (default: `crisp`)
- `plugin_id`: Your Crisp plugin identifier

Usage
-----

[](#usage)

### Using the Crisp Client

[](#using-the-crisp-client)

You can access the Crisp client in several ways:

#### Via Facade

[](#via-facade)

```
use LaravelCrisp;

// Get the Crisp client instance
$client = LaravelCrisp::client();

// Example: Send a message
$client->websiteConversations->sendMessageInConversation(
    'website_id',
    'session_id',
    [
        'type' => 'text',
        'content' => 'Hello from Laravel!'
    ]
);
```

#### Via Dependency Injection

[](#via-dependency-injection)

```
use Vntrungld\LaravelCrisp\LaravelCrisp;

class YourController extends Controller
{
    public function __construct(protected LaravelCrisp $crisp)
    {
    }

    public function sendMessage()
    {
        $client = $this->crisp->client();
        // Use the client...
    }
}
```

#### Via Container

[](#via-container)

```
$crisp = app('laravel-crisp');
$client = $crisp->client();
```

### Handling Webhooks

[](#handling-webhooks)

The package automatically registers a webhook endpoint at `/crisp/webhook` (or your custom path).

#### Webhook Signature Verification

[](#webhook-signature-verification)

Webhook signature verification is automatically enabled when you set `CRISP_SIGNING_SECRET`. This ensures that incoming webhooks are genuinely from Crisp.

The middleware will:

1. Extract the timestamp and signature from request headers
2. Compute the expected signature using HMAC-SHA256
3. Compare signatures using a timing-safe comparison
4. Reject requests with invalid signatures (401 response)

#### Listening to Webhook Events

[](#listening-to-webhook-events)

When a webhook is received, a `WebhookReceived` event is dispatched. You can listen to this event in your application:

```
use Illuminate\Support\Facades\Event;
use Vntrungld\LaravelCrisp\Events\WebhookReceived;

Event::listen(WebhookReceived::class, function (WebhookReceived $event) {
    $payload = $event->payload;

    // Handle the webhook payload
    logger('Crisp webhook received', $payload);

    // Example: Handle message sent event
    if ($payload['event'] === 'message:send') {
        // Process the message...
    }
});
```

Or create a dedicated listener:

```
php artisan make:listener HandleCrispWebhook
```

```
namespace App\Listeners;

use Vntrungld\LaravelCrisp\Events\WebhookReceived;

class HandleCrispWebhook
{
    public function handle(WebhookReceived $event): void
    {
        $payload = $event->payload;

        match($payload['event']) {
            'message:send' => $this->handleMessageSent($payload),
            'message:received' => $this->handleMessageReceived($payload),
            // ... other event types
            default => null,
        };
    }

    protected function handleMessageSent(array $payload): void
    {
        // Your logic here
    }

    protected function handleMessageReceived(array $payload): void
    {
        // Your logic here
    }
}
```

Register the listener in your `EventServiceProvider`:

```
use Vntrungld\LaravelCrisp\Events\WebhookReceived;
use App\Listeners\HandleCrispWebhook;

protected $listen = [
    WebhookReceived::class => [
        HandleCrispWebhook::class,
    ],
];
```

### Crisp API Examples

[](#crisp-api-examples)

For detailed API documentation, refer to the [official Crisp API documentation](https://docs.crisp.chat/api/v1/).

#### Get Website Conversations

[](#get-website-conversations)

```
$conversations = LaravelCrisp::client()
    ->websiteConversations
    ->getConversationsList('website_id');
```

#### Get Conversation Messages

[](#get-conversation-messages)

```
$messages = LaravelCrisp::client()
    ->websiteConversations
    ->getMessagesInConversation('website_id', 'session_id');
```

#### Send a Text Message

[](#send-a-text-message)

```
LaravelCrisp::client()
    ->websiteConversations
    ->sendMessageInConversation(
        'website_id',
        'session_id',
        [
            'type' => 'text',
            'content' => 'Your message here',
            'from' => 'operator',
            'origin' => 'chat'
        ]
    );
```

#### Update Conversation Meta

[](#update-conversation-meta)

```
LaravelCrisp::client()
    ->websiteConversations
    ->updateConversationMetas(
        'website_id',
        'session_id',
        [
            'nickname' => 'John Doe',
            'email' => 'john@example.com'
        ]
    );
```

Testing
-------

[](#testing)

The package includes comprehensive tests covering all major functionality:

```
composer test
```

### Running Tests for Specific Laravel Versions

[](#running-tests-for-specific-laravel-versions)

The package supports Laravel 9, 10, 11, and 12. The test suite runs against all versions in CI.

To test locally with a specific Laravel version:

```
# Laravel 9
composer require "laravel/framework:^9.0" "orchestra/testbench:^7.0" --dev
composer test

# Laravel 10
composer require "laravel/framework:^10.0" "orchestra/testbench:^8.0" --dev
composer test

# Laravel 11
composer require "laravel/framework:^11.0" "orchestra/testbench:^9.0" --dev
composer test

# Laravel 12
composer require "laravel/framework:^12.0" "orchestra/testbench:^10.0" --dev
composer test
```

Laravel Version Support
-----------------------

[](#laravel-version-support)

Laravel VersionPHP VersionPackage Support9.x8.1, 8.2✅10.x8.1, 8.2, 8.3✅11.x8.2, 8.3✅12.x8.2, 8.3✅The **minimum supported Laravel version is 9.0**.

Security
--------

[](#security)

### Webhook Signature Verification

[](#webhook-signature-verification-1)

Always set `CRISP_SIGNING_SECRET` in production to ensure webhook authenticity. Without this, anyone could send fake webhooks to your application.

### Reporting Security Issues

[](#reporting-security-issues)

If you discover any security-related issues, please email  instead of using the issue tracker.

Change Log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Credits
-------

[](#credits)

- [vntrungld](https://github.com/vntrungld)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance84

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

92d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/39490e25f48deaf067db160681117abc2bdcf818fdce03a30eebc1ee25b784a0?d=identicon)[vntrungld](/maintainers/vntrungld)

---

Top Contributors

[![vntrungld](https://avatars.githubusercontent.com/u/19848743?v=4)](https://github.com/vntrungld "vntrungld (7 commits)")

---

Tags

laravelLaravelCrisp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vntrungld-laravel-crisp/health.svg)

```
[![Health](https://phpackages.com/badges/vntrungld-laravel-crisp/health.svg)](https://phpackages.com/packages/vntrungld-laravel-crisp)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[kirschbaum-development/laravel-openapi-validator

Automatic OpenAPI validation for Laravel HTTP tests

581.1M5](/packages/kirschbaum-development-laravel-openapi-validator)[api-ecosystem-for-laravel/dingo-api

A RESTful API package for the Laravel and Lumen frameworks.

3121.5M10](/packages/api-ecosystem-for-laravel-dingo-api)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)

PHPackages © 2026

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