---
title: "Svix"
description: "Use Svix for MainSDK outbound webhooks - Standard Webhooks delivery, main.yaml, retries, local testing and swapping from the built-in driver."
section: "integrations"
canonical: "https://mainsdk.dev/docs/integrations/svix"
updated: "2026-10-28"
---

# Svix

> Use Svix for MainSDK outbound webhooks - Standard Webhooks delivery, main.yaml, retries, local testing and swapping from the built-in driver.

Canonical: https://mainsdk.dev/docs/integrations/svix · Updated: 2026-10-28

Svix is a hosted webhook delivery service and the alternative to the built-in driver behind [`webhooks`](https://mainsdk.dev/docs/interfaces/webhooks). `webhooks.emit()` hands each delivery to Svix, which signs it per Standard Webhooks and retries it. Pick it when you send webhooks to many customers and want delivery run as a service.

## Interfaces it serves

### Webhooks (`webhooks`)

- Status: Preview · ships as a stable API
- Driver: `svix` (Svix)
- Docs: https://mainsdk.dev/docs/interfaces/webhooks.md

```yaml
webhooks:
  driver: svix
```

Swap to another provider: `builtin`.

## Before you start

1. Create a Svix account and an environment for development and one for production.
2. Create an API key for each environment and store it in your secrets manager.
3. Decide how your customers' endpoints map to Svix applications. How MainSDK maps an `emit()` endpoint onto Svix is not specified yet [TBD].

## Configure

```yaml title="main.yaml"
webhooks:
  driver: svix                 # [TBD] how the driver takes its API key; suggested name SVIX_API_KEY
  retries: { max: 8, window: 24h }
```

## Use it

```ts title="app/orders/ship.ts"
import { webhooks } from "mainsdk";

export async function notifyPartner(order: { id: string; partnerUrl: string }) {
  return webhooks.emit(
    order.partnerUrl,                                         // [TBD] endpoint type
    { type: "order.shipped", data: { orderId: order.id } },   // [TBD] event shape
    { idempotencyKey: `order.shipped:${order.id}` },
  );
}
```

## Local development and testing

Use the `builtin` driver in development. In tests, `createTestApp()` from `@mainsdk/testing` runs `webhooks` on a fake, `chaos.on("webhooks", { outage: true })` shows retries, and `clock.advance()` moves through the retry window.

## What MainSDK adds on top

- Outbound webhooks signed per Standard Webhooks.
- Idempotency keys, so a retried `emit()` delivers once.
- `webhooks.receive()` for inbound calls stays the same whichever driver sends.

See [Webhooks](https://mainsdk.dev/docs/interfaces/webhooks).

## Limits and notes

- The driver comes with the webhooks-jobs spec (phase 1).
- Payloads pass through Svix; check its data region fits yours (US, EU or India).

## Swap to or from it

```yaml title="main.yaml"
webhooks:
  driver: svix   # was builtin
```

Outbound webhooks are stateless, so `mainsdk swap` needs no data migration. Whether the delivery log moves with the driver is not stated yet [TBD].

## FAQ

**Do receivers need to change anything?** No. Deliveries are Standard Webhooks either way, so receivers verify them with any standard library.

**Is Svix used for inbound webhooks?** No. The driver is for `emit()`; `receive()` verification runs in MainSDK.

## Next

- [Webhooks](https://mainsdk.dev/docs/interfaces/webhooks) and [Events and background jobs](https://mainsdk.dev/docs/interfaces/jobs)
- [Inngest](https://mainsdk.dev/docs/integrations/inngest)
