What's new in Novu 0.22?
Tags: javascript, webdev, novu, notifications
Published: 2023-12-19 12:37:12

**TL;DR:** All you need to know about the latest Novu 0.22.0 release. Multi-tenancy Variants, API Idempotency, API Rate Limiting, Filter conditional variables and more!

## 0.22 Release Updates

We're excited to highlight the newest features introduced in our latest release. Join us as we explore what awaits you!


![Dive in!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gqbxdpos8pwjl4udb9yq.gif)


## Multi-tenancy Variants

Variants is an integral component of our multi-tenancy feature and aims to empower users to create multiple variants for a given workflow step, such as the Email step. These step variations are linked to specific conditions. 

Within the multi-tenancy context, these conditions may pertain to tenants; for instance, if the tenant is named "Nike", a specific email variant will be chosen. 

However, these conditions extend beyond tenants, allowing users to base their criteria on the trigger payload, subscriber data, or webhook data.

During the notification sending phase, the system’s logic will determine the appropriate variant based on the contextual information that was passed with the trigger event and the conditions applied to the variants. Only a single variant will be selected and sent to the user at the end.

**Note:** We have renamed the Filters functionality to Conditions.

![Variants Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7lrbw734hjuo7l1sz0g4.png)

![Adding Variants](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yece5kt512mawrx24n62.png)

![variants](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bk111h5iy6006dh7v3un.gif)
_Adding a variant to email step_

In this gif above, we added a variant to our email step, thus making us have the **root variant** (with no condition) that will be sent if there's no tenant identifier specified, and a **variant** that will be sent if the tenant identifier is Nike.

## Idempotency

To enhance the resilience and dependability of our API system, especially during disruptive scenarios like network interruptions, we have introduced the Idempotency headers to POST and PATCH HTTP methods within the API. 

We have now granted users the ability to include Idempotency headers in their requests. A given operation will not be executed more than once, even if users resubmit the request following a perceived failure.

This guarantees that we process changes in a fail-safe manner, and the system caches the response for a day for future reference. This approach ensures that only valid and unique changes are processed, contributing to the overall robustness and reliability of our API system.

**Note:** Currently, the Idempotency headers are not enabled on the Novu cloud but functionality is available for self-hosting. We are currently integrating it into all of our SDKs as well.

## API Rate Limiting

Rate limiting is an essential functionality for establishing a robust and resilient system. It safeguards system resources from being misused by malicious actors or being monopolized by one client. 

It plays a vital role in sustaining consistent system performance by regulating traffic and preventing sudden increases that could degrade service quality.

**Note:** It's not currently enabled on Novu Cloud yet. We'll inform all users whenever we want to enable this option for all cloud users. If you're self-hosting, you can enable API rate limiting immediately with the `IS_REQUEST_RATE_LIMITING_ENABLED` flag in the environment variable.

**PRs:**
- feat(application-generic, shared): Add Rate Limiting feature flag  in https://github.com/novuhq/novu/pull/4667
- feat(dal, shared, api): Add rate limit DAL attributes by @rifont in https://github.com/novuhq/novu/pull/4758
- feat(api, shared): Add use cases to resolve an environment's api rate limit  in https://github.com/novuhq/novu/pull/4774
- chore(api, shared, app-generic): Convert API rate limit FF to be LaunchDarkly compatible in https://github.com/novuhq/novu/pull/4857
- feat(api): Add evaluate api rate limit use case in https://github.com/novuhq/novu/pull/4844
- feat(api): Add API rate limiting NestJS guard in https://github.com/novuhq/novu/pull/4910
- feat(api): Apply rate limit decorators to api controllers and methods in https://github.com/novuhq/novu/pull/4915
- feat(api): Add variable-cost token bucket rate limiting algorithm in https://github.com/novuhq/novu/pull/4911


## Variable Support in the Step Conditions aka Filters

The condition `Value` field now supports the use of variables as its value, enhancing the dynamic nature of this functionality.

![Value support](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dav7km9mj30ahexvr1sk.png)

**PRs:**
- feat: add support for variables in filter values https://github.com/novuhq/novu/pull/4724

## Workflow Settings Override for tenants

The workflow settings override functionality allows to update the `active` and `channel` preferences fields on the workflow per tenant. 

A good use case for this is the ability to have the following setting preferences enabled for all users, but you want them disabled for specific tenants. For example, you have about 3 tenants: Nike, Cloudinary and Eden. You can create a new settings override by passing the `tenantId` and `workflowId`, and your preferences.

We have implemented the set of the API endpoints that allow the following: 

- Creating, updating and deleting overrides, 
- List all overrides, or for one template.

![Workflow Overrides](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6s86lmmdme4yw0bgoxv.png)

![Post workflow settings overrides](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g87gqjltbjdf95lqyzqc.png)
_Create new workflow settings overrides_


![Update workflow settings overrides](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/knqedo9t6jdb7y2g86bs.png)
_Update workflow settings overrides_


**PRs:**
- Stacked PR's of - Workflow override in https://github.com/novuhq/novu/pull/4773

**Note:** We are currently working on ensuring our SDKs have support for this functionality.

## Event Cancellation from Digest

Novu now allows the cancellation of any event from the digest.

![Event cancellation from Digest](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dl30q72q4xlir6o90dk1.png)

**PRs:**
- Feature: Ability to cancel any arbitrary events from digest in https://github.com/novuhq/novu/pull/4888

## Resiliency and Performance Improvements

We have done some performance plumbing to improve the speed & resilience of the overall system. Our goal is to keep working on performance, reliability and resilience in every release.

## Custom SMS Provider Integration

You can now send SMS messages using custom SMS providers using REST API. Do this by setting up the Generic SMS provider:

![Generic SMS provider](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n9swczntua8dc5olses5.png)

![Generic SMS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/azgyi153lpa1pqkvqd0a.png)

## MessageBird SMS Provider Integration
You can now send SMS messages via the MessageBird SMS provider integration:

![MessageBird](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n7ebxrxltm799vaw7iru.png)

## BulkSMS Provider Integration
You can now send SMS messages via the BulkSMS SMS provider integration:

![BulkSMS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p7qb9e0swkhm0azmaacj.png)

## SimpleTexting SMS Provider Integration
You can now send SMS messages via the SimpleTexting SMS provider integration:

![SimpleTexting SMS provider](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/juxfs2egc3ygkwyg6ng8.png)


## Azure SMS Provider Integration
You can now send SMS messages via the Azure SMS provider integration:

![Azure SMS Provider](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxmja0ebqwy7xxb47wb4.png)

## Braze Email Provider Integration
You can now send emails via the Braze Email provider integration:

![Braze Email Provider Integration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gxyy2ryc0o9ul8805648.png)

## Pusher Beams Provider Integration
You can now send messages via the Pusher Beams provider integration:

![Pusher Beams](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yseq8cknazxj4gdo97j2.png)

## Grafana On Call Webhook Chat Provider Integration
You can now send messages via the Grafana On Call webhook chat provider integration:

![Grafana](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3gy2q2pgiqsuvje9ra3m.png)


## All Changes

You can find the full changelog on [GitHub](https://github.com/novuhq/novu/compare/v0.21.0...v0.22.0).


## Conclusion

[Sign up on Novu](https://web.novu.co), try it out & let me know what you think about the new changes in the comments section.

If you want to contribute to OSS and make an impact, I believe it is a [great place to start](https://github.com/novuhq/novu) & build out amazing things.

Oh, remember to star the repo as well.🤩 See you in the next release! 🚀