import { Novu } from "@novu/api";
import { MarkAllMessageAsRequestDtoMarkAs } from "@novu/api/models/components";
const novu = new Novu({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await novu.subscribers.messages.markAll("<value>", {
markAs: MarkAllMessageAsRequestDtoMarkAs.Seen,
});
// Handle the result
console.log(result)
}
run();
123
Subscribers
Update all notifications state
Update all subscriber in-app (inbox) notifications state such as read, unread, seen or unseen by subscriberId.
POST
/
v1
/
subscribers
/
{subscriberId}
/
messages
/
mark-all
SubscribersController_markAllUnreadAsRead
import { Novu } from "@novu/api";
import { MarkAllMessageAsRequestDtoMarkAs } from "@novu/api/models/components";
const novu = new Novu({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await novu.subscribers.messages.markAll("<value>", {
markAs: MarkAllMessageAsRequestDtoMarkAs.Seen,
});
// Handle the result
console.log(result)
}
run();
123
Enter your API key in the Authorization field like the example shown below:E.g ApiKey 18d2e625f05d80e