PHPackages                             chatway-live-chat/chatway-live-chat-php - 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. chatway-live-chat/chatway-live-chat-php

ActiveLibrary

chatway-live-chat/chatway-live-chat-php
=======================================

Embed Chatway chat widget in any PHP app

v1.0.1(10mo ago)2716MITPHP

Since Jul 7Pushed 10mo agoCompare

[ Source](https://github.com/Chatway-app/chatway-live-chat-php)[ Packagist](https://packagist.org/packages/chatway-live-chat/chatway-live-chat-php)[ RSS](/packages/chatway-live-chat-chatway-live-chat-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Chatway PHP SDK
===============

[](#chatway-php-sdk)

The **Chatway live chat PHP SDK** is a lightweight, framework-agnostic PHP library that allows you to easily embed the [Chatway](https://chatway.app/?utm_source=packagist) live chat customer support widget on your website and securely identify your visitors using a simple, chainable API.

Chatway is a powerful live chat solution for websites, offering features such as live chat customer support, real-time visitor tracking, customizable widgets, canned responses, FAQs, multilingual support, private notes, visitor segmentation, analytics, and more. Chatway is available as a web app, as well as native iOS and Android apps.

This SDK works with any PHP application, including Laravel, WordPress, custom frameworks, or plain PHP projects.

[![chatway-pack](https://private-user-images.githubusercontent.com/64247665/461909010-23333c76-e427-487d-8341-d8579fe537de.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0OTUzMDQsIm5iZiI6MTc3NTQ5NTAwNCwicGF0aCI6Ii82NDI0NzY2NS80NjE5MDkwMTAtMjMzMzNjNzYtZTQyNy00ODdkLTgzNDEtZDg1NzlmZTUzN2RlLnBuZz9YLUFtei1B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ob3N0In0.s0VfBFYrY9WSTeripNd7k8yEQ1QbxFbNvb_4qBzaihE)

---

Key Features
------------

[](#key-features)

- Easily embed the Chatway live chat widget using your project’s widget ID
- Securely verify visitors by ID or email (optional)
- Assign tags with custom colors
- Attach custom fields to visitor sessions
- Clean, chainable syntax
- Fully HTML-escaped output for security

---

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

[](#installation)

To install the SDK via Composer:

```
composer require chatway-live-chat/chatway-live-chat-php
```

---

Basic Usage
-----------

[](#basic-usage)

Embed the Chatway live chat widget without visitor verification:

```
echo Chatway\Chatway::make('your-widget-id')->getScript();
```

You can find your widget ID on the [Chatway Installation Page](https://go.chatway.app/installation) (`id=WIDGET_ID`).

---

Visitor Verification (Optional)
-------------------------------

[](#visitor-verification-optional)

To securely verify logged-in visitors, provide:

- The **user ID**
- The **email address**
- A **secret key** from the [Visitor Verification page](https://go.chatway.app/visitors-verification)
- Whether to generate the signature based on `'id'` or `'email'`

All four parameters are required for visitor verification.

Example:

```
echo Chatway\Chatway::make('your-widget-id', 'your-secret-key', 'id')
    ->withVisitor('123', 'user@example.com')
    ->getScript();
```

This will generate a secure `window.chatwaySettings` block containing a signature and load the chat widget.

---

Adding Tags
-----------

[](#adding-tags)

You can assign tags to visitors, each with a name and color.

**Single Tag:**

```
->setTags('VIP', '#FFD700')
```

**Multiple Tags:**

```
->setTags([
    'VIP' => '#FFD700',
    'Supporter' => '#00FF00'
]);
```

---

Custom Fields
-------------

[](#custom-fields)

You can attach custom fields to enrich visitor session data.

**Single Field:**

```
->setCustomFields('Plan', 'Premium')
```

**Multiple Fields:**

```
->setCustomFields([
    'Subscription' => 'Gold',
    'Status' => 'Active'
]);
```

---

Full Example
------------

[](#full-example)

```
echo Chatway\Chatway::make('your-widget-id', 'your-secret-key', 'email')
    ->withVisitor('123', 'user@example.com')
    ->setTags('VIP', '#FFD700')
    ->setTags(['Supporter' => '#00FF00'])
    ->setCustomFields('Plan', 'Pro')
    ->setCustomFields([
        'Country' => 'USA',
        'Language' => 'English'
    ])
    ->getScript();
```

---

Important Notes
---------------

[](#important-notes)

- For visitor verification, you **must** provide:
    - `make(widgetId, secretKey, basedOn)`
    - `withVisitor(userId, email)`
- The `basedOn` parameter must be either `'id'` or `'email'`
- All tag names, tag colors, field names, and field values must be strings
- Tags must be an associative array in the format `name => color`
- Custom fields must be an associative array in the format `name => value`

Invalid input will result in an `InvalidArgumentException`.

---

License For This Package
------------------------

[](#license-for-this-package)

MIT License © [Chatway](https://chatway.app)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance54

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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

Every ~3 days

Total

2

Last Release

305d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f0652fd8747e59d96833b77a4bf43247a582b9aa84f8cd4b05bb2fcbb9541c80?d=identicon)[Chatway-live-chat](/maintainers/Chatway-live-chat)

---

Top Contributors

[![thenibirahmed](https://avatars.githubusercontent.com/u/64247665?v=4)](https://github.com/thenibirahmed "thenibirahmed (18 commits)")

### Embed Badge

![Health badge](/badges/chatway-live-chat-chatway-live-chat-php/health.svg)

```
[![Health](https://phpackages.com/badges/chatway-live-chat-chatway-live-chat-php/health.svg)](https://phpackages.com/packages/chatway-live-chat-chatway-live-chat-php)
```

PHPackages © 2026

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