Server API overview

The Server API Overview provides information on how to perform specific actions using our Server libraries.

Where possible each section provides an overview of the action, a reference-style guide to the constructor, property or method and an example of how it is used

The reference-style guide and examples may contain information for different languages. You can choose which language you wish to view by clicking on the appropriate tab as below.

require 'pusher'

pusher_client =
  app_id: 'APP_ID',
  key: 'APP_KEY',
  secret: 'APP_SECRET'

class HelloWorldController < ApplicationController
  def hello_world
    pusher_client.trigger('test_channel', 'my_event', {:message => 'hello world'})
require 'pusher'

pusher_client =
  app_id: 'APP_ID',
  key: 'APP_KEY',
  secret: 'APP_SECRET'

Pusher.trigger('test_channel', 'my_event', {:message => 'hello world'})

$pusher = new Pusher("APP_KEY", "APP_SECRET", "APP_ID");

$pusher->trigger('test_channel', 'my_event', array('message' => 'hello world') );
var Pusher = require('pusher');

var pusher = new Pusher({
  appId: 'APP_ID',
  key: 'APP_KEY',
  secret: 'APP_SECRET'

pusher.trigger('test_channel', 'my_evenHt', {"message": "hello world"});
using PusherServer;
using System.Web.Mvc;
using System.Net;
using Your.Config;

public class HelloWorldController : Controller {
  public ActionResult HelloWorld() {
    var pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret);
    var result = pusher.Trigger('test_channel', 'my_event', new { message = "hello world" } );
    return new HttpStatusCodeResult((int)HttpStatusCode.OK);
from pusher import Pusher

pusher = Pusher(

pusher.trigger(u'test_channel', u'my_event', {u'message': u'hello world'})
package main

import ""

func main(){

  client := pusher.Client{
    AppId: "APP_ID",
    Key: "APP_KEY",
    Secret: "APP_SECRET",

  data := map[string]string{"message": "hello world"}

  client.Trigger("test_channel", "my_event", data)
Pusher pusher = new Pusher("APP_ID", "APP_KEY", "APP_SECRET");

pusher.trigger("test_channel", "my_event", Collections.singletonMap("message", "Hello World"));

Note! If you created your app in a different cluster to the default us-east-1, you must configure the cluster option as well. See how.

The Guide

Have you tried using the search to find what you’re after? If you still have a question then get in touch with us and let us help you out.