Message retention policy

Hello Team!) Is there an "out of the box" solution to configure messages retention period in Novu? Ex: I need to store notification only for 1 week and auto delete after to save disk space.
4 Replies
Ask Inkeep
Ask Inkeep2w ago
Hi @mgalaktionov, I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question. ----------------------------- While I generate an answer, here are some sources that might be helpful: * Messages * Push Channel Introduction * Subscribers * What is Novu? ----------------------------- Answer Hello! I'd be happy to help you with information about message retention policies in Novu. Based on the available information sources, I can provide some insights on this topic. As of version 0.14.0, Novu introduced a Time-To-Live (TTL) feature for messages and other data (1) . This feature automatically deletes old data to save storage space. Here are the current retention periods: 1. In-app messages: 6 months 2. All other messages (including notifications): 1 month 3. Jobs and Execution Details: 1 month Unfortunately, there doesn't seem to be an out-of-the-box solution to configure a custom retention period of 1 week as you requested (2) . The current TTL values are not configurable by users . However, there are a couple of options you might consider: 1. For self-hosted Novu instances, you can disable the TTL feature entirely by setting the environment variable DISABLE_TTL=true (1) . This would allow you to implement your own custom retention policy. 2. You could use the Delete Message API to manually delete messages after a week (3) . This would require you to implement your own scheduled task to delete messages older than a week. Here's an example of how to delete a message using the Node.js SDK:
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
const messageId = '64452b58ec0dbb9e41b4dccf';
await novu.messages.deleteById(messageId);
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
const messageId = '64452b58ec0dbb9e41b4dccf';
await novu.messages.deleteById(messageId);
Ask Inkeep
Ask Inkeep2w ago
It's worth noting that there have been feature requests for configurable TTL (2) (4) , so this functionality might be added in future versions of Novu. If you'd like to stay updated on this feature, you might want to follow the GitHub issue or consider contributing to its development. If you need more specific guidance or if this doesn't fully address your use case, I suggest clicking on the "Ask for help" button to tag a team member for further assistance.
Ask Inkeep
Ask Inkeep2w ago
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.
Pawan Jain
Pawan Jain6d ago
@mgalaktionov Currently we have the option to disable or enable TTL in self-hosting. but customizing the time is not possible. Feel free to add this feedback to our roadmap https://roadmap.novu.co Please use #⚓│community-self-host for self hosting suppot 🙏🏻
Novu roadmap | Productlane
Find out what the Novu team is working on and leave your feedback - powered by Productlane