N
Novu6mo ago
sifx10

Multi Tenancy Notification System for companies

Hi , I had some questions about novu. I want to use it in my notification service which I will deploy on multiple server for multiple companies. I want to be able to change the communication provider settings according to the clients needs. Can you help me out with the flow?
5 Replies
Ask Inkeep
Ask Inkeep6mo ago
Hi @sifx10, 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: * Tenants * Overview * Managing multiple delivery providers in one place * Vue ----------------------------- Answer Absolutely! Novu supports multi-tenancy, which is ideal for deploying a notification system across multiple servers for different companies. Each tenant can have customized settings, including specific communication providers based on the client's needs. Here’s a general flow of how you can manage this with Novu: 1. Create Tenants: Each company can be set up as a separate tenant in Novu. You can create and modify tenants via the API or Novu web platform. Each tenant can have its own unique identifier, which you use to manage notifications settings and routing preferences specific to each tenant (1) . 2. Customize Workflows per Tenant: You can customize notification workflows at the tenant level. This allows you to tailor how notifications are processed and delivered based on the tenant’s specific requirements. 3. Integration Customizations: You can set up different communication providers for each tenant. This might include different email services, SMS providers, or other communication channels depending on what each client needs. You can specify a delivery provider for a channel when a particular tenant ID is matched during the trigger of a notification event. Here’s an example of how you might set up a tenant and customize a notification workflow with different providers using Novu's Node.js client:
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');

// Create a tenant
await novu.tenants.create({
identifier: 'tenantIdentifier',
name: 'Company XYZ',
data: {
customProp: 'Custom data'
}
});

// Trigger a notification with tenant-specific settings
await novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>', {
to: {
subscriberId: '<UNIQUE_SUBSCRIBER_IDENTIFIER>',
},
payload: {
name: "Hello World",
},
tenant: 'tenantIdentifier'
});
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');

// Create a tenant
await novu.tenants.create({
identifier: 'tenantIdentifier',
name: 'Company XYZ',
data: {
customProp: 'Custom data'
}
});

// Trigger a notification with tenant-specific settings
await novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>', {
to: {
subscriberId: '<UNIQUE_SUBSCRIBER_IDENTIFIER>',
},
payload: {
name: "Hello World",
},
tenant: 'tenantIdentifier'
});
Ask Inkeep
Ask Inkeep6mo ago
This code sets up a tenant and triggers a notification using tenant-specific data. You can expand this by integrating different communication providers as per the tenant's preferences. For detailed implementation and more examples, you might want to check the comprehensive documentation on tenants and multi-tenancy features in Novu here.
Sources [1] Tenants
sifx10
sifx10OP6mo ago
How will I add subscribers to tenant?
Ask Inkeep
Ask Inkeep6mo ago
Got it. Tagging @Support for additional help.
Pawan Jain
Pawan Jain6mo ago
@sifx10 tenants and subscribers are not linked together. Read more about how tenants can be used. https://docs.novu.co/tenants/introduction
Novu
Tenants - Novu
Learn all about Tenants
Want results from more Discord servers?
Add your server