Skip to main content
npayload is launching soon.
npayloadDocs
Solutions

npayload for SaaS Platforms

Multi-tenant messaging, per-customer event delivery, and marketplace extensions

The challenge

SaaS platforms sit at the center of their customers' workflows. Every meaningful action, whether a user signs up, a record changes, or a report completes, needs to reach downstream systems reliably. That means:

  • Delivering webhooks to hundreds or thousands of customer endpoints, each with different reliability characteristics
  • Processing internal events across microservices without losing messages
  • Letting customers build their own integrations and extensions
  • Documenting your event API so customers know exactly what to expect

Most teams start with a simple HTTP callback, then spend months building retry logic, circuit breakers, dead letter queues, and monitoring. npayload gives you all of this from day one.

How npayload solves it

Per-customer webhook delivery

Every customer endpoint gets independent retry logic and circuit breakers. If one customer's server goes down, it does not affect delivery to any other customer. Failed deliveries land in a dead letter queue for inspection and replay.

Per-customer webhook delivery
import { NPayload } from "@npayload/node";

const np = new NPayload({ apiKey: process.env.NPAYLOAD_API_KEY });

// Create a channel for each customer
const channel = await np.channels.create({
  name: `webhooks.${customerId}`,
  type: "standard",
});

// Subscribe the customer's endpoint
await np.subscriptions.create({
  channelId: channel.id,
  endpoint: customer.webhookUrl,
  retryPolicy: {
    maxAttempts: 5,
    backoffMultiplier: 2,
    initialDelay: 1000,
  },
});

// Publish events. npayload handles delivery, retries, and circuit breaking.
await np.messages.publish({
  channelId: channel.id,
  type: "invoice.paid",
  payload: {
    invoiceId: "inv_abc123",
    amount: 9900,
    currency: "usd",
  },
});

Multi-tenant channel design

Two patterns work well depending on your scale:

Channel per customer works best when customers have different subscription configurations, retry policies, or delivery endpoints.

Channel per customer
// Each customer gets isolated channels
const channel = await np.channels.create({
  name: `events.${customerId}`,
  type: "standard",
});

Shared channel with routing keys works best when all customers receive the same event types and you want simpler management.

Shared channel with routing keys
// Single channel, route by customer
await np.messages.publish({
  channelId: "events.all",
  type: "order.created",
  routingKey: customerId,
  payload: orderData,
});

// Customer only receives their events
await np.subscriptions.create({
  channelId: "events.all",
  endpoint: customer.webhookUrl,
  routingKeyFilter: customerId,
});

Event catalogue for API contracts

Document every event your platform produces. Customers can browse available events, see their schemas, and generate type-safe client code.

Register an event schema
await np.eventCatalogue.register({
  type: "invoice.paid",
  version: "1.0.0",
  schema: {
    type: "object",
    properties: {
      invoiceId: { type: "string" },
      amount: { type: "number" },
      currency: { type: "string" },
    },
    required: ["invoiceId", "amount", "currency"],
  },
  description: "Fired when an invoice payment is confirmed.",
});

Marketplace for customer extensions

Let your customers publish and discover integrations built on your event streams. npayload's marketplace provides listing management, reviews, and usage tracking.

Architecture

What you get vs. building it yourself

CapabilitynpayloadDIY
Per-customer retries with backoffIncludedBuild retry queue, persistence, backoff logic
Circuit breaker per endpointIncludedImplement state machine, failure tracking
Dead letter queue with replayIncludedBuild DLQ storage, inspection UI, replay logic
Event schema registryIncludedSeparate service to build and maintain
Multi-tenant isolationBuilt inOngoing security audits
Marketplace for extensionsIncludedMonths of product development
Delivery monitoring and metricsIncludedIntegrate observability stack
Cross-region deliveryBuilt inMulti-region infrastructure project

Next steps

  • Use Cases: Detailed patterns for event-driven SaaS architectures
  • Marketplace: Publishing and discovering integrations
  • Webhooks Guide: Configuring webhook delivery, retries, and monitoring

Was this page helpful?

On this page