SDKs overview
Pusher Beams provides Software Development Kits (SDKs) and libraries designed to facilitate the integration of push notification functionality into various application environments. These tools abstract the underlying REST API interactions, allowing developers to focus on application logic rather than the specifics of notification delivery protocols. The SDKs cover both client-side implementations (for registering devices and receiving notifications) and server-side components (for sending notifications and managing user interests).
The official SDKs support popular mobile platforms like iOS and Android, web applications, and a range of server-side programming languages. This broad coverage aims to support cross-platform notification strategies, enabling a unified approach to user engagement across diverse application types. For detailed information on the Pusher Beams API, consult the official Pusher Beams API reference.
Official SDKs by language
Pusher Beams offers official SDKs for client and server-side integration. These SDKs are maintained by Pusher and are the recommended method for interacting with the Beams service. Each SDK is tailored to the specific environment, providing native-like integration for mobile platforms and idiomatic interfaces for server-side languages.
The following table outlines the officially supported SDKs, their respective package identifiers, and typical installation commands:
| Language/Platform | Package/Integration Method | Installation Command/Method | Maturity |
|---|---|---|---|
| iOS | CocoaPods: 'PushNotifications'Swift Package Manager: pusher/beams-ios |
pod 'PushNotifications' (in Podfile)Add Swift Package via Xcode |
Stable |
| Android | Gradle: 'com.pusher.beams:beams-android' |
implementation 'com.pusher.beams:beams-android:x.y.z' (in build.gradle) |
Stable |
| Web | NPM: '@pusher/push-notifications-web' |
npm install @pusher/push-notifications-web or yarn add @pusher/push-notifications-web |
Stable |
| Go | Go Modules: 'github.com/pusher/pusher-beams-go' |
go get github.com/pusher/pusher-beams-go |
Stable |
| Java | Maven: 'com.pusher:pusher-beams-java'Gradle: 'com.pusher:pusher-beams-java' |
Add dependency to pom.xml or build.gradle |
Stable |
| Node.js | NPM: '@pusher/beams-server' |
npm install @pusher/beams-server or yarn add @pusher/beams-server |
Stable |
| PHP | Composer: 'pusher/beams' |
composer require pusher/beams |
Stable |
| Python | pip: 'pusher-beams' |
pip install pusher-beams |
Stable |
| Ruby | RubyGems: 'pusher-beams' |
gem install pusher-beams |
Stable |
For specific version numbers and detailed installation instructions, refer to the Pusher Beams official documentation.
Installation
Installation methods vary depending on the chosen platform and programming language. Below are general guidelines for integrating Pusher Beams SDKs.
Client-Side SDKs (iOS, Android, Web)
iOS: Developers typically integrate the iOS SDK using dependency managers like CocoaPods or Swift Package Manager. After adding the dependency, configuration involves initializing the SDK with your instance ID and setting up push notification delegates in your application. Apple's UserNotifications framework is utilized for handling notifications on the device.
// Example Podfile entry for iOS
pod 'PushNotifications'
// Example Swift Package Manager (SPM) integration
// In Xcode, go to File > Add Packages... and enter https://github.com/pusher/beams-ios
Android: The Android SDK is distributed via Gradle. Adding the library to your build.gradle file and configuring the SDK in your application code are the primary steps. This includes setting up your instance ID and registering for push tokens. Android leverages Firebase Cloud Messaging (FCM) for delivering notifications to Android devices.
// build.gradle (app-level)
dependencies {
implementation 'com.pusher.beams:beams-android:1.8.0' // Use current version
}
Web: The Web SDK is installed using npm or yarn. After installation, a service worker is typically registered to handle push events in the browser, and the SDK is initialized with your instance ID and credentials. Web push notifications rely on browser-specific implementations of the Push API and Service Worker API.
npm install @pusher/push-notifications-web
# or
yarn add @pusher/push-notifications-web
Server-Side SDKs (Go, Java, Node.js, PHP, Python, Ruby)
Server-side SDKs are typically installed via language-specific package managers. These libraries allow your backend to interact with the Pusher Beams service to send notifications and manage user interests. Common steps include obtaining your instance ID and secret key from the Pusher dashboard and initializing the SDK with these credentials.
Node.js:
npm install @pusher/beams-server
# or
yarn add @pusher/beams-server
Python:
pip install pusher-beams
PHP:
composer require pusher/beams
For other server-side languages like Go, Java, and Ruby, similar package manager commands or direct dependency declarations are used. The specific commands are available in the Pusher Beams developer documentation.
Quickstart example
This example demonstrates how to send a simple push notification to an interest using the Node.js server-side SDK. This quickstart assumes you have already set up a Pusher Beams instance and have your Instance ID and Secret Key.
const PusherPushNotifications = require('@pusher/beams-server');
let beamsClient = new PusherPushNotifications({
instanceId: 'YOUR_INSTANCE_ID',
secretKey: 'YOUR_SECRET_KEY'
});
beamsClient.publishToInterests([
'hello-world'
], {
web: {
notification: {
title: 'Hello from Pusher Beams!',
body: 'This is a test notification sent from your server.',
// Optional: Add deep link or other custom data
deep_link: 'https://www.pusher.com/beams'
}
},
apns: {
// APNs-specific notification payload
aps: {
alert: {
title: 'iOS Notification',
body: 'Hello iOS user!'
},
sound: 'default'
}
},
fcm: {
// FCM-specific notification payload
notification: {
title: 'Android Notification',
body: 'Hello Android user!',
icon: 'my_icon'
},
data: {
custom_data_key: 'custom_value'
}
}
})
.then(() => {
console.log('Notification published successfully!');
})
.catch(error => {
console.error('Error publishing notification:', error);
});
This snippet initializes the Node.js Beams client with credentials and then calls publishToInterests to send a notification. The payload includes tailored content for web, Apple Push Notification Service (APNs) for iOS, and Firebase Cloud Messaging (FCM) for Android, demonstrating cross-platform capability from a single API call.
To receive this notification, client applications (iOS, Android, Web) must subscribe to the 'hello-world' interest. For client-side subscription examples, refer to the Pusher Beams API reference documentation.
Community libraries
While Pusher Beams provides a comprehensive set of official SDKs, the developer community occasionally creates and maintains additional libraries or integrations. These community-contributed projects can offer support for less common languages, frameworks, or specialized use cases not directly addressed by the official SDKs.
Community libraries are typically found on platforms like GitHub, language-specific package repositories (e.g., Packagist for PHP, crates.io for Rust), or through developer forums and blogs. Developers interested in using community-contributed code should evaluate its documentation, maintenance status, and community support before integration. These libraries are not officially supported by Pusher and may not adhere to the same update cycles or stability guarantees as the official SDKs.
As of 2026, the official Pusher Beams documentation does not specifically list community-maintained libraries, indicating that the official SDKs cover the primary target environments. Developers seeking solutions beyond the official offerings are encouraged to explore community repositories or contribute their own integrations.
When considering any third-party library, it is advisable to review its source code and ensure compatibility with the current Pusher Beams API version, as outlined in the Pusher Beams API specification.