> For the complete documentation index, see [llms.txt](https://docs.otherside.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherside.xyz/odk-docs/odk-plugin/odk-notifications.md).

# ODK Notifications

<figure><img src="/files/6QvJnUBHm80XMvdKMuQG" alt=""><figcaption></figcaption></figure>

The ODK notification system allows for developers to display notifications on a players HUD.

## The Notification Singleton

By default, the `BPM_ODK_NotificationsSingleton` singleton is set in the World Settings. This can be extended and replaced to allow for custom functionality.\
The singleton serves as a notifications manager, broadcasting notifications upon receiving a request.

## Setting up the HUD widget

In order to display notifications on-screen, you must implement a notifications widget on your WBP\_HUD. An example of this is the `WBP_ODK_NotificationsDisplay` widget which contains a vertical box for containing the notification widgets and the functionality to bind to the singleton broadcasts and then add the notifications to the container.

The example widget allows for custom notifcation widgets, but assumes that these widgets extend from `WBP_ODK_NotificationsBase`.

## Custom Widgets

`WBP_ODK_NotificationsBase` is intended to be used alongside `WBP_ODK_NotificationsDisplay` to create custom widgets for notifications. This base class contains functions for setting up the custom widget and helper functions for optionally downloading the notification images.

The `SetupNotification` event should be overidden to set textures and text from the notification payload.

## Sending Notifications

Notifications can be sent using the helper functions in `BPFL_ODK_Notifications`.

### Send ODK Notification To Local Player

<figure><img src="/files/SQ5EFXXulv4ddRnfnvIz" alt=""><figcaption></figcaption></figure>

This function sends a notification to the authoritative player with the following payload:

#### Notification Type

This allows for grouping of notifications. For example: If you have multiple notifications of the same type, such as collecting an item, any new notifications will replace the existing notification in the list to avoid notification spamming.

#### Notification Time

How long to display the notification on-screen if it is not dismissed by the user.

#### ODK Notification Struct

Contains information relevant to the notification such as a Title, Content text, image etc.

The struct also contains an `Additional Data` Morpheus packed struct object which allows for including any information not covered by the struct. It is then up to the developer to unpack this object and use the data as they wish.

<figure><img src="/files/Yn8z4A9AUiBNa0iS7Eh3" alt=""><figcaption><p>any struct type can be packed inside this Additional Data object</p></figcaption></figure>

<figure><img src="/files/0y3wtIpdRE4korW7nNSy" alt=""><figcaption><p>This shows the struct being unpacked after being sent as a notification.</p></figcaption></figure>

### Send ODK Notifcation To All Players

<figure><img src="/files/1MAxUWQOJh7UQnIPQaTU" alt=""><figcaption></figcaption></figure>

This node takes in the same parameters as the local notification, but will be displayed on all users screens.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.otherside.xyz/odk-docs/odk-plugin/odk-notifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
