- Grouping each subscriber’s Inbox feed by tenant
- Scoping notification preferences per tenant
- Adjusting notification content and branding per tenant
tenant context to define tenant boundaries instead of duplicating subscribers, prefixing subscriber IDs, or maintaining separate workflows per tenant.
New to contexts? Start with Contexts to understand how context scoping, persistence, and Inbox filtering work.
How multi-tenancy works in Novu
Multi-tenancy in Novu is built on top of contexts. Atenant context identifies which organization a notification belongs to.
When you trigger a workflow with a tenant context:
- Notifications are associated with that tenant
- The same subscriber can receive different notifications per tenant
- Inbox preferences are scoped to the subscriber and tenant context combination
Implement multi-tenancy with contexts
1
Define a tenant context
A tenant context identifies a specific tenant. Use a simple string for the tenant ID, or a rich object when you need metadata such as company name, logo, or plan type.Contexts are auto-created on first use. Manage them from the Contexts section in the Novu dashboard or through the Contexts API.
2
Trigger workflows with a tenant context
Pass the tenant context when triggering a workflow. Keep the subscriber ID stable - use your application’s user ID, not a tenant-prefixed value.
- Node.js
- Python
- Go
- PHP
- .NET
- Java
- cURL
3
Filter the Inbox by tenant
Pass the same tenant context to the Inbox so each subscriber sees only notifications for their active tenant.When a subscriber switches tenants, re-render the Inbox with the new context. Novu refetches notifications and reconnects the WebSocket scope.
Secure tenant context in production with
contextHash. See Inbox with context.4
Personalize content per tenant
Use tenant metadata in templates with the You can also branch workflow logic on tenant data in step conditions. See Contexts in workflows.
{{context}} helper:Tenant context in the Inbox
The Inbox uses exact-match context filtering. The tenant context on<Inbox /> must match the context used at trigger time.
Each subscriber gets a separate Inbox feed and preference configuration per tenant context.
Frequently asked questions
Can I use a different delivery provider for each tenant?
Can I use a different delivery provider for each tenant?
Currently, Novu does not support using a different delivery provider per tenant. Contact [email protected] if this is required for your use case.
Can subscribers manage different preferences per tenant?
Can subscribers manage different preferences per tenant?
Yes. When you scope the Inbox with a tenant context, preferences are stored per subscriber and tenant context combination. A subscriber can enable email for one tenant and disable it for another.
Can I combine tenant context with other context types?
Can I combine tenant context with other context types?
Yes. You can pass up to five context keys per trigger - for example,
tenant and app together. The Inbox must declare the same combined context to display those notifications. See Contexts.Related guides
Contexts
Learn what contexts are and how they work across Novu.
Multi-tenancy in the Inbox
End-to-end Inbox setup for multi-tenant applications.
Manage contexts
Create, update, and delete tenant contexts through the API.
Inbox with context
Secure tenant context with
contextHash.