Download the PHP package wireblob/wire without Composer
On this page you can find all versions of the php package wireblob/wire. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wireblob/wire
More information about wireblob/wire
Files in wireblob/wire
Informations about the package wire
Wireblob PHP SDK
Server-side PHP SDK for Wireblob, a realtime platform for publishing events, authorizing private and presence channels, inspecting channel state, and validating webhooks.
This package is heavily aligned with the Pusher PHP server SDK and is intended to be Wireblob-friendly out of the box. If you are migrating from a Pusher-style integration, the API surface should feel familiar.
Features
- Publish events to one or many channels
- Trigger batch events
- Authorize private, presence, and encrypted channels
- Fetch channel and presence information
- Validate and parse webhook payloads
- Keep compatibility with existing Pusher-style server integrations
Requirements
- PHP
^7.3|^8.0 ext-curlext-json
Installation
Quick start
Configuration
The Wire constructor accepts your app credentials and an optional configuration array:
Common options
host: Wireblob API host for your regionscheme:httporhttpsport: API porttimeout: request timeout in secondsuseTLS: whentrue, defaults to HTTPS on port443cluster: Pusher-style cluster fallbackencryption_master_key_base64: required for encrypted channel authorization and webhook decryption
For Wireblob deployments, you will usually want to set
hostexplicitly.
Publishing events
Trigger a single event
Trigger to multiple channels
Exclude the sender with socket_id
Trigger a batch of events
Send an event directly to a user
Channel authorization
Use the authorization helpers in your private or presence channel auth endpoint.
Private channel
Presence channel
Compatibility aliases
For projects coming from the Pusher SDK, the following compatibility methods are also available:
socketAuth()presenceAuth()
The preferred method names are:
authorizeChannel()authorizePresenceChannel()
Channels and presence
Webhooks
You can verify webhook signatures and parse webhook payloads from Wireblob.
If you only need to validate the signature:
Async operations
Async variants are available when you want to work with Guzzle promises:
triggerAsync()triggerBatchAsync()sendToUserAsync()terminateUserConnectionsAsync()
Example:
Error handling
The SDK may throw:
Wireblob\WireExceptionfor validation, signing, or payload issuesWireblob\ApiErrorExceptionwhen the API returns an error responseGuzzleHttp\Exception\GuzzleExceptionfor HTTP client failures
Example:
Notes for Pusher users
- The SDK API is intentionally close to the Pusher PHP server SDK
- Wireblob-specific deployments should use your Wireblob host, for example
eu-central-1.wireblob.com - Compatibility headers for Pusher-style integrations are still present in requests and webhook validation
License
MIT
All versions of wire with dependencies
ext-curl Version *
ext-json Version *
guzzlehttp/guzzle Version ^7.2
psr/log Version ^1.0|^2.0|^3.0