Skip to main content

Class: NotificationUtils

Defined in: service-core/src/NotificationUtils.ts:11

Utility functions for sending push notifications to registered clients.

Constructors

Constructor

new NotificationUtils(redis): NotificationUtils

Defined in: service-core/src/NotificationUtils.ts:20

Initializes the utility using the given redis connection.

Parameters

redis

Redis

The redis connection to publish to.

Returns

NotificationUtils

Methods

sendMessage()

sendMessage(uids, type, action, data): void

Defined in: service-core/src/NotificationUtils.ts:32

Sends a given message to the room or user with the specified uid(s).

Parameters

uids

string | string[]

The universally unique identifier of the room or user to send the message to.

type

string

The type of message being sent.

action

string

The action performed on the data (if applicable).

data

any

The contents of the message to send to the room or user.

Returns

void