Basalt, inside every Vercel deploy.
Install the integration and Basalt adds one environment variable to your project. Edge and Node functions read views with the TypeScript SDK.
Install the integration and Basalt adds one environment variable to your project. Edge and Node functions read views with the TypeScript SDK.
The Vercel integration creates a scoped read token and sets BASALT_URL on each environment. The SDK uses fetch, so it runs in the Edge runtime and in Node, and routes to the region nearest your function.
Install Basalt from the Vercel Marketplace and pick a project. Preview and production get separate tokens.
# link a Vercel project to the workspace basalt connect vercel --project storefront --role readonly
Write plain SQL over the source. Basalt keeps the view current with every record and tracks lineage back to the topic, partition and offset.
CREATE MATERIALIZED VIEW revenue_by_min AS SELECT date_trunc('minute', ts) AS minute, currency, sum(amount) AS revenue, count(*) AS payments FROM payments WHERE status = 'captured' GROUP BY 1, 2;
Every view is an endpoint the moment it exists. Call it over REST, connect with any Postgres client, or use the SDK from your app.
curl https://api.basalt.dev/v1/views/revenue_by_min?limit=5 \ -H "Authorization: Bearer $BASALT_TOKEN"
BASALT_URL carries the endpoint and a scoped token. Nothing else to configure.
The SDK uses fetch only, so it runs in Edge Functions and Middleware.
Preview deploys get their own token, so you can limit what they read.
Generate TypeScript types from your views with basalt types pull.