Skip to content

@delta-base/alchemy

API reference for @delta-base/alchemy

@delta-base/alchemy


Alchemy resources for DeltaBase.

Use these resources inside alchemy.run.ts files to reconcile DeltaBase event stores and webhook subscriptions alongside the rest of your infrastructure.

import alchemy from 'alchemy';
import {
DeltaBaseEventStore,
DeltaBaseSubscription,
} from '@delta-base/alchemy';
const app = await alchemy('billing');
const eventStore = await DeltaBaseEventStore('billing-events', {
baseUrl: process.env.DELTABASE_URL ?? 'https://api.delta-base.com',
apiKey: process.env.DELTABASE_API_KEY ?? '',
});
await DeltaBaseSubscription('billing-projection', {
baseUrl: process.env.DELTABASE_URL ?? 'https://api.delta-base.com',
apiKey: process.env.DELTABASE_API_KEY ?? '',
eventStoreName: eventStore.eventStoreName,
eventFilter: 'invoice.*',
webhook: {
url: 'https://billing.example.com/api/projections/invoices/events',
},
});
await app.finalize();