Multi-tenancy
Sellub supports many sellers on one backend via Vendure’s Channel model.
What a Channel scopes
| Scoped per-channel | Global |
|---|---|
| Products, variants, collections, facets | Customers |
| Orders | Administrators (but their roles are channel-scoped) |
| Promotions, shipping & payment methods | Tax categories, zones, countries |
| Storefront branding (via plugin metadata) | Stock locations (selectable per channel) |
Channel codes
__default_channel__— the marketplace.seller-<slug>— branded sellers (Type 2). Slug derived from the seller’s chosen domain.donations-<slug>— Type 4 donation pages.
Provisioning on approval
When a Type 2 seller is approved, the MultiChannelOnboardingPlugin runs:
- Creates a
Channelwith the new code. - Creates the
Selleradmin role scoped to that channel. - Creates the
Administratorand links the role. - Configures default payment methods (Paystack), shipping methods, and tax setup for the channel.
- Initialises an empty wallet.
- Optionally: clones a starter set of collections/facets from the marketplace.
All in a single DB transaction — failure rolls back cleanly.
Storefront resolution
Incoming requests resolve to a channel via:
- Custom domain (Type 2): Domain → Channel mapping in
domain_routestable. - Subdomain or path (Marketplace):
sellub.com/shop/<slug>→ channel code__default_channel__filtered by seller slug.
The Shop API requires vendure-token: <channelToken> header — set automatically by each storefront app.
Cross-channel queries
A few admin queries need cross-channel data (e.g. global Sellers list, platform-wide finance reports). These are implemented as:
- Custom resolvers that query directly with the channel guard relaxed (only allowed for SuperAdmin/Platform roles).
- Read-only views in Postgres for reporting.
Avoid bypassing the channel guard outside of these documented places. Channel scoping is the primary tenancy boundary; bypassing it has been the source of every multi-tenancy bug we’ve shipped.
Limits
| Resource | Soft limit | Notes |
|---|---|---|
| Channels per server | ~5,000 | Tested; beyond this consider sharding |
| Custom domains | ~2,000 | DNS-cert provisioning is the bottleneck |
| Admins per channel | unlimited | Practical max ~20 |