Download the PHP package relaybell/relaybell-php without Composer
On this page you can find all versions of the php package relaybell/relaybell-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download relaybell/relaybell-php
More information about relaybell/relaybell-php
Files in relaybell/relaybell-php
Package relaybell-php
Short Description Official PHP server-side SDK for RelayBell web push notifications, event tracking, and analytics.
License MIT
Homepage https://relaybell.com
Informations about the package relaybell-php
RelayBell PHP SDK
Official server-side PHP SDK for RelayBell — send web push notifications, track behavioural events, record conversions, and read analytics from your backend.
- PHP 7.4+, framework-free.
- Dependency-light: only
ext-curlandext-json(both bundled with typical PHP builds). - PSR-4 autoloaded under the
Relaybell\namespace.
This is the server-side SDK. To collect subscribers in the browser, use the browser SDK instead — it runs on your storefront, not your server.
Installation
Not published to Packagist yet? Point Composer at the directory:
Quick start
Configuration
Authentication uses the HTTP header Authorization: Bearer <API_KEY>, applied
automatically to every request.
API
send(array $notification): array
POST /api/v1/notifications — send or schedule a push. title is required.
track(string $event, array $opts = []): array
POST /api/v1/events — track a behavioural event. May trigger automations and
sequence enrolments server-side.
trackConversion($value, array $props = []): array
Convenience wrapper over track() that emits a conversion event with a monetary
value in its properties. externalId / subscriberId in $props are lifted
out and used for subscriber attribution; all other keys become event properties.
stats(): array
GET /api/v1/stats — account analytics.
Error handling
Every non-2xx response throws Relaybell\RelaybellException. Transport failures
(DNS, connection, timeout) throw the same exception with a status code of 0.
The API returns errors as JSON { "error": "code" } with a normal HTTP status.
getErrorCode() extracts that code for you.
Browser SDK
The server SDK is for backend calls only. To subscribe visitors and fire client-side events, load the browser SDK on your storefront:
Requirements
- PHP >= 7.4
ext-curl,ext-json
License
MIT
All versions of relaybell-php with dependencies
ext-curl Version *
ext-json Version *