PHPackages                             clankersupport/clankersupport-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. [Templating &amp; Views](/categories/templating)
4. /
5. clankersupport/clankersupport-php

ActiveLibrary[Templating &amp; Views](/categories/templating)

clankersupport/clankersupport-php
=================================

Render the Clanker Support widget embed from PHP and Laravel apps — an open-source, self-hostable, AI-powered support agent for your site.

v1.0.0(1mo ago)05MITPHPPHP ^8.1CI passing

Since Jul 17Pushed 1mo agoCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

clankersupport-php
==================

[](#clankersupport-php)

Render the [Clanker Support](https://clankersupport.com) widget embed from PHP and Laravel apps — an open-source, self-hostable, AI-powered support agent for your site.

The widget itself is client-side JavaScript served by the Clanker Support API (`/widget.js`); your backend's job is only to emit the `` tag with the right `data-*` attributes. This package does that with strict validation and HTML-attribute escaping, mirroring the snippet the dashboard's Embed page generates.

Features
--------

[](#features)

- **One static method** — `ClankerSupport::scriptTag()` returns the exact embed tag the dashboard generates
- **Fails loudly in development** — empty key, unknown mode/theme, or a non-positive escalation threshold throws `InvalidArgumentException` instead of silently shipping a broken widget
- **XSS-safe** — every attribute value is escaped with `htmlspecialchars(ENT_QUOTES | ENT_SUBSTITUTE, "UTF-8")`
- **Laravel bridge** — auto-discovered service provider, publishable config, and a `@clankerSupport` Blade directive driven by env vars
- **Zero runtime dependencies** — plain PHP &gt;= 8.1; Laravel support activates only when `illuminate/support` is present

Tech stack
----------

[](#tech-stack)

- PHP &gt;= 8.1, `strict_types`, PSR-4 autoloading
- PHPUnit 10 test suite (contract tests mirroring the official Python SDK)
- Optional Laravel integration (service provider + Blade directive), no hard framework dependency

Getting started
---------------

[](#getting-started)

```
composer require clankersupport/clankersupport-php
```

### Plain PHP

[](#plain-php)

```
