Skip to content

DeltaBaseSubscription

API reference for DeltaBaseSubscription

@delta-base/alchemy


const DeltaBaseSubscription: Handler<(this, id, props) => Promise<DeltaBaseSubscriptionResource>>

Manage a DeltaBase webhook subscription as an Alchemy resource.

v1 is intentionally webhook-only. That matches the stable subscriber shape in the public DeltaBase SDK today and avoids pretending queue or workflow subscribers are production-ready before they are.

import { DeltaBaseSubscription } from '@delta-base/alchemy';
await DeltaBaseSubscription('users-projection', {
baseUrl: process.env.DELTABASE_URL ?? 'https://api.delta-base.com',
apiKey: process.env.DELTABASE_API_KEY ?? '',
eventStoreName: 'auth-service',
eventFilter: ['user.created', 'user.deleted'],
webhook: {
url: 'https://example.com/api/projections/users/events',
headers: {
Authorization: `Bearer ${process.env.PROJECTION_AUTH_TOKEN ?? ''}`,
},
},
});