// Api app config — first-class webhooks. Read by `voltro dev`. // // Webhooks are FILE-CONVENTION, not a plugins:[] entry — `*.webhook.tsx` files // are auto-discovered (the incoming `orders` receiver + the outgoing // `order.completed` event), and the bookkeeping tables come from // `webhookTables()` in database/schema.ts. The only wiring is the signing // secret declared below. // // `store: 'memory'` keeps first-run zero-infra; the durable delivery workflow // runs in-process. Swap to `store: 'postgres'` for cross-restart durability. import { defineEnv, envVar } from '@voltro/env' export const env = defineEnv({ // Shared secret for the incoming `orders` webhook. The convention is // VOLTRO_WEBHOOK_SECRET_ — for `id: 'orders'` that is _ORDERS. The // sender signs `.` with it and sends // `X-Webhook-Signature: t=,v1=`. // // `voltro dev` mints a project-local value into a gitignored `.env.local` so // the template ships no secret. For a REAL sender the value is not ours to // invent — you agree one with the partner out of band and set it in the // deployment; the minted local value only makes the example round-trip. VOLTRO_WEBHOOK_SECRET_ORDERS: envVar.secret({ generate: 'base64url', description: 'HMAC secret the `orders` webhook sender signs with.', }), }) export default { type: 'api' as const, name: '{{capProjectName}}{{capAppName}}', store: 'memory' as const, env, }