PHPackages                             zvse/private\_message\_messenger\_nodejs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. zvse/private\_message\_messenger\_nodejs

ActiveDrupal-module

zvse/private\_message\_messenger\_nodejs
========================================

Instant updates for private messages without polling

1.5(6y ago)0222GPL-2.0+JavaScript

Since Nov 11Pushed 6y agoCompare

[ Source](https://github.com/imyaro/Private-Message-NodeJS)[ Packagist](https://packagist.org/packages/zvse/private_message_messenger_nodejs)[ Docs](https://github.com/jez500/Private-Message-NodeJS)[ RSS](/packages/zvse-private-message-messenger-nodejs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (8)Used By (0)

Fork info
=========

[](#fork-info)

Pure fork of the  with the package name change

Private Message NodeJS
======================

[](#private-message-nodejs)

Instant updates and notifications for the [Private Message Messenger module](https://github.com/jez500/Private-Message-Messenger)module without the need for polling.

This listens for private message thread updates and uses the [drupal nodejs module](https://www.drupal.org/project/nodejs)to trigger updates to the UI and provide notifications for members of the changed thread.

**NOTE: This is different to the [Private message nodejs](https://www.drupal.org/project/private_message_nodejs) module.**
This module was written to be paired with [Private Message Messenger](https://github.com/jez500/Private-Message-Messenger)and and they both work well together.

How it normally works
---------------------

[](#how-it-normally-works)

Polling is the standard method of checking for message updates, this means a website will hit your server every XX seconds to see if anything has changed. This is not ideal as it puts lots of extra load on your server with all those requests, it also means a user will have to wait XX seconds for a reply. If polling is disabled, it would require a full page reload!

Why this is a huge improvement
------------------------------

[](#why-this-is-a-huge-improvement)

- No polling slowing down your browser
- No unnecessary constant load on your server
- Message threads immediately show new messages
- In-page browser notifications when new messages are recieved (optional).

Requirements
------------

[](#requirements)

- [Private Message module](https://www.drupal.org/project/private_message)
- [drupal nodejs module](https://www.drupal.org/project/nodejs)

Not a requirement, but this module has been **specifically** made to work with [Private Message Messenger](https://github.com/jez500/Private-Message-Messenger), if you are not using this, you will have to implement your own integration (see below for hooking into a notification).

Hooking into a notification
---------------------------

[](#hooking-into-a-notification)

This module triggers an event on `$(window)` so all you have to do is listen to window for the event. Eg:

```
$(window).on('pm:threads:poll', function(event, data) {
  console.log(data);
  alert('New message from ' + data.ownerName);
});

```

Installation
------------

[](#installation)

### Just type

[](#just-type)

`composer require zvse/private_message_nodejs`

And... `drush en -y private_message_nodejs`

### 2. Ensure you have NodeJS setup and working

[](#2-ensure-you-have-nodejs-setup-and-working)

[See basic guide here](https://www.drupal.org/node/1713530). Steps I took at time of writing:

- [Install NodeJS](https://nodejs.org/en/download/) `v4.2.6` on your server
- `npm install drupal-node.js` should be outside of `docroot` and will default to `node_modules` folder
- `cd node_modules/drupal-node.js` and `cp nodejs.config.js.example nodejs.config.js`
- Edit `nodejs.config.js` with your config, at a bare minimum set `serviceKey` to a random value, I also had to update the `backend.host` with the correct url for my drupal site
- Start the server `node app.js` also look at using [forever](https://github.com/beejeebus/drupal-nodejs#running-the-server-app)
- In your drupal site, go to `/admin/config/nodejs/settings` and add the `serviceKey` you created above. Other settings should match your `nodejs.config.js` file (only thing I need to change was the host)
- The status report page `/admin/reports/status` should indicate drupal has found the NodeJS server

**NOTE 1:** At time of writing this, the "stable" release of `drupal/nodejs` (`v1.1`) was actually quite broken, the `1.x-dev` version is far more robust.

**NOTE 2:** For https support with `drupal/nodejs` you will likely need [this patch](https://www.drupal.org/project/nodejs/issues/2783703).

### 3. Notifications - Optional, but handy for testing

[](#3-notifications---optional-but-handy-for-testing)

Enable the `nodejs_notify` module, open a few browser windows and go to `/admin/config/nodejs/broadcast` in one of them to send a message to all the others. If that works, this module should be ready to go!

The `nodejs_notify` module also provides [jGrowl](https://plugins.jquery.com/jgrowl/) which is used for notifications in this module. If you don't want `nodejs_notify` enabled but still want notifications then include [jGrowl manually](https://gist.github.com/stanlemon/5382662)

### 4. Disable polling

[](#4-disable-polling)

You don't need it anymore, set the `Ajax refresh rate` for messenger blocks and config to `0` so it wont poll anymore.

### 5. Test

[](#5-test)

If you are using [Private Message Messenger](https://github.com/jez500/Private-Message-Messenger), Open 2 different browsers, each logged in as different users, send a message from one user to another, you should see threads and blocks instantly update and a notification displayed.

Author
------

[](#author)

This module is created by [Jeremy Graham](http://jez.me)but wouldn't be possible without all the great work done by [Jaypan](https://www.drupal.org/u/jaypan)on the [Private Message module](https://www.drupal.org/project/private_message)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 69.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~73 days

Recently: every ~7 days

Total

6

Last Release

2368d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2470b2436660ea1ce0b4e7ae822e318ac2741168c1ccf1485d9df9c7cbe6e696?d=identicon)[zvse](/maintainers/zvse)

---

Top Contributors

[![imyaro](https://avatars.githubusercontent.com/u/7985237?v=4)](https://github.com/imyaro "imyaro (9 commits)")[![jez500](https://avatars.githubusercontent.com/u/782823?v=4)](https://github.com/jez500 "jez500 (4 commits)")

---

Tags

drupalmessaging

### Embed Badge

![Health badge](/badges/zvse-private-message-messenger-nodejs/health.svg)

```
[![Health](https://phpackages.com/badges/zvse-private-message-messenger-nodejs/health.svg)](https://phpackages.com/packages/zvse-private-message-messenger-nodejs)
```

###  Alternatives

[composer/installers

A multi-framework Composer library installer

1.4k136.0M6.0k](/packages/composer-installers)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M291](/packages/pusher-pusher-php-server)[queue-interop/queue-interop

Promoting the interoperability of MQs objects. Based on Java JMS

48030.5M86](/packages/queue-interop-queue-interop)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[enqueue/amqp-tools

Message Queue Amqp Tools

14721.1M12](/packages/enqueue-amqp-tools)[enqueue/null

Enqueue Null transport

13620.0M45](/packages/enqueue-null)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
