### Install Pusher Beams Node.js SDK with yarn Source: https://github.com/pusher/push-notifications-node/blob/master/README.md Installs the Pusher Beams Node.js server SDK using yarn. This is an alternative method for adding the library to your project's dependencies. ```bash $ yarn add @pusher/push-notifications-server ``` -------------------------------- ### Install Pusher Beams Node.js SDK with npm Source: https://github.com/pusher/push-notifications-node/blob/master/README.md Installs the Pusher Beams Node.js server SDK using npm. This command adds the necessary package to your project's dependencies. ```bash $ npm install @pusher/push-notifications-server --save ``` -------------------------------- ### Configure Pusher Beams SDK Instance Source: https://github.com/pusher/push-notifications-node/blob/master/README.md Initializes the Pusher Beams PushNotifications instance using your instance ID and secret key obtained from the Pusher dashboard. This instance is used for all subsequent notification publishing operations. ```javascript const PushNotifications = require('@pusher/push-notifications-server'); let pushNotifications = new PushNotifications({ instanceId: 'YOUR_INSTANCE_ID_HERE', secretKey: 'YOUR_SECRET_KEY_HERE' }); ``` -------------------------------- ### Publish Notification to Device Interests Source: https://github.com/pusher/push-notifications-node/blob/master/README.md Publishes a push notification to devices subscribed to specific interests. It supports platform-specific payloads for APNS (Apple Push Notification Service) and FCM (Firebase Cloud Messaging). ```javascript pushNotifications.publishToInterests(['hello'], { apns: { aps: { alert: 'Hello!' } }, fcm: { notification: { title: 'Hello', body: 'Hello, world!' } } }).then((publishResponse) => { console.log('Just published:', publishResponse.publishId); }).catch((error) => { console.log('Error:', error); }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.