Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Driplet

No security coverage Drupal 10–11
View on drupal.org

This module pushes real-time messages to users on your site using the Driplet microservice. It allows for features like live notifications, content updates, system alerts, and even real-time chat by sending messages to specific users, roles, or topics via WebSockets.

A Drupal module that provides pushing messages to the frontend using Driplet microservice. It enables pushing real-time messages to specific users or roles via WebSockets. The module depends on Driplet PHP library.

Use cases

  • Sending real-time notifications to users (example for this can be found inside driplet_notify submodule)
  • Notifying users of new content/updates in real time
  • Alerting about system events or changes
  • View log messages in real time (example for this can be found inside driplet_log submodule)
  • A possibility of creating a real-time chat/chatrooms between users/site visitors
  • Moderation queue alerts
  • Custom live analytics inside Drupal

Requirements

The module works in conjunction with Driplet - a Go-based microservice. Ensure Driplet is properly configured and running before using the module.

How it works

A backend service (e.g. Drupal) can push a message to Driplet microservice, which will then push the message to the frontend clients. The message can be targeted to specific users, roles, or topics. The frontend clients can subscribe to topics and receive messages in real-time.

More on how it works

Driplet can authenticate users based on their JWT tokens which Driplet module generates on (/api/driplet/jwt) endpoint. The JWT includes user ID and user roles which can be used as targeting criteria for messages. For instance, it is possible to send a message only to specific roles, uids, or a combination of both. It's also possible to invert the logic and specify exclusion criteria.

There is also a concept of topics which can be used to group messages. For instance, on a specific page, a frontend user can subscribe only to a topic relevant to that page. This way, the user will receive only messages relevant to that topic. It's possible to subscribe to multiple topics at once, and handle each topic separately.

Submodules

Real-time logs

Enable driplet_log to access real-time logs.

Push notifications

Enable driplet_notify to access real-time push notifications.

How to use

In PHP:

  $driplet = \Drupal::service('driplet.service');

  $message = $driplet->createMessage()
    ->setMessage([
      'some' => 'some',
      'keys' => 'content'
    ])
    ->setTopic('some-topic')
    ->include()
    ->setTarget('roles', 'authenticated');

  $driplet->sendMessage($message);

In JS on the frontend:

const client = DripletClient.getInstance(wsEndpoint, jwtEndpoint);
client.setTopics(['some-topic']);

client.onMessage((data) => {
  if (data.topic !== 'some-topic') return;

  // Handle the message
  console.log('Received message:', data.message);
});

Documentation

Read the supplied Readme.md in the root folder on how to set up the module and how to run Driplet in DDEV.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Jan 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 4
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
1.0.2 Stable 10–11 Feb 1, 2025
1.0.1 Stable 10–11 Jan 29, 2025
1.0.x-dev Dev 10–11 Jan 29, 2025
1.0.0 Stable 10–11 Jan 29, 2025