Skip to content
This repository was archived by the owner on Mar 29, 2026. It is now read-only.

UserNotification Cloud API#851

Merged
Neztore merged 13 commits into
noblox:nextfrom
commonly-ts:master
Aug 8, 2025
Merged

UserNotification Cloud API#851
Neztore merged 13 commits into
noblox:nextfrom
commonly-ts:master

Conversation

@commonly-ts
Copy link
Copy Markdown
Contributor

Allows a notification to be sent to a user through a universe.

Example usage

// JavaScript

await noblox.setAPIKey(API_KEY!);

const universeId = 4434277335;
const targetUserId = 1210019099;
const assetId = "774d62e5-3414-b84a-89dd-77d96f1a3d33";

const parameters = {
    data: { stringValue: "Hello world!" }
};

await noblox.sendUserNotification(universeId, targetUserId, assetId, parameters);

Notification:
image
image

How it works

This pull request adds the sendUserNotification function that allows for example, a Discord bot to send a user a notification for a use case such as an application centre. A notification can be sent out to alert the user of their applications status.

Notifications are created through the Notifications tab under Engagement.
image

Custom text that is sent through the API is to be named and placed inside curly braces {myMessage}. To set the message, the code would look like this:

const parameters = {
    myMessage: { stringValue: "This is my message." }
};

This API requires the use of an API key. The given universeId must be added to the API key and given the scope user.user-notification:write.

image

Documentation

https://create.roblox.com/docs/production/promotion/experience-notifications#creating-a-notification-string
https://create.roblox.com/docs/cloud/reference/UserNotification

Comment thread typings/index.d.ts
@Regalijan Regalijan self-requested a review December 17, 2024 21:40
Copy link
Copy Markdown
Member

@Regalijan Regalijan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there's no typing added to the jsdocs

Comment thread lib/games/sendUserNotification.js Outdated
@Regalijan
Copy link
Copy Markdown
Member

It needs a test case too but I'll probably do that myself

@Neztore
Copy link
Copy Markdown
Member

Neztore commented Apr 6, 2025

What state is this PR in? @Regalijan

@Regalijan
Copy link
Copy Markdown
Member

When I last checked it works, the problem is that I can't make a test for it until someone gets the account ready.

The api key also needs the user notification scope for that matter.

Copy link
Copy Markdown
Member

@Regalijan Regalijan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me now

@Neztore Neztore changed the base branch from master to next August 8, 2025 12:47
@Neztore Neztore merged commit 6860256 into noblox:next Aug 8, 2025
2 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 8, 2025

🎉 This PR is included in version 7.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Neztore added a commit that referenced this pull request Mar 27, 2026
* First attempt at new release system

* BREAKING CHANGE: Document new versioning

* fix: add release branches

* ci: Add new release workflow

BREAKING CHANGE: Trigger new major release to cover previously made major changes

* fix: Update user block/unblock endpoints (#869)

* feat: UserNotification Cloud API (#851)

* Create new function

* Updated and added typings

* Fixed linting

* Fixed linting electric boogaloo

linting better be happy now...

* Linting final touches of grace

* Linting obliteration of an unworthy comma

* Added typings to jsDocs

* Fix error handling

* Add test case for sendUserNotification

* Remove extra await

* Migrate to new error class

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>

* feat: Add group ban methods (#872)

* Create banFromGroup method

* Create unbanFromGroup

* Change return type of banFromGroup

* Create getGroupBans

* Add GroupBan type

* Add function types for new methods

* We need to actually return the response body

* Change limit type to number

getPageResults will accept numbers higher than 100 and will paginate

* getPageResults only returns the data property

* Change function type to accept number for limit

* Add test cases for banFromGroup, getGroupBans, and unbanFromGroup

* fix: Update user agent per Roblox's request (#870)

* fix: Update user agent per Roblox's request

* fix: Change header check for request forwarding

UA enforcement means there will always be headers now

* Add lock_ua setting

* lock_ua -> use_noblox_ua

* Set ua in request defaults if enabled

* Le lint

* Add user-agent documentation

* Correct documentation

---------

Co-authored-by: Josh Muir <josh@muir.xyz>

* feat: Add getGroupPayoutEligibility (#834)

* Add canpay function

* Add PayoutAllowedList type to jsdocs

* Fix formatting

* canPay -> getGroupPayoutEligibility

* Only log first error message from endpoint (as if Roblox ever returned more than one)

* Fix type for PayoutAllowedList

* Add function type for getGroupPayoutEligibility

* Document jar param in getGroupPayoutEligibility

* Update example

* Move getGroupPayoutEligibility to economy

* Update import for getGroupPayoutEligibility

* Move function type to economy section

* Add test case

Arguments will most likely need to be adjusted but that's easy to do

* Allow checking multiple users

* Update typings part 1

* Update jsdoc

* Migrate error handling

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>

* fix: Final touches of error migration (#873)

* Don't import buy.js

* Apparently autocomplete didn't catch this one

* Oh and migrate this too

* feat: Implement handleJoinRequests function for batch user join requests (#880)

* feat: Implement handleJoinRequests function for batch user join request management

* fix: Add missing newline at end of handleJoinRequests.js

---------

Co-authored-by: realCartar <admin@softwareventures.com.au>

* Update action

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>
Co-authored-by: Commonly <51011212+commonly-ts@users.noreply.github.com>
Co-authored-by: supercoolspy <66487448+supercoolspy@users.noreply.github.com>
Co-authored-by: Ethan <39052179+realCartar@users.noreply.github.com>
Co-authored-by: realCartar <admin@softwareventures.com.au>
Neztore added a commit that referenced this pull request Mar 27, 2026
* Next (#892)

* First attempt at new release system

* BREAKING CHANGE: Document new versioning

* fix: add release branches

* ci: Add new release workflow

BREAKING CHANGE: Trigger new major release to cover previously made major changes

* fix: Update user block/unblock endpoints (#869)

* feat: UserNotification Cloud API (#851)

* Create new function

* Updated and added typings

* Fixed linting

* Fixed linting electric boogaloo

linting better be happy now...

* Linting final touches of grace

* Linting obliteration of an unworthy comma

* Added typings to jsDocs

* Fix error handling

* Add test case for sendUserNotification

* Remove extra await

* Migrate to new error class

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>

* feat: Add group ban methods (#872)

* Create banFromGroup method

* Create unbanFromGroup

* Change return type of banFromGroup

* Create getGroupBans

* Add GroupBan type

* Add function types for new methods

* We need to actually return the response body

* Change limit type to number

getPageResults will accept numbers higher than 100 and will paginate

* getPageResults only returns the data property

* Change function type to accept number for limit

* Add test cases for banFromGroup, getGroupBans, and unbanFromGroup

* fix: Update user agent per Roblox's request (#870)

* fix: Update user agent per Roblox's request

* fix: Change header check for request forwarding

UA enforcement means there will always be headers now

* Add lock_ua setting

* lock_ua -> use_noblox_ua

* Set ua in request defaults if enabled

* Le lint

* Add user-agent documentation

* Correct documentation

---------

Co-authored-by: Josh Muir <josh@muir.xyz>

* feat: Add getGroupPayoutEligibility (#834)

* Add canpay function

* Add PayoutAllowedList type to jsdocs

* Fix formatting

* canPay -> getGroupPayoutEligibility

* Only log first error message from endpoint (as if Roblox ever returned more than one)

* Fix type for PayoutAllowedList

* Add function type for getGroupPayoutEligibility

* Document jar param in getGroupPayoutEligibility

* Update example

* Move getGroupPayoutEligibility to economy

* Update import for getGroupPayoutEligibility

* Move function type to economy section

* Add test case

Arguments will most likely need to be adjusted but that's easy to do

* Allow checking multiple users

* Update typings part 1

* Update jsdoc

* Migrate error handling

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>

* fix: Final touches of error migration (#873)

* Don't import buy.js

* Apparently autocomplete didn't catch this one

* Oh and migrate this too

* feat: Implement handleJoinRequests function for batch user join requests (#880)

* feat: Implement handleJoinRequests function for batch user join request management

* fix: Add missing newline at end of handleJoinRequests.js

---------

Co-authored-by: realCartar <admin@softwareventures.com.au>

* Update action

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>
Co-authored-by: Commonly <51011212+commonly-ts@users.noreply.github.com>
Co-authored-by: supercoolspy <66487448+supercoolspy@users.noreply.github.com>
Co-authored-by: Ethan <39052179+realCartar@users.noreply.github.com>
Co-authored-by: realCartar <admin@softwareventures.com.au>

* require lts (#893)

* Update perms (#894)

* Upgrade sem-rel: use trusted publishing

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>
Co-authored-by: Commonly <51011212+commonly-ts@users.noreply.github.com>
Co-authored-by: supercoolspy <66487448+supercoolspy@users.noreply.github.com>
Co-authored-by: Ethan <39052179+realCartar@users.noreply.github.com>
Co-authored-by: realCartar <admin@softwareventures.com.au>
Neztore added a commit that referenced this pull request Mar 27, 2026
* Request forwarding for CI (#863)

* Add request manipulation for ci testing in http module

* URL -> HOSTNAME and fix auth header

* Here goes nothing

* Curse you standard

* Use node 22 for tests

* Revert back to 20

22 works but none of the other workflows use it

* URL -> HOSTNAME (again)

* Make requests actually route through forwarder

* Add api key to env

* Move header setting to jar check

* Actually fix it this time

* Add comments on request forwarder

* Fixes #864 (#865)

Support caching the value `0`

* Remove buy() (#867)

* Delete lib/economy/buy.js

* Remove BuyAssetResponse type

* Remove BuyProductInfo and BuyAssetResponse

* Remove it all this time

* Migrate methods to RobloxAPIError class (#855)

* Here goes nothing

* Add caller getter to RobloxAPIError

* Fix linting

* Migrate canManage and configureItem

* Redo error parsing for addDeveloperProduct

* First attempt at new release system

* BREAKING CHANGE: Document new versioning

* fix: add release branches

* ci: Add new release workflow

BREAKING CHANGE: Trigger new major release to cover previously made major changes

* fix: Update user block/unblock endpoints (#869)

* feat: UserNotification Cloud API (#851)

* Create new function

* Updated and added typings

* Fixed linting

* Fixed linting electric boogaloo

linting better be happy now...

* Linting final touches of grace

* Linting obliteration of an unworthy comma

* Added typings to jsDocs

* Fix error handling

* Add test case for sendUserNotification

* Remove extra await

* Migrate to new error class

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>

* feat: Add group ban methods (#872)

* Create banFromGroup method

* Create unbanFromGroup

* Change return type of banFromGroup

* Create getGroupBans

* Add GroupBan type

* Add function types for new methods

* We need to actually return the response body

* Change limit type to number

getPageResults will accept numbers higher than 100 and will paginate

* getPageResults only returns the data property

* Change function type to accept number for limit

* Add test cases for banFromGroup, getGroupBans, and unbanFromGroup

* fix: Update user agent per Roblox's request (#870)

* fix: Update user agent per Roblox's request

* fix: Change header check for request forwarding

UA enforcement means there will always be headers now

* Add lock_ua setting

* lock_ua -> use_noblox_ua

* Set ua in request defaults if enabled

* Le lint

* Add user-agent documentation

* Correct documentation

---------

Co-authored-by: Josh Muir <josh@muir.xyz>

* feat: Add getGroupPayoutEligibility (#834)

* Add canpay function

* Add PayoutAllowedList type to jsdocs

* Fix formatting

* canPay -> getGroupPayoutEligibility

* Only log first error message from endpoint (as if Roblox ever returned more than one)

* Fix type for PayoutAllowedList

* Add function type for getGroupPayoutEligibility

* Document jar param in getGroupPayoutEligibility

* Update example

* Move getGroupPayoutEligibility to economy

* Update import for getGroupPayoutEligibility

* Move function type to economy section

* Add test case

Arguments will most likely need to be adjusted but that's easy to do

* Allow checking multiple users

* Update typings part 1

* Update jsdoc

* Migrate error handling

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>

* fix: Final touches of error migration (#873)

* Don't import buy.js

* Apparently autocomplete didn't catch this one

* Oh and migrate this too

* Bump handlebars from 4.7.8 to 4.7.9 (#886)

Bumps [handlebars](https://github.com/handlebars-lang/handlebars.js) from 4.7.8 to 4.7.9.
- [Release notes](https://github.com/handlebars-lang/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/v4.7.9/release-notes.md)
- [Commits](handlebars-lang/handlebars.js@v4.7.8...v4.7.9)

---
updated-dependencies:
- dependency-name: handlebars
  dependency-version: 4.7.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump undici from 6.21.2 to 6.24.1 (#883)

Bumps [undici](https://github.com/nodejs/undici) from 6.21.2 to 6.24.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v6.21.2...v6.24.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.24.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump minimatch from 3.1.2 to 3.1.5 (#881)

Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](isaacs/minimatch@v3.1.2...v3.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump lodash from 4.17.21 to 4.17.23 (#879)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump picomatch from 2.3.1 to 2.3.2 (#885)

Bumps [picomatch](https://github.com/micromatch/picomatch) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](micromatch/picomatch@2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 2.3.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump flatted from 3.3.3 to 3.4.2 (#884)

Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.3 to 3.4.2.
- [Commits](WebReflection/flatted@v3.3.3...v3.4.2)

---
updated-dependencies:
- dependency-name: flatted
  dependency-version: 3.4.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: Implement handleJoinRequests function for batch user join requests (#880)

* feat: Implement handleJoinRequests function for batch user join request management

* fix: Add missing newline at end of handleJoinRequests.js

---------

Co-authored-by: realCartar <admin@softwareventures.com.au>

* Update deprecated GitHub Actions to latest versions (#889)

Bump actions/checkout from v2 to v4, actions/setup-node from v1 to v4,
and actions/cache from v1 to v4 across doc-publish and npmpublish workflows.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* Switch npm publish to on dispatch only (#890)

* Switch npm publish to on dispatch only

* Add new release workflow
v6.3.0

* Add new release workflow
v6.3.0

* Add permissions

* Switch to trusted publishing

* v7.4.0 (#891)

* Update action

* Copy master over next (#895)

* Next (#892)

* First attempt at new release system

* BREAKING CHANGE: Document new versioning

* fix: add release branches

* ci: Add new release workflow

BREAKING CHANGE: Trigger new major release to cover previously made major changes

* fix: Update user block/unblock endpoints (#869)

* feat: UserNotification Cloud API (#851)

* Create new function

* Updated and added typings

* Fixed linting

* Fixed linting electric boogaloo

linting better be happy now...

* Linting final touches of grace

* Linting obliteration of an unworthy comma

* Added typings to jsDocs

* Fix error handling

* Add test case for sendUserNotification

* Remove extra await

* Migrate to new error class

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>

* feat: Add group ban methods (#872)

* Create banFromGroup method

* Create unbanFromGroup

* Change return type of banFromGroup

* Create getGroupBans

* Add GroupBan type

* Add function types for new methods

* We need to actually return the response body

* Change limit type to number

getPageResults will accept numbers higher than 100 and will paginate

* getPageResults only returns the data property

* Change function type to accept number for limit

* Add test cases for banFromGroup, getGroupBans, and unbanFromGroup

* fix: Update user agent per Roblox's request (#870)

* fix: Update user agent per Roblox's request

* fix: Change header check for request forwarding

UA enforcement means there will always be headers now

* Add lock_ua setting

* lock_ua -> use_noblox_ua

* Set ua in request defaults if enabled

* Le lint

* Add user-agent documentation

* Correct documentation

---------

Co-authored-by: Josh Muir <josh@muir.xyz>

* feat: Add getGroupPayoutEligibility (#834)

* Add canpay function

* Add PayoutAllowedList type to jsdocs

* Fix formatting

* canPay -> getGroupPayoutEligibility

* Only log first error message from endpoint (as if Roblox ever returned more than one)

* Fix type for PayoutAllowedList

* Add function type for getGroupPayoutEligibility

* Document jar param in getGroupPayoutEligibility

* Update example

* Move getGroupPayoutEligibility to economy

* Update import for getGroupPayoutEligibility

* Move function type to economy section

* Add test case

Arguments will most likely need to be adjusted but that's easy to do

* Allow checking multiple users

* Update typings part 1

* Update jsdoc

* Migrate error handling

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>

* fix: Final touches of error migration (#873)

* Don't import buy.js

* Apparently autocomplete didn't catch this one

* Oh and migrate this too

* feat: Implement handleJoinRequests function for batch user join requests (#880)

* feat: Implement handleJoinRequests function for batch user join request management

* fix: Add missing newline at end of handleJoinRequests.js

---------

Co-authored-by: realCartar <admin@softwareventures.com.au>

* Update action

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>
Co-authored-by: Commonly <51011212+commonly-ts@users.noreply.github.com>
Co-authored-by: supercoolspy <66487448+supercoolspy@users.noreply.github.com>
Co-authored-by: Ethan <39052179+realCartar@users.noreply.github.com>
Co-authored-by: realCartar <admin@softwareventures.com.au>

* require lts (#893)

* Update perms (#894)

* Upgrade sem-rel: use trusted publishing

---------

Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>
Co-authored-by: Commonly <51011212+commonly-ts@users.noreply.github.com>
Co-authored-by: supercoolspy <66487448+supercoolspy@users.noreply.github.com>
Co-authored-by: Ethan <39052179+realCartar@users.noreply.github.com>
Co-authored-by: realCartar <admin@softwareventures.com.au>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Regalijan <72576136+Regalijan@users.noreply.github.com>
Co-authored-by: mutex_lock <9419610+mutex-lock@users.noreply.github.com>
Co-authored-by: Commonly <51011212+commonly-ts@users.noreply.github.com>
Co-authored-by: supercoolspy <66487448+supercoolspy@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ethan <39052179+realCartar@users.noreply.github.com>
Co-authored-by: realCartar <admin@softwareventures.com.au>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants