Pusher Channels API

Connect to Pusher Channels from Delphi/C++Builder — public channels, presence channels and HMAC-signed private channels in one typed component.

TsgcWSAPI_Pusher

Typed Delphi/C++Builder client for the Pusher Channels WebSocket protocol — subscribes to public, private and presence channels and routes events through typed handlers.

Component class

TsgcWSAPI_Pusher

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Standard / Professional / Enterprise

Drop the component, set the key, subscribe

Pair with TsgcWebSocketClient targeting ws.pusherapp.com, set Pusher.Key (and Pusher.Secret for private/presence), then call Subscribe per channel.

uses
  sgcWebSocket, sgcWebSocket_API_Pusher;

var
  WSClient: TsgcWebSocketClient;
  Pusher: TsgcWSAPI_Pusher;
begin
  WSClient := TsgcWebSocketClient.Create(nil);

  Pusher := TsgcWSAPI_Pusher.Create(nil);
  Pusher.Client := WSClient;
  Pusher.Pusher.AppKey := 'your-app-key';
  Pusher.Pusher.Secret := 'your-app-secret';

  WSClient.Active := True;

  Pusher.Subscribe('public-channel');
  Pusher.Subscribe('private-orders');
  Pusher.Subscribe('presence-chat');
end;
// uses: sgcWebSocket, sgcWebSocket_API_Pusher
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_Pusher *Pusher = new TsgcWSAPI_Pusher(this);
Pusher->Client = WSClient;
Pusher->Pusher->AppKey = "your-app-key";
Pusher->Pusher->Secret = "your-app-secret";

WSClient->Active = true;
Pusher->Subscribe("public-channel");
Pusher->Subscribe("private-orders");

What's inside

Implements the Pusher WebSocket protocol with built-in HMAC signing for private and presence channels.

Public / private / presence

Subscribe with a channel name — the component routes public-*, private-* and presence-* channels to the right auth scheme automatically.

HMAC signing

Set Pusher.AppKey and Pusher.Secret to sign pusher:subscribe requests for private and presence channels with HMAC-SHA256.

Event routing

Bind to Pusher.Subscribe, OnPusherEvent, OnPusherSubscriptionSucceeded and OnPusherSubscriptionError for per-channel state and payload handling.

Reconnection

The Pusher protocol negotiates an activity_timeout; the component schedules client pings and resubscribes to every active channel on reconnect.

Cluster selection

Point the underlying TsgcWebSocketClient at the cluster-appropriate host (ws-eu.pusher.com, ws-ap1.pusher.com, ...) per your Pusher app settings.

Client events

On presence/private channels you can trigger client events via Pusher.TriggerEvent — useful for peer-to-peer signalling without a server round trip.

Specifications & references

Authoritative sources for the APIs this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Online Help — API_Pusher Full property, method and event reference for this component.
Free Trial — sgcWebSockets Download the trial package to subscribe to Pusher Channels from Delphi.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.

Ready to Subscribe to Pusher Channels?

Download the free trial and integrate Pusher real-time events into your Delphi applications.