Escalated supports framework-agnostic plugins built with the Plugin SDK. Plugins are written once in TypeScript and work across all Escalated backends.
The plugin bridge is built into escalated-laravel — no additional PHP package required. Install plugins and the runtime via npm:
npm install @escalated-dev/plugin-runtime
npm install @escalated-dev/plugin-slack
npm install @escalated-dev/plugin-jira// config/escalated.php
'plugins' => [
'enabled' => true,
'sdk_enabled' => true, // Enable the Node.js bridge
],SDK plugins run as a Node.js subprocess managed by @escalated-dev/plugin-runtime, communicating with Laravel over JSON-RPC 2.0 via stdio. The escalated_do_action() and escalated_apply_filters() helpers dual-dispatch to both legacy PHP plugins and new SDK plugins simultaneously — no changes to existing hook call sites.
import { definePlugin } from '@escalated-dev/plugin-sdk'
export default definePlugin({
name: 'my-plugin',
version: '1.0.0',
actions: {
'ticket.created': async (event, ctx) => {
ctx.log.info('New ticket!', event)
},
},
})- Plugin SDK — TypeScript SDK for building plugins
- Plugin Runtime — Runtime host for plugins
- Plugin Development Guide — Full documentation
See the detailed Plugin Bridge section below for the full architecture, auto-generated routes, dual dispatch, and store documentation.
Escalated supports a second generation of plugins written in TypeScript using the @escalated-dev/plugin-sdk. These plugins run as a Node.js subprocess managed by @escalated-dev/plugin-runtime and communicate with Laravel over JSON-RPC 2.0 via stdio.
Laravel (PHP) Plugin Runtime (Node.js)
┌──────────────────────┐ stdio ┌──────────────────────┐
│ PluginBridge │◄────────►│ @escalated-dev/ │
│ - spawns subprocess │ JSON- │ plugin-runtime │
│ - dispatches hooks │ RPC 2.0 │ ┌────────────────┐ │
│ - handles ctx.* │ │ │ Slack Plugin │ │
│ - mounts routes │ │ │ Jira Plugin │ │
└──────────────────────┘ │ │ ... │ │
│ └────────────────┘ │
└──────────────────────┘
The bridge spawns the runtime lazily on the first hook dispatch and keeps the process alive across requests (one long-lived subprocess per PHP-FPM worker). If the process crashes it is automatically restarted with exponential backoff.
- Node.js 18+
@escalated-dev/plugin-runtimeinstalled in your project:
npm install @escalated-dev/plugin-runtimeInstall any SDK plugins the same way:
npm install @escalated-dev/plugin-slack @escalated-dev/plugin-jiraEscalatedServiceProvider::boot()calls$bridge->boot()- Bridge spawns
node node_modules/@escalated-dev/plugin-runtime/dist/index.js - Protocol handshake confirms version compatibility
- Bridge fetches the plugin manifest (pages, hooks, endpoints, webhooks)
- Routes are registered in Laravel for plugin pages, API endpoints, and webhooks
- Runtime is ready to receive hook dispatches
For each installed SDK plugin the bridge automatically registers:
| Category | URL Pattern | Auth |
|---|---|---|
| Admin pages | {prefix}/admin/plugins/{slug}/{route} |
Admin |
| Data endpoints | {prefix}/api/plugins/{slug}/{path} |
Admin |
| Webhook endpoints | {prefix}/webhooks/plugins/{slug}/{path} |
None |
{slug} is the plugin name with the leading @ dropped and / replaced by -- (@acme/plugin-crm is acme--plugin-crm). Only active plugins answer; the rest are 404.
The existing escalated_do_action() and escalated_apply_filters() helper functions dispatch hooks to both old PHP plugins and new SDK plugins simultaneously. No changes are required to existing hook call sites.
// This automatically dispatches to PHP plugins AND SDK plugins:
escalated_do_action('ticket.created', $ticket->toArray());
// Same for filters:
$channels = escalated_apply_filters('notification.channels', []);SDK plugins can persist data using ctx.store. This is backed by the escalated_plugin_store table:
php artisan vendor:publish --tag=escalated-migrations
php artisan migrate// config/escalated.php
'plugins' => [
'enabled' => true,
'sdk_enabled' => true, // Enable the Node.js bridge
'runtime_command' => 'node node_modules/@escalated-dev/plugin-runtime/dist/index.js',
'runtime_cwd' => base_path(), // Working directory for the subprocess
],See the @escalated-dev/plugin-sdk package for the full TypeScript authoring API. A minimal plugin looks like:
import { definePlugin } from '@escalated-dev/plugin-sdk'
export default definePlugin({
name: 'my-plugin',
version: '1.0.0',
actions: {
'ticket.created': async (event, ctx) => {
const config = await ctx.config.all()
// ... do something
},
},
endpoints: {
'GET /settings': { capability: 'manage_settings', handler: async (ctx) => {
return await ctx.config.all()
}},
},
})